Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: i386 assembler changed in XCode 2.4?



On Aug 9, 2006, at 2:42 PM, Michael Stahulak wrote:

I have some i386 assembly code (in a C source file) that works fine with XCode 2.3, but doesn't compile in XCode 2.4:

__asm
{
	mov	ebx, pDouble
	fld	TBYTE Ptr [ebx]
	fstp	QWORD Ptr [ebx]
}

and

__asm
{
	mov	ebx, pDouble
	fld	QWORD Ptr [ebx]
	fstp	TBYTE Ptr [ebx]
}

with XCode 2.4, I get these compile errors:

no such instruction: `fstpll 0(%ebx)'

and

no such instruction: `fldll 0(%ebx)'

As far as I can see looking at the build transcript, the arguments to gcc-4.0 are the same, the environment variables are essentially the same (different machines, so pathnames are different but equivalent), so the only possibility I can see is that this latest gcc-4.0 has broken this code. I'm clearly not an assembly language authority, and I've had a lot of trouble determining exactly what syntax the gcc-4.0 assembler supports in the first place, so fixing it at this point is leaving me a a loss. Anyone have any ideas?

As part of the work required for x86-64 support, the Intel assembler in Xcode 2.4 was updated to be based on a very recent version of GNU binutils, which in turn meant that a few instruction variants which were previously incorrectly accepted are no longer allowed. Specifically, the QWORD variants above should be emitted as fstpl and fldl, and the TBYTE versions should be fldt and fstpt, if I'm understanding TBYTE correctly.


It sounds like the compiler is emitting the wrong assembly code here. Please file a bug report at <http://bugreport.apple.com/>. This should be pretty simple to fix.

On a somewhat related note, I'm not sure what this assembly code is doing, but it looks like you should be able to do this in C....

-Eric

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >i386 assembler changed in XCode 2.4? (From: Michael Stahulak <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.