@@ -365,3 +365,45 @@ __device__ void test_rcp_f32(float* out, float a) {
365365__device__ void test_rcp_f64 (double * out, double a) {
366366 *out = __builtin_amdgcn_rcp (a);
367367}
368+
369+ // CIR-LABEL: @_Z12test_rsq_f32Pff
370+ // CIR: cir.llvm.intrinsic "amdgcn.rsq" {{.*}} : (!cir.float) -> !cir.float
371+ // LLVM: define{{.*}} void @_Z12test_rsq_f32Pff
372+ // LLVM: call{{.*}} float @llvm.amdgcn.rsq.f32(float %{{.*}})
373+ // OGCG: define{{.*}} void @_Z12test_rsq_f32Pff
374+ // OGCG: call{{.*}} float @llvm.amdgcn.rsq.f32(float %{{.*}})
375+ __device__ void test_rsq_f32 (float * out, float a)
376+ {
377+ *out = __builtin_amdgcn_rsqf (a);
378+ }
379+
380+ // CIR-LABEL: @_Z12test_rsq_f64Pdd
381+ // CIR: cir.llvm.intrinsic "amdgcn.rsq" {{.*}} : (!cir.double) -> !cir.double
382+ // LLVM: define{{.*}} void @_Z12test_rsq_f64Pdd
383+ // LLVM: call{{.*}} double @llvm.amdgcn.rsq.f64(double %{{.*}})
384+ // OGCG: define{{.*}} void @_Z12test_rsq_f64Pdd
385+ // OGCG: call{{.*}} double @llvm.amdgcn.rsq.f64(double %{{.*}})
386+ __device__ void test_rsq_f64 (double * out, double a) {
387+ *out = __builtin_amdgcn_rsq (a);
388+ }
389+
390+ // CIR-LABEL: @_Z18test_rsq_clamp_f32Pff
391+ // CIR: cir.llvm.intrinsic "amdgcn.rsq.clamp" {{.*}} : (!cir.float) -> !cir.float
392+ // LLVM: define{{.*}} void @_Z18test_rsq_clamp_f32Pff
393+ // LLVM: call{{.*}} float @llvm.amdgcn.rsq.clamp.f32(float %{{.*}})
394+ // OGCG: define{{.*}} void @_Z18test_rsq_clamp_f32Pff
395+ // OGCG: call{{.*}} float @llvm.amdgcn.rsq.clamp.f32(float %{{.*}})
396+ __device__ void test_rsq_clamp_f32 (float * out, float a)
397+ {
398+ *out = __builtin_amdgcn_rsq_clampf (a);
399+ }
400+
401+ // CIR-LABEL: @_Z18test_rsq_clamp_f64Pdd
402+ // CIR: cir.llvm.intrinsic "amdgcn.rsq.clamp" {{.*}} : (!cir.double) -> !cir.double
403+ // LLVM: define{{.*}} void @_Z18test_rsq_clamp_f64Pdd
404+ // LLVM: call{{.*}} double @llvm.amdgcn.rsq.clamp.f64(double %{{.*}})
405+ // OGCG: define{{.*}} void @_Z18test_rsq_clamp_f64Pdd
406+ // OGCG: call{{.*}} double @llvm.amdgcn.rsq.clamp.f64(double %{{.*}})
407+ __device__ void test_rsq_clamp_f64 (double * out, double a) {
408+ *out = __builtin_amdgcn_rsq_clamp (a);
409+ }
0 commit comments