| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Adding this variant works just fine:
/* Plain msgSend */ u.f = ((float (*) (id, SEL, float))objc_msgSend)(nc, sel, u.f); printf( "objc_msgSend: float u.f = %f\n", u.f );
Got float: 123.449997 objc_msgSend: float u.f = 124.449997
If I change your margs set up code to the following, I get the expected result:. . .
/* Set up the marg_list */
((double*)margs)[0] = u.f;
As Greg said, go read objc-msg-ppc.s to understand why. The relevant comment describes the true layout of margs, which has an array of 13 doubles at the beginning, which are animage of the floating point parameter registers that must be set. In this case, the float parameter x is supposed to be in fp0.
Cheers, -n8
-- >>>-- Nathaniel Gray -- Caltech Computer Science ------> >>>-- Mojave Project -- http://mojave.cs.caltech.edu -->
_______________________________________________ Do not post admin requests to the list. They will be ignored. Objc-language mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/objc-language/email@hidden
| References: | |
| >Sending floats using objc_msgSendv (From: Nathaniel Gray <email@hidden>) | |
| >Re: Sending floats using objc_msgSendv (From: Greg Parker <email@hidden>) | |
| >Re: Sending floats using objc_msgSendv (From: Sherm Pendley <email@hidden>) | |
| >Re: Sending floats using objc_msgSendv (From: Nathaniel Gray <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.