[clang] [clang][X86] Fix round builtins tests (PR #226708)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 26 08:31:22 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-x86
Author: Borys Perski (borysperski)
<details>
<summary>Changes</summary>
Fixed minor issues in round builtins tests. Noticed them while working on #<!-- -->215787.
---
Full diff: https://github.com/llvm/llvm-project/pull/226708.diff
2 Files Affected:
- (modified) clang/test/CodeGen/X86/sse41-builtins-constrained.c (+6-6)
- (modified) clang/test/CodeGen/X86/sse41-builtins.c (+9-9)
``````````diff
diff --git a/clang/test/CodeGen/X86/sse41-builtins-constrained.c b/clang/test/CodeGen/X86/sse41-builtins-constrained.c
index 6b25bd27af7e0..2a0fcd052a7d4 100644
--- a/clang/test/CodeGen/X86/sse41-builtins-constrained.c
+++ b/clang/test/CodeGen/X86/sse41-builtins-constrained.c
@@ -58,8 +58,8 @@ __m128 test_mm_round_ps_fround_no_exc(__m128 x) {
__m128d test_mm_round_sd_ceil(__m128d x, __m128d y) {
// CHECK-LABEL: test_mm_round_sd_ceil
// CHECK: %[[A:.*]] = extractelement <2 x double> %{{.*}}, i32 0
- // CHECK: %[[B:.*]] = call double @llvm.experimental.constrained.ceil.f64(double %[[A:.*]], metadata !"fpexcept.ignore")
- // CHECK: %{{.*}} = insertelement <2 x double> %0, double %[[B:.*]], i32 0
+ // CHECK: %[[B:.*]] = call double @llvm.experimental.constrained.ceil.f64(double %[[A]], metadata !"fpexcept.ignore")
+ // CHECK: %{{.*}} = insertelement <2 x double> %{{.*}}, double %[[B]], i32 0
return _mm_round_sd(x, y, 0b1010);
}
@@ -78,19 +78,19 @@ __m128d test_mm_round_sd_fround_no_exc(__m128d x, __m128d y) {
__m128 test_mm_round_ss_trunc(__m128 x, __m128 y) {
// CHECK-LABEL: test_mm_round_ss_trunc
// CHECK: %[[A:.*]] = extractelement <4 x float> %{{.*}}, i32 0
- // CHECK: %[[B:.*]] = call float @llvm.experimental.constrained.trunc.f32(float %[[A:.*]], metadata !"fpexcept.ignore")
- // CHECK: %{{.*}} = insertelement <4 x float> %0, float %[[B:.*]], i32 0
+ // CHECK: %[[B:.*]] = call float @llvm.experimental.constrained.trunc.f32(float %[[A]], metadata !"fpexcept.ignore")
+ // CHECK: %{{.*}} = insertelement <4 x float> %{{.*}}, float %[[B]], i32 0
return _mm_round_ss(x, y, 0b1011);
}
__m128 test_mm_round_ss_mxcsr(__m128 x, __m128 y) {
// CHECK-LABEL: test_mm_round_ss_mxcsr
- // CHECK: %{{.*}} = call <4 x float> @llvm.x86.sse41.round.ss(<4 x float> %{{.*}}, <4 x float> %1, i32 12)
+ // CHECK: %{{.*}} = call <4 x float> @llvm.x86.sse41.round.ss(<4 x float> %{{.*}}, <4 x float> %{{.*}}, i32 12)
return _mm_round_ss(x, y, 0b1100);
}
__m128 test_mm_round_ss_fround_no_exc(__m128 x, __m128 y) {
// CHECK-LABEL: test_mm_round_ss_fround_no_exc
- // CHECK: %{{.*}} = call <4 x float> @llvm.x86.sse41.round.ss(<4 x float> %{{.*}}, <4 x float> %1, i32 0)
+ // CHECK: %{{.*}} = call <4 x float> @llvm.x86.sse41.round.ss(<4 x float> %{{.*}}, <4 x float> %{{.*}}, i32 0)
return _mm_round_ss(x, y, 0b0000);
}
diff --git a/clang/test/CodeGen/X86/sse41-builtins.c b/clang/test/CodeGen/X86/sse41-builtins.c
index a12fc724f1398..ec743284afe43 100644
--- a/clang/test/CodeGen/X86/sse41-builtins.c
+++ b/clang/test/CodeGen/X86/sse41-builtins.c
@@ -75,7 +75,7 @@ TEST_CONSTEXPR(match_m128(_mm_blendv_ps((__m128)(__v4sf){0.0f, 1.0f, 2.0f, 3.0f}
__m128d test_mm_ceil_pd(__m128d x) {
// CHECK-LABEL: test_mm_ceil_pd
- // CHECK %{{.*}} = call <2 x double> @llvm.ceil.v2f64(<2 x double> %{{.*}})
+ // CHECK: %{{.*}} = call <2 x double> @llvm.x86.sse41.round.pd(<2 x double> %{{.*}}, i32 2)
return _mm_ceil_pd(x);
}
@@ -478,40 +478,40 @@ __m128 test_mm_round_ps_fround_no_exc(__m128 x) {
__m128d test_mm_round_sd(__m128d x, __m128d y) {
// CHECK-LABEL: test_mm_round_sd
// CHECK: %[[A:.*]] = extractelement <2 x double> %{{.*}}, i32 0
- // CHECK: %[[B:.*]] = call double @llvm.roundeven.f64(double %[[A:.*]])
- // CHECK: %{{.*}} = insertelement <2 x double> %0, double %[[B:.*]], i32 0
+ // CHECK: %[[B:.*]] = call double @llvm.roundeven.f64(double %[[A]])
+ // CHECK: %{{.*}} = insertelement <2 x double> %{{.*}}, double %[[B]], i32 0
return _mm_round_sd(x, y, 0b1000);
}
__m128d test_mm_round_sd_mxcsr(__m128d x, __m128d y) {
// CHECK-LABEL: test_mm_round_sd_mxcsr
- // CHECK: %{{.*}} = call <2 x double> @llvm.x86.sse41.round.sd(<2 x double> %0, <2 x double> %{{.*}}, i32 12)
+ // CHECK: %{{.*}} = call <2 x double> @llvm.x86.sse41.round.sd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i32 12)
return _mm_round_sd(x, y, 0b1100);
}
__m128d test_mm_round_sd_fround_no_exc(__m128d x, __m128d y) {
// CHECK-LABEL: test_mm_round_sd_fround_no_exc
- // CHECK: %{{.*}} = call <2 x double> @llvm.x86.sse41.round.sd(<2 x double> %0, <2 x double> %{{.*}}, i32 0)
+ // CHECK: %{{.*}} = call <2 x double> @llvm.x86.sse41.round.sd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i32 0)
return _mm_round_sd(x, y, 0b0000);
}
__m128 test_mm_round_ss(__m128 x, __m128 y) {
// CHECK-LABEL: test_mm_round_ss
// CHECK: %[[A:.*]] = extractelement <4 x float> %{{.*}}, i32 0
- // CHECK: %[[B:.*]] = call float @llvm.trunc.f32(float %[[A:.*]])
- // CHECK: %{{.*}} = insertelement <4 x float> %0, float %[[B:.*]], i32 0
+ // CHECK: %[[B:.*]] = call float @llvm.trunc.f32(float %[[A]])
+ // CHECK: %{{.*}} = insertelement <4 x float> %{{.*}}, float %[[B]], i32 0
return _mm_round_ss(x, y, 0b1011);
}
__m128 test_mm_round_ss_mxcsr(__m128 x, __m128 y) {
// CHECK-LABEL: test_mm_round_ss_mxcsr
- // CHECK: %{{.*}} = call <4 x float> @llvm.x86.sse41.round.ss(<4 x float> %0, <4 x float> %{{.*}}, i32 12)
+ // CHECK: %{{.*}} = call <4 x float> @llvm.x86.sse41.round.ss(<4 x float> %{{.*}}, <4 x float> %{{.*}}, i32 12)
return _mm_round_ss(x, y, 0b1100);
}
__m128 test_mm_round_ss_fround_no_exc(__m128 x, __m128 y) {
// CHECK-LABEL: test_mm_round_ss_fround_no_exc
- // CHECK: %{{.*}} = call <4 x float> @llvm.x86.sse41.round.ss(<4 x float> %0, <4 x float> %{{.*}}, i32 0)
+ // CHECK: %{{.*}} = call <4 x float> @llvm.x86.sse41.round.ss(<4 x float> %{{.*}}, <4 x float> %{{.*}}, i32 0)
return _mm_round_ss(x, y, 0b0000);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/226708
More information about the cfe-commits
mailing list