[PATCH] D52555: [X86] Fix use SSE registers if no-x87 is selected.

Nirav Dave via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 1 13:22:42 PDT 2018


niravd added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:1922-1952
   if (!F.hasFnAttribute(Attribute::NoImplicitFloat)) {
     if (Size >= 16 &&
         (!Subtarget.isUnalignedMem16Slow() ||
          ((DstAlign == 0 || DstAlign >= 16) &&
           (SrcAlign == 0 || SrcAlign >= 16)))) {
       // FIXME: Check if unaligned 32-byte accesses are slow.
       if (Size >= 32 && Subtarget.hasAVX()) {
----------------
nickdesaulniers wrote:
> This whole block should be guarded from trying to use fp registers if the target does not have x87.  The current patch overfits our bizarro test case.
> 
> Can you then add test cases for other combinations:
> +avx,-x87, size >32 (L1928)
> +sse2,-x87 (L1936)
> +sse2,-x87,memcpy > 8B, i686 (L1942)
Looking at the history of this more, it seems that HasX87 was meant to correspond to mno-80387 which is disabling use of the x87 coprocessor. Without X87, GCC allows SSE2 (and successors) instructions, but avoids using SSE1 registers for memset. etc. 



Repository:
  rL LLVM

https://reviews.llvm.org/D52555





More information about the llvm-commits mailing list