summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/GlobalISel/legalize-fsub-scalar.mir
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/X86/GlobalISel/legalize-fsub-scalar.mir')
-rw-r--r--test/CodeGen/X86/GlobalISel/legalize-fsub-scalar.mir74
1 files changed, 74 insertions, 0 deletions
diff --git a/test/CodeGen/X86/GlobalISel/legalize-fsub-scalar.mir b/test/CodeGen/X86/GlobalISel/legalize-fsub-scalar.mir
new file mode 100644
index 0000000000000..3b3ee4aa0afbb
--- /dev/null
+++ b/test/CodeGen/X86/GlobalISel/legalize-fsub-scalar.mir
@@ -0,0 +1,74 @@
+# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=legalizer %s -o - | FileCheck %s
+--- |
+
+ define float @test_fsub_float(float %arg1, float %arg2) {
+ %ret = fsub float %arg1, %arg2
+ ret float %ret
+ }
+
+ define double @test_fsub_double(double %arg1, double %arg2) {
+ %ret = fsub double %arg1, %arg2
+ ret double %ret
+ }
+
+...
+---
+name: test_fsub_float
+# CHECK-LABEL: name: test_fsub_float
+alignment: 4
+legalized: false
+regBankSelected: false
+registers:
+ - { id: 0, class: _, preferred-register: '' }
+ - { id: 1, class: _, preferred-register: '' }
+ - { id: 2, class: _, preferred-register: '' }
+liveins:
+fixedStack:
+stack:
+constants:
+# CHECK: %0(s32) = COPY %xmm0
+# CHECK-NEXT: %1(s32) = COPY %xmm1
+# CHECK-NEXT: %2(s32) = G_FSUB %0, %1
+# CHECK-NEXT: %xmm0 = COPY %2(s32)
+# CHECK-NEXT: RET 0, implicit %xmm0
+body: |
+ bb.1 (%ir-block.0):
+ liveins: %xmm0, %xmm1
+
+ %0(s32) = COPY %xmm0
+ %1(s32) = COPY %xmm1
+ %2(s32) = G_FSUB %0, %1
+ %xmm0 = COPY %2(s32)
+ RET 0, implicit %xmm0
+
+...
+---
+name: test_fsub_double
+# CHECK-LABEL: name: test_fsub_double
+alignment: 4
+legalized: false
+regBankSelected: false
+registers:
+ - { id: 0, class: _, preferred-register: '' }
+ - { id: 1, class: _, preferred-register: '' }
+ - { id: 2, class: _, preferred-register: '' }
+liveins:
+fixedStack:
+stack:
+constants:
+# CHECK: %0(s64) = COPY %xmm0
+# CHECK-NEXT: %1(s64) = COPY %xmm1
+# CHECK-NEXT: %2(s64) = G_FSUB %0, %1
+# CHECK-NEXT: %xmm0 = COPY %2(s64)
+# CHECK-NEXT: RET 0, implicit %xmm0
+body: |
+ bb.1 (%ir-block.0):
+ liveins: %xmm0, %xmm1
+
+ %0(s64) = COPY %xmm0
+ %1(s64) = COPY %xmm1
+ %2(s64) = G_FSUB %0, %1
+ %xmm0 = COPY %2(s64)
+ RET 0, implicit %xmm0
+
+...