@@ -385,3 +385,45 @@ __device__ void test_sqrt_f32(float* out, float a) {
385385__device__ void test_sqrt_f64 (double * out, double a) {
386386 *out = __builtin_amdgcn_sqrt (a);
387387}
388+
389+ // CIR-LABEL: @_Z12test_rsq_f32Pff
390+ // CIR: cir.llvm.intrinsic "amdgcn.rsq" {{.*}} : (!cir.float) -> !cir.float
391+ // LLVM: define{{.*}} void @_Z12test_rsq_f32Pff
392+ // LLVM: call{{.*}} float @llvm.amdgcn.rsq.f32(float %{{.*}})
393+ // OGCG: define{{.*}} void @_Z12test_rsq_f32Pff
394+ // OGCG: call{{.*}} float @llvm.amdgcn.rsq.f32(float %{{.*}})
395+ __device__ void test_rsq_f32 (float * out, float a)
396+ {
397+ *out = __builtin_amdgcn_rsqf (a);
398+ }
399+
400+ // CIR-LABEL: @_Z12test_rsq_f64Pdd
401+ // CIR: cir.llvm.intrinsic "amdgcn.rsq" {{.*}} : (!cir.double) -> !cir.double
402+ // LLVM: define{{.*}} void @_Z12test_rsq_f64Pdd
403+ // LLVM: call{{.*}} double @llvm.amdgcn.rsq.f64(double %{{.*}})
404+ // OGCG: define{{.*}} void @_Z12test_rsq_f64Pdd
405+ // OGCG: call{{.*}} double @llvm.amdgcn.rsq.f64(double %{{.*}})
406+ __device__ void test_rsq_f64 (double * out, double a) {
407+ *out = __builtin_amdgcn_rsq (a);
408+ }
409+
410+ // CIR-LABEL: @_Z18test_rsq_clamp_f32Pff
411+ // CIR: cir.llvm.intrinsic "amdgcn.rsq.clamp" {{.*}} : (!cir.float) -> !cir.float
412+ // LLVM: define{{.*}} void @_Z18test_rsq_clamp_f32Pff
413+ // LLVM: call{{.*}} float @llvm.amdgcn.rsq.clamp.f32(float %{{.*}})
414+ // OGCG: define{{.*}} void @_Z18test_rsq_clamp_f32Pff
415+ // OGCG: call{{.*}} float @llvm.amdgcn.rsq.clamp.f32(float %{{.*}})
416+ __device__ void test_rsq_clamp_f32 (float * out, float a)
417+ {
418+ *out = __builtin_amdgcn_rsq_clampf (a);
419+ }
420+
421+ // CIR-LABEL: @_Z18test_rsq_clamp_f64Pdd
422+ // CIR: cir.llvm.intrinsic "amdgcn.rsq.clamp" {{.*}} : (!cir.double) -> !cir.double
423+ // LLVM: define{{.*}} void @_Z18test_rsq_clamp_f64Pdd
424+ // LLVM: call{{.*}} double @llvm.amdgcn.rsq.clamp.f64(double %{{.*}})
425+ // OGCG: define{{.*}} void @_Z18test_rsq_clamp_f64Pdd
426+ // OGCG: call{{.*}} double @llvm.amdgcn.rsq.clamp.f64(double %{{.*}})
427+ __device__ void test_rsq_clamp_f64 (double * out, double a) {
428+ *out = __builtin_amdgcn_rsq_clamp (a);
429+ }
0 commit comments