From d6a9b7e58967f3d996cc4f9b136f02d99b0b8159 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 14 Jan 2020 18:19:54 -0800 Subject: [PATCH] [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. --- llvm/test/CodeGen/Mips/uitofp.ll | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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