[PATCH] D21758: [X86] Accept SELECT op code for x86-64 fp128 type
Chih-Hung Hsieh via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 6 14:01:44 PDT 2016
chh updated this revision to Diff 62959.
chh added a comment.
Herald added a subscriber: mehdi_amini.
Regenerated test file with utils/update_llc_test_checks.py.
http://reviews.llvm.org/D21758
Files:
lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
test/CodeGen/X86/fp128-select.ll
Index: test/CodeGen/X86/fp128-select.ll
===================================================================
--- test/CodeGen/X86/fp128-select.ll
+++ test/CodeGen/X86/fp128-select.ll
@@ -0,0 +1,22 @@
+; 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
+; RUN: llc < %s -O2 -mtriple=x86_64-linux-gnu -mattr=+mmx | FileCheck %s
+
+define void @test_select(fp128* %p, fp128* %q, i1 zeroext %c) {
+; CHECK-LABEL: test_select:
+; CHECK: # BB#0:
+; CHECK-NEXT: testb %dl, %dl
+; CHECK-NEXT: jne .LBB0_1
+; CHECK-NEXT: # BB#2:
+; CHECK-NEXT: movaps {{.*}}(%rip), %xmm0
+; CHECK-NEXT: movaps %xmm0, (%rsi)
+; CHECK-NEXT: retq
+; CHECK-NEXT: .LBB0_1:
+; CHECK-NEXT: movaps (%rdi), %xmm0
+; CHECK-NEXT: movaps %xmm0, (%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: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -817,6 +817,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.62959.patch
Type: text/x-patch
Size: 1411 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160706/203faaeb/attachment-0001.bin>
More information about the llvm-commits
mailing list