Chris Lattner
2011-Apr-14 21:37 UTC
[LLVMdev] [x86 codegen] 3DNow! intrinsics not behaving as expected.
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
Michael Spencer
2011-Apr-14 21:43 UTC
[LLVMdev] [x86 codegen] 3DNow! intrinsics not behaving as expected.
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? - Michael Spencer
Chris Lattner
2011-Apr-14 21:58 UTC
[LLVMdev] [x86 codegen] 3DNow! intrinsics not behaving as expected.
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, -Chris
Possibly Parallel Threads
- [LLVMdev] [x86 codegen] 3DNow! intrinsics not behaving as expected.
- [LLVMdev] [x86 codegen] 3DNow! intrinsics not behaving as expected.
- [LLVMdev] [x86 codegen] 3DNow! intrinsics not behaving as expected.
- [LLVMdev] Lowering to MMX
- [LLVMdev] LLVM 2.8 and MMX