clang/HIP: Fix missing test for __frsqrt_rn
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 22 Nov 2022 16:21:18 +0000 (11:21 -0500)
committerMatt Arsenault <arsenm2@gmail.com>
Thu, 22 Dec 2022 13:43:15 +0000 (08:43 -0500)
clang/test/Headers/__clang_hip_math.hip

index a8b95cb..edc9731 100644 (file)
@@ -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]]