GDC release 0.20

Thomas Kuehne thomas-dloop at kuehne.cn
Wed Dec 27 04:07:56 PST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Frits van Bommel schrieb am 2006-12-25:
> Thomas Kuehne wrote:
>> Neither floating point nor MMX nor SSE instructions where the cause 
>> but the "cpuid" feature tests.
>> 
>> I had to replace
>> 
>> 	asm{ cpuid; }
>> 
>> with
>> 	asm{db 0x53; cpuid; db 0x5B;}
>
> Does GDC's asm not support a more clear
> 	asm {push EBX; cpuid; pop EBX; }
> ?

It does, however if I compile with "-fPIC" GDC errors with:
error: PIC register `ebx' clobbered in `asm'

> Or for that matter, doesn't it know what registers are changed by 
> instructions so it can save the ones it needs to preserve (DMD does that 
> IIRC)?
> (Or if it isn't sure, doesn't it at least make sure they get pushed & 
> popped as a precaution?)

DMD preserves them via copying to the stack. GDC doesn't preserve them
and apparently only knowns the clobbering rules for some instructions
(e.g. pop EBX) but not others (e.g. push EBX).

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFFkkZKLK5blCcjpWoRAnsHAJ4wH4Z6+SiJkllM6S48AXEJCRqWcwCfXUww
sV5ZrY1kUPbnov5YXAkcTWc=
=7zkJ
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-announce mailing list