[llvm] [KnownFPClass] Add tests for FTPZ|DAPZ and dynamic denormal modes (PR #227943)
Eric Ross via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 30 21:52:03 PDT 2026
================
@@ -107,7 +187,67 @@ define float @ret_tanh_nonneg(float nofpclass(ninf nzero nsub nnorm) %arg) {
define float @ret_tanh_nonan(float nofpclass(nan) %arg) {
; CHECK-LABEL: define nofpclass(nan inf) float @ret_tanh_nonan
; CHECK-SAME: (float nofpclass(nan) [[ARG:%.*]]) #[[ATTR1]] {
-; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan inf) float @llvm.tanh.f32(float nofpclass(nan) [[ARG]]) #[[ATTR2]]
+; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan inf) float @llvm.tanh.f32(float nofpclass(nan) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT: ret float [[CALL]]
+;
+ %call = call float @llvm.tanh.f32(float %arg)
+ ret float %call
+}
+
+define float @ret_tanh_negnormal_negsubnormal_mode_dynamic_dynamic(float nofpclass(nan inf zero psub pnorm) %arg) #0 {
+; CHECK-LABEL: define nofpclass(nan inf) float @ret_tanh_negnormal_negsubnormal_mode_dynamic_dynamic
+; CHECK-SAME: (float nofpclass(nan inf zero psub pnorm) [[ARG:%.*]]) #[[ATTR2]] {
+; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan inf) float @llvm.tanh.f32(float nofpclass(nan inf zero psub pnorm) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT: ret float [[CALL]]
+;
+ %call = call float @llvm.tanh.f32(float %arg)
+ ret float %call
+}
+
+define float @ret_tanh_negnormal_negsubnormal_mode_ftpz_dapz(float nofpclass(nan inf zero psub pnorm) %arg) #1 {
+; CHECK-LABEL: define nofpclass(nan inf) float @ret_tanh_negnormal_negsubnormal_mode_ftpz_dapz
+; CHECK-SAME: (float nofpclass(nan inf zero psub pnorm) [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan inf) float @llvm.tanh.f32(float nofpclass(nan inf zero psub pnorm) [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT: ret float [[CALL]]
+;
+ %call = call float @llvm.tanh.f32(float %arg)
+ ret float %call
+}
+
+define float @ret_tanh_negnormal_mode_dynamic_dynamic(float nofpclass(nan inf zero sub pnorm) %arg) #0 {
----------------
ZERICO2005 wrote:
`tanh(fcNegNormal)` may be `fcNegSubnormal`, meaning that the result could flush to `fcPosZero`.
https://github.com/llvm/llvm-project/pull/227943
More information about the llvm-commits
mailing list