[clang] 9e03115 - clang/HIP: Fix missing test for __frsqrt_rn

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 22 05:43:20 PST 2022


Author: Matt Arsenault
Date: 2022-12-22T08:43:15-05:00
New Revision: 9e0311561c8ed4df2d67a5a1fba16a148683c3c9

URL: https://github.com/llvm/llvm-project/commit/9e0311561c8ed4df2d67a5a1fba16a148683c3c9
DIFF: https://github.com/llvm/llvm-project/commit/9e0311561c8ed4df2d67a5a1fba16a148683c3c9.diff

LOG: clang/HIP: Fix missing test for __frsqrt_rn

Added: 
    

Modified: 
    clang/test/Headers/__clang_hip_math.hip

Removed: 
    


################################################################################
diff  --git a/clang/test/Headers/__clang_hip_math.hip b/clang/test/Headers/__clang_hip_math.hip
index a8b95cb0f7b0..edc9731de9bb 100644
--- a/clang/test/Headers/__clang_hip_math.hip
+++ b/clang/test/Headers/__clang_hip_math.hip
@@ -767,6 +767,7 @@ extern "C" __device__ float test_exp2f(float x) {
   return exp2f(x);
 }
 
+//
 // DEFAULT-LABEL: @test_exp2(
 // DEFAULT-NEXT:  entry:
 // DEFAULT-NEXT:    [[CALL_I:%.*]] = tail call contract double @__ocml_exp2_f64(double noundef [[X:%.*]]) #[[ATTR14]]
@@ -3388,6 +3389,20 @@ extern "C" __device__ float test___frcp_rn(float x) {
   return __frcp_rn(x);
 }
 
+// DEFAULT-LABEL: @test___frsqrt_rn(
+// DEFAULT-NEXT:  entry:
+// DEFAULT-NEXT:    [[TMP0:%.*]] = tail call contract float @llvm.amdgcn.rsq.f32(float [[X:%.*]])
+// DEFAULT-NEXT:    ret float [[TMP0]]
+//
+// FINITEONLY-LABEL: @test___frsqrt_rn(
+// FINITEONLY-NEXT:  entry:
+// FINITEONLY-NEXT:    [[TMP0:%.*]] = tail call nnan ninf contract float @llvm.amdgcn.rsq.f32(float [[X:%.*]])
+// FINITEONLY-NEXT:    ret float [[TMP0]]
+//
+extern "C" __device__ float test___frsqrt_rn(float x) {
+  return __frsqrt_rn(x);
+}
+
 // DEFAULT-LABEL: @test___fsqrt_rn(
 // DEFAULT-NEXT:  entry:
 // DEFAULT-NEXT:    [[CALL_I:%.*]] = tail call contract float @__ocml_native_sqrt_f32(float noundef [[X:%.*]]) #[[ATTR13]]


        


More information about the cfe-commits mailing list