[PowerPC] Pre-commit test case of float rounding in kernel build. NFC.
authorKai Luo <lkail@cn.ibm.com>
Tue, 7 Apr 2020 02:07:58 +0000 (02:07 +0000)
committerKai Luo <lkail@cn.ibm.com>
Tue, 7 Apr 2020 02:07:58 +0000 (02:07 +0000)
llvm/test/CodeGen/PowerPC/kernel-fp-round.ll [new file with mode: 0644]

diff --git a/llvm/test/CodeGen/PowerPC/kernel-fp-round.ll b/llvm/test/CodeGen/PowerPC/kernel-fp-round.ll
new file mode 100644 (file)
index 0000000..c01f75c
--- /dev/null
@@ -0,0 +1,14 @@
+; RUN: llc -simplify-mir -verify-machineinstrs -stop-after=finalize-isel \
+; RUN:   -mtriple=powerpc64le-unknown-unknown -mattr=-vsx < %s | FileCheck %s
+
+define float @test(float %a) {
+; CHECK:        stack:
+; CHECK-NEXT:   - { id: 0, size: 4, alignment: 4 }
+; CHECK:        %2:f8rc = FCTIWZ killed %1, implicit $rm
+; CHECK:        STFIWX killed %2, $zero8, %3
+; CHECK-NEXT:   %4:f8rc = LFIWAX $zero8, %3 :: (load 4 from %stack.0, align 1)
+entry:
+  %b = fptosi float %a to i32
+  %c = sitofp i32 %b to float
+  ret float %c
+}