[llvm] d6a9b7e - [Mips] Add FileCheck to a test that just tested for a crash.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 15 10:30:53 PST 2020


Author: Craig Topper
Date: 2020-01-15T10:29:56-08:00
New Revision: d6a9b7e58967f3d996cc4f9b136f02d99b0b8159

URL: https://github.com/llvm/llvm-project/commit/d6a9b7e58967f3d996cc4f9b136f02d99b0b8159
DIFF: https://github.com/llvm/llvm-project/commit/d6a9b7e58967f3d996cc4f9b136f02d99b0b8159.diff

LOG: [Mips] Add FileCheck to a test that just tested for a crash.

I believe the generated code here can suffer from double rounding.
So I wanted to capture the existing codegen so we can make
decisions about how to fix it.

Added: 
    

Modified: 
    llvm/test/CodeGen/Mips/uitofp.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/Mips/uitofp.ll b/llvm/test/CodeGen/Mips/uitofp.ll
index 83c2069f9661..9b1f7478fb72 100644
--- a/llvm/test/CodeGen/Mips/uitofp.ll
+++ b/llvm/test/CodeGen/Mips/uitofp.ll
@@ -1,6 +1,25 @@
-; RUN: llc -march=mips -mattr=+single-float < %s
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -march=mips -mattr=+single-float < %s | FileCheck %s
 
 define void @f0() nounwind {
+; CHECK-LABEL: f0:
+; CHECK:       # %bb.0: # %entry
+; CHECK-NEXT:    addiu $sp, $sp, -8
+; CHECK-NEXT:    addiu $1, $zero, 1
+; CHECK-NEXT:    sw $1, 4($sp)
+; CHECK-NEXT:    lui $1, %hi($CPI0_0)
+; CHECK-NEXT:    addiu $1, $1, %lo($CPI0_0)
+; CHECK-NEXT:    lw $2, 4($sp)
+; CHECK-NEXT:    srl $3, $2, 29
+; CHECK-NEXT:    andi $3, $3, 4
+; CHECK-NEXT:    addu $1, $1, $3
+; CHECK-NEXT:    lwc1 $f0, 0($1)
+; CHECK-NEXT:    mtc1 $2, $f1
+; CHECK-NEXT:    cvt.s.w $f1, $f1
+; CHECK-NEXT:    add.s $f0, $f1, $f0
+; CHECK-NEXT:    swc1 $f0, 0($sp)
+; CHECK-NEXT:    jr $ra
+; CHECK-NEXT:    addiu $sp, $sp, 8
 entry:
   %b = alloca i32, align 4
   %a = alloca float, align 4


        


More information about the llvm-commits mailing list