[PATCH] D21758: [X86] Accept SELECT op code for x86-64 fp128 type

Chih-Hung Hsieh via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 18 10:27:36 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL275818: [X86] Accept SELECT op code for x86-64 fp128 type (authored by chh).

Changed prior to commit:
  https://reviews.llvm.org/D21758?vs=64183&id=64345#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D21758

Files:
  llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
  llvm/trunk/test/CodeGen/X86/fp128-select.ll

Index: llvm/trunk/test/CodeGen/X86/fp128-select.ll
===================================================================
--- llvm/trunk/test/CodeGen/X86/fp128-select.ll
+++ llvm/trunk/test/CodeGen/X86/fp128-select.ll
@@ -0,0 +1,35 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -O2 -mtriple=x86_64-linux-android -mattr=+mmx | FileCheck %s --check-prefix=MMX
+; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu -mattr=+mmx | FileCheck %s --check-prefix=MMX
+; RUN: llc < %s -O2 -mtriple=x86_64-linux-android | FileCheck %s
+; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu | FileCheck %s
+
+define void @test_select(fp128* %p, fp128* %q, i1 zeroext %c) {
+; MMX-LABEL: test_select:
+; MMX:       # BB#0:
+; MMX-NEXT:    testb %dl, %dl
+; MMX-NEXT:    jne .LBB0_1
+; MMX-NEXT:  # BB#2:
+; MMX-NEXT:    movaps {{.*}}(%rip), %xmm0
+; MMX-NEXT:    movaps %xmm0, (%rsi)
+; MMX-NEXT:    retq
+; MMX-NEXT:  .LBB0_1:
+; MMX-NEXT:    movaps (%rdi), %xmm0
+; MMX-NEXT:    movaps %xmm0, (%rsi)
+; MMX-NEXT:    retq
+;
+; CHECK-LABEL: test_select:
+; CHECK:       # BB#0:
+; CHECK-NEXT:    xorl %eax, %eax
+; CHECK-NEXT:    testb %dl, %dl
+; CHECK-NEXT:    cmovneq (%rdi), %rax
+; CHECK-NEXT:    movabsq $9223231299366420480, %rcx # imm = 0x7FFF800000000000
+; CHECK-NEXT:    cmovneq 8(%rdi), %rcx
+; CHECK-NEXT:    movq %rcx, 8(%rsi)
+; CHECK-NEXT:    movq %rax, (%rsi)
+; CHECK-NEXT:    retq
+  %a = load fp128, fp128* %p, align 2
+  %r = select i1 %c, fp128 %a, fp128 0xL00000000000000007FFF800000000000
+  store fp128 %r, fp128* %q
+  ret void
+}
Index: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -816,6 +816,7 @@
     case ISD::FCOPYSIGN:
     case ISD::FNEG:
     case ISD::Register:
+    case ISD::SELECT:
       return true;
   }
   return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21758.64345.patch
Type: text/x-patch
Size: 1997 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160718/ed21f565/attachment.bin>


More information about the llvm-commits mailing list