[FPEnv][RISCV] Correct strictfp tests.
Correct RISC-V strictfp tests to follow the rules documented in the LangRef:
https://llvm.org/docs/LangRef.html#constrained-floating-point-intrinsics
Mostly these tests just needed the strictfp attribute on function definitions.
I've also removed the strictfp attribute from uses of the constrained
intrinsics because it comes by default since D154991, but I only did this
in tests I was changing anyway.
Test changes verified with D146845.
diff --git a/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-ftrunc-constrained-sdnode.ll b/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-ftrunc-constrained-sdnode.ll
index c09c19f..f165814 100644
--- a/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-ftrunc-constrained-sdnode.ll
+++ b/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-ftrunc-constrained-sdnode.ll
@@ -4,7 +4,7 @@
; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfh,+v -target-abi=lp64d \
; RUN: -verify-machineinstrs < %s | FileCheck %s
-define <1 x half> @trunc_v1f16(<1 x half> %x) {
+define <1 x half> @trunc_v1f16(<1 x half> %x) strictfp {
; CHECK-LABEL: trunc_v1f16:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 1, e16, mf4, ta, ma
@@ -24,7 +24,7 @@
}
declare <1 x half> @llvm.experimental.constrained.trunc.v1f16(<1 x half>, metadata)
-define <2 x half> @trunc_v2f16(<2 x half> %x) {
+define <2 x half> @trunc_v2f16(<2 x half> %x) strictfp {
; CHECK-LABEL: trunc_v2f16:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
@@ -44,7 +44,7 @@
}
declare <2 x half> @llvm.experimental.constrained.trunc.v2f16(<2 x half>, metadata)
-define <4 x half> @trunc_v4f16(<4 x half> %x) {
+define <4 x half> @trunc_v4f16(<4 x half> %x) strictfp {
; CHECK-LABEL: trunc_v4f16:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
@@ -64,7 +64,7 @@
}
declare <4 x half> @llvm.experimental.constrained.trunc.v4f16(<4 x half>, metadata)
-define <8 x half> @trunc_v8f16(<8 x half> %x) {
+define <8 x half> @trunc_v8f16(<8 x half> %x) strictfp {
; CHECK-LABEL: trunc_v8f16:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
@@ -84,7 +84,7 @@
}
declare <8 x half> @llvm.experimental.constrained.trunc.v8f16(<8 x half>, metadata)
-define <16 x half> @trunc_v16f16(<16 x half> %x) {
+define <16 x half> @trunc_v16f16(<16 x half> %x) strictfp {
; CHECK-LABEL: trunc_v16f16:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
@@ -104,7 +104,7 @@
}
declare <16 x half> @llvm.experimental.constrained.trunc.v16f16(<16 x half>, metadata)
-define <32 x half> @trunc_v32f16(<32 x half> %x) {
+define <32 x half> @trunc_v32f16(<32 x half> %x) strictfp {
; CHECK-LABEL: trunc_v32f16:
; CHECK: # %bb.0:
; CHECK-NEXT: li a0, 32
@@ -125,7 +125,7 @@
}
declare <32 x half> @llvm.experimental.constrained.trunc.v32f16(<32 x half>, metadata)
-define <1 x float> @trunc_v1f32(<1 x float> %x) {
+define <1 x float> @trunc_v1f32(<1 x float> %x) strictfp {
; CHECK-LABEL: trunc_v1f32:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 1, e32, mf2, ta, ma
@@ -145,7 +145,7 @@
}
declare <1 x float> @llvm.experimental.constrained.trunc.v1f32(<1 x float>, metadata)
-define <2 x float> @trunc_v2f32(<2 x float> %x) {
+define <2 x float> @trunc_v2f32(<2 x float> %x) strictfp {
; CHECK-LABEL: trunc_v2f32:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
@@ -165,7 +165,7 @@
}
declare <2 x float> @llvm.experimental.constrained.trunc.v2f32(<2 x float>, metadata)
-define <4 x float> @trunc_v4f32(<4 x float> %x) {
+define <4 x float> @trunc_v4f32(<4 x float> %x) strictfp {
; CHECK-LABEL: trunc_v4f32:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
@@ -185,7 +185,7 @@
}
declare <4 x float> @llvm.experimental.constrained.trunc.v4f32(<4 x float>, metadata)
-define <8 x float> @trunc_v8f32(<8 x float> %x) {
+define <8 x float> @trunc_v8f32(<8 x float> %x) strictfp {
; CHECK-LABEL: trunc_v8f32:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
@@ -205,7 +205,7 @@
}
declare <8 x float> @llvm.experimental.constrained.trunc.v8f32(<8 x float>, metadata)
-define <16 x float> @trunc_v16f32(<16 x float> %x) {
+define <16 x float> @trunc_v16f32(<16 x float> %x) strictfp {
; CHECK-LABEL: trunc_v16f32:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 16, e32, m4, ta, ma
@@ -225,7 +225,7 @@
}
declare <16 x float> @llvm.experimental.constrained.trunc.v16f32(<16 x float>, metadata)
-define <1 x double> @trunc_v1f64(<1 x double> %x) {
+define <1 x double> @trunc_v1f64(<1 x double> %x) strictfp {
; CHECK-LABEL: trunc_v1f64:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 1, e64, m1, ta, ma
@@ -245,7 +245,7 @@
}
declare <1 x double> @llvm.experimental.constrained.trunc.v1f64(<1 x double>, metadata)
-define <2 x double> @trunc_v2f64(<2 x double> %x) {
+define <2 x double> @trunc_v2f64(<2 x double> %x) strictfp {
; CHECK-LABEL: trunc_v2f64:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
@@ -265,7 +265,7 @@
}
declare <2 x double> @llvm.experimental.constrained.trunc.v2f64(<2 x double>, metadata)
-define <4 x double> @trunc_v4f64(<4 x double> %x) {
+define <4 x double> @trunc_v4f64(<4 x double> %x) strictfp {
; CHECK-LABEL: trunc_v4f64:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
@@ -285,7 +285,7 @@
}
declare <4 x double> @llvm.experimental.constrained.trunc.v4f64(<4 x double>, metadata)
-define <8 x double> @trunc_v8f64(<8 x double> %x) {
+define <8 x double> @trunc_v8f64(<8 x double> %x) strictfp {
; CHECK-LABEL: trunc_v8f64:
; CHECK: # %bb.0:
; CHECK-NEXT: vsetivli zero, 8, e64, m4, ta, ma