[llvm] 46fb225 - [InstSimplify] Add tests for f16 to i128 range (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 15 09:18:29 PDT 2024
Author: Nikita Popov
Date: 2024-08-15T18:18:19+02:00
New Revision: 46fb225f3ac602970ebb8973a5376cd9216ba38f
URL: https://github.com/llvm/llvm-project/commit/46fb225f3ac602970ebb8973a5376cd9216ba38f
DIFF: https://github.com/llvm/llvm-project/commit/46fb225f3ac602970ebb8973a5376cd9216ba38f.diff
LOG: [InstSimplify] Add tests for f16 to i128 range (NFC)
Added:
Modified:
llvm/test/Transforms/InstSimplify/fptoi-range.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstSimplify/fptoi-range.ll b/llvm/test/Transforms/InstSimplify/fptoi-range.ll
index cc9605259aa811..e0689c26c71903 100644
--- a/llvm/test/Transforms/InstSimplify/fptoi-range.ll
+++ b/llvm/test/Transforms/InstSimplify/fptoi-range.ll
@@ -32,6 +32,17 @@ define i1 @f16_si16_max2(half %f) {
ret i1 %c
}
+define i1 @f16_si128_max2(half %f) {
+; CHECK-LABEL: @f16_si128_max2(
+; CHECK-NEXT: [[I:%.*]] = fptosi half [[F:%.*]] to i128
+; CHECK-NEXT: [[C:%.*]] = icmp sgt i128 [[I]], 65504
+; CHECK-NEXT: ret i1 [[C]]
+;
+ %i = fptosi half %f to i128
+ %c = icmp sgt i128 %i, 65504
+ ret i1 %c
+}
+
define i1 @f16_si_min1(half %f) {
; CHECK-LABEL: @f16_si_min1(
; CHECK-NEXT: ret i1 true
@@ -41,6 +52,17 @@ define i1 @f16_si_min1(half %f) {
ret i1 %c
}
+define i1 @f16_si128_min1(half %f) {
+; CHECK-LABEL: @f16_si128_min1(
+; CHECK-NEXT: [[I:%.*]] = fptosi half [[F:%.*]] to i128
+; CHECK-NEXT: [[C:%.*]] = icmp sge i128 [[I]], -65504
+; CHECK-NEXT: ret i1 [[C]]
+;
+ %i = fptosi half %f to i128
+ %c = icmp sge i128 %i, -65504
+ ret i1 %c
+}
+
define i1 @f16_si16_min1(half %f) {
; CHECK-LABEL: @f16_si16_min1(
; CHECK-NEXT: [[I:%.*]] = fptosi half [[F:%.*]] to i16
More information about the llvm-commits
mailing list