[LLVMdev] [x86 codegen] 3DNow! intrinsics not behaving as expected.

Chris Lattner clattner at apple.com
Thu Apr 14 14:58:14 PDT 2011

On Apr 14, 2011, at 2:43 PM, Michael Spencer wrote:

> On Thu, Apr 14, 2011 at 5:37 PM, Chris Lattner <clattner at apple.com> wrote:
>> On Apr 14, 2011, at 12:47 PM, Eli Friedman wrote:
>>>> I looked at the program using a debugger, and the pfadd instruction is
>>>> executed correctly and the MMX register contains the correct values.
>>>> The code that prepares the stack for the printf call seems to be
>>>> messing it up.
>>> I would call that "user error"; basically, using MMX instructions
>>> messes up the FP stack, and we assume the user is smart enough to make
>>> sure the two don't mix.
>> More specifically, if you use MMX/3dNow intrinsics, you have to call "emms" at ABI boundaries.
>> -Chris
> Ok, now it makes sense. Thanks. Now that I know this is right, are
> these patches ok to commit? Or should I post them to the llvm-commits,
> and cfe-commits list?

If they seem obvious to you, feel free to commit them directly.  Thanks Michael,


More information about the llvm-dev mailing list