Predefined Version expansion

Walter Bright newshound1 at digitalmars.com
Mon Apr 2 17:23:26 PDT 2007


Dan wrote:
> Walter Bright Wrote:
>>> Predefining those so that compiler writers can raise errors if they don't yet support SSE3 instructions, but they do support x86 and MMX, would be a smart thing to do.  It would also allow implementors to write code that WON'T compile and try to run if the user's CPU doesn't support it - preventing what could be a devastating crash.
>> The inline assembler does support all the SSE3 instructions, etc.
> 
> Yes, the GDC and DMD implementations support all the SSE3 instructions, but someone with a i486 Pentium Pro does not, and neither might another D implementation implementing the D language spec.
> 
> When I use an SSE3 instruction in D, is it going to raise an error if the person's system is only a Pentium Pro?
> 
> If that could be done by checking the CPU support for each instruction implicitly, then it would be even better than versioning it all off...  but I don't think that's the case - and it's not specified?

I think what you need is a runtime check, which is provided in std.cpuid.



More information about the Digitalmars-d mailing list