[PATCH] D37365: [x86] Enable f128 as a legal type in 64-bit mode if SSE is enabled rather than if MMX is enabled.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 31 17:52:47 PDT 2017


craig.topper created this revision.
Herald added a subscriber: srhines.

Currently if you use f128 in 64-bit mode with sse disabled and mmx enabled, you get an error about not being able to use an SSE register for a return. And then later we throw an assert trying to emit an xmm register copy.

Changing this to check SSE instead of MMX at least stops us from printing the error and asserting.

I'm still not sure this is correct though. Looking at some assembly with sse/mmx enabled we think the f128 library functions like add return their result in xmm0. But if you disable sse/mmx we then think they return their result in rax/rdx. So unless the library functions return their result both ways, I don't think this is correct.

Here's an example that currently crashes when compiled with "clang -c -mno-mmx"

  void foo(__float128 a, __float128 b, __float128 *c) {
      *c = a + b;
  }


https://reviews.llvm.org/D37365

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/extract-store.ll
  test/CodeGen/X86/fp128-select.ll
  test/CodeGen/X86/vec_fp_to_int.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37365.113492.patch
Type: text/x-patch
Size: 8283 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170901/df4692a4/attachment.bin>


More information about the llvm-commits mailing list