Direct recursion detection possible?

Cecil Ward cecil at cecilward.com
Thu May 25 09:54:36 UTC 2023


On Thursday, 25 May 2023 at 08:08:45 UTC, Cecil Ward wrote:
> On Thursday, 25 May 2023 at 08:03:24 UTC, Cecil Ward wrote:
>> On Thursday, 25 May 2023 at 02:30:35 UTC, Steven Schveighoffer 
>> wrote:
>>> [...]
>>
>> Understood, quite so. Indeed that’s why I kept it to ‘direct’. 
>> Is anyone up for helping me deal with that one limited case of 
>> direct straight loops ?
>>
>> [...]
>
> Our posts crossed, as I was updating mine, Timon.

This is how I got into my infinite recursion, roughly. See below. 
I had to kludge it by renaming the first overload given below, 
‘specific 16-bit arts’ one. The template below generated an asm 
instruction quite happily.


/* 16-bit alternative for the 2-operand form, the raw opcode, 
with the correct widenings */
uint
bextr16( in uint16_t src_rm, in uint16_t bitfieldstartwidth_rb )  
pure nothrow @nogc @trusted
	{
	return bextr( cast(uint32_t) src_rm, cast(uint32_t) 
bitfieldstartwidth_rb );
	}
	
T
bextr(T)( in T src_rm, in T bitfieldstartwidth_rb ) pure nothrow 
@nogc @trusted
                  if (is( T == uint64_t ) || is( T == uint32_t ) )
	{
	asm { … }
	}


More information about the Digitalmars-d mailing list