This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Wed, Jan 07, 2004 at 02:36:13PM -0800, Stuart Hastings wrote:Yes, both of the CPUID instructions here kill %eax, %ebx, %ecx, and %edx. However, if I admit as much in the __asm__, and I compile with -fPIC (default on Darwin/x86), GCC stops here with the diagnostic
/Volumes/sandbox/stuart/gcc.fsf/gcc/testsuite/gcc.dg/i386-cpuid.h:39: error: PIC register `ebx' clobbered in `asm'
Ergo, I chose to lie to GCC about the CPUID instruction. :-( I really
dislike doing this; sleazy tricks like this usually cause maintenance
headaches later on (e.g. if GCC gets smarter about the PIC register, we
could and should describe CPUID correctly here). Do you know a better
way?
__asm__ ("push %ebx; cpuid; pop %ebx" : "=a" (fl1) : "0" (0) : "ecx" "edx", cc");
Ok with that fix.
Which also removes the need for the nowhere call too, right?
r~
stuart hastings Apple Computer
Attachment:
gcc.fsf.diffs.txt
Description: Text document
Attachment:
i386-cpuid.h
Description: Text document
Attachment:
i386-sse-5.c
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |