[llvm] 96d2db4 - [LoongArch] Pre-commit test for lib call auguments extension
via llvm-commits
llvm-commits at lists.llvm.org
Thu May 16 18:12:16 PDT 2024
Author: wanglei
Date: 2024-05-17T09:12:12+08:00
New Revision: 96d2db4ba9016b4512e7cd27d7dfda209d07ce62
URL: https://github.com/llvm/llvm-project/commit/96d2db4ba9016b4512e7cd27d7dfda209d07ce62
DIFF: https://github.com/llvm/llvm-project/commit/96d2db4ba9016b4512e7cd27d7dfda209d07ce62.diff
LOG: [LoongArch] Pre-commit test for lib call auguments extension
Reviewed By: SixWeining
Pull Request: https://github.com/llvm/llvm-project/pull/92374
Added:
llvm/test/CodeGen/LoongArch/libcall-extend.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/LoongArch/libcall-extend.ll b/llvm/test/CodeGen/LoongArch/libcall-extend.ll
new file mode 100644
index 0000000000000..957a15141802d
--- /dev/null
+++ b/llvm/test/CodeGen/LoongArch/libcall-extend.ll
@@ -0,0 +1,48 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
+; RUN: llc --mtriple=loongarch64 --target-abi=lp64s --mattr=-f < %s | FileCheck %s
+
+define signext i32 @convert_float_to_i32(i32 %tmp, float %a) nounwind {
+; CHECK-LABEL: convert_float_to_i32:
+; CHECK: # %bb.0:
+; CHECK-NEXT: addi.d $sp, $sp, -16
+; CHECK-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
+; CHECK-NEXT: bstrpick.d $a0, $a1, 31, 0
+; CHECK-NEXT: bl %plt(__fixsfsi)
+; CHECK-NEXT: addi.w $a0, $a0, 0
+; CHECK-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
+; CHECK-NEXT: addi.d $sp, $sp, 16
+; CHECK-NEXT: ret
+ %1 = fptosi float %a to i32
+ ret i32 %1
+}
+
+define signext i32 @convert_double_to_i32(i32 %tmp, double %a) nounwind {
+; CHECK-LABEL: convert_double_to_i32:
+; CHECK: # %bb.0:
+; CHECK-NEXT: addi.d $sp, $sp, -16
+; CHECK-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
+; CHECK-NEXT: move $a0, $a1
+; CHECK-NEXT: bl %plt(__fixdfsi)
+; CHECK-NEXT: addi.w $a0, $a0, 0
+; CHECK-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
+; CHECK-NEXT: addi.d $sp, $sp, 16
+; CHECK-NEXT: ret
+ %1 = fptosi double %a to i32
+ ret i32 %1
+}
+
+define signext i32 @convert_fp128_to_i32(i32 %tmp, fp128 %a) nounwind {
+; CHECK-LABEL: convert_fp128_to_i32:
+; CHECK: # %bb.0:
+; CHECK-NEXT: addi.d $sp, $sp, -16
+; CHECK-NEXT: st.d $ra, $sp, 8 # 8-byte Folded Spill
+; CHECK-NEXT: move $a0, $a1
+; CHECK-NEXT: move $a1, $a2
+; CHECK-NEXT: bl %plt(__fixtfsi)
+; CHECK-NEXT: addi.w $a0, $a0, 0
+; CHECK-NEXT: ld.d $ra, $sp, 8 # 8-byte Folded Reload
+; CHECK-NEXT: addi.d $sp, $sp, 16
+; CHECK-NEXT: ret
+ %1 = fptosi fp128 %a to i32
+ ret i32 %1
+}
More information about the llvm-commits
mailing list