Skip to content

Commit f407a73

Browse files
committed
clang/HIP: Remove __llvm_amdgcn_* wrapper hacks
These are leftover hacks from using asm declaratios to access intrinsics.
1 parent 85232b0 commit f407a73

File tree

2 files changed

+1
-33
lines changed

2 files changed

+1
-33
lines changed

clang/lib/Headers/__clang_hip_libdevice_declares.h

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -137,23 +137,6 @@ __device__ __attribute__((const)) float __ocml_fma_rte_f32(float, float, float);
137137
__device__ __attribute__((const)) float __ocml_fma_rtn_f32(float, float, float);
138138
__device__ __attribute__((const)) float __ocml_fma_rtp_f32(float, float, float);
139139
__device__ __attribute__((const)) float __ocml_fma_rtz_f32(float, float, float);
140-
141-
__device__ inline __attribute__((const)) float
142-
__llvm_amdgcn_cos_f32(float __x) {
143-
return __builtin_amdgcn_cosf(__x);
144-
}
145-
__device__ inline __attribute__((const)) float
146-
__llvm_amdgcn_rcp_f32(float __x) {
147-
return __builtin_amdgcn_rcpf(__x);
148-
}
149-
__device__ inline __attribute__((const)) float
150-
__llvm_amdgcn_rsq_f32(float __x) {
151-
return __builtin_amdgcn_rsqf(__x);
152-
}
153-
__device__ inline __attribute__((const)) float
154-
__llvm_amdgcn_sin_f32(float __x) {
155-
return __builtin_amdgcn_sinf(__x);
156-
}
157140
// END INTRINSICS
158141
// END FLOAT
159142

@@ -277,15 +260,6 @@ __device__ __attribute__((const)) double __ocml_fma_rtp_f64(double, double,
277260
__device__ __attribute__((const)) double __ocml_fma_rtz_f64(double, double,
278261
double);
279262

280-
__device__ inline __attribute__((const)) double
281-
__llvm_amdgcn_rcp_f64(double __x) {
282-
return __builtin_amdgcn_rcp(__x);
283-
}
284-
__device__ inline __attribute__((const)) double
285-
__llvm_amdgcn_rsq_f64(double __x) {
286-
return __builtin_amdgcn_rsq(__x);
287-
}
288-
289263
__device__ __attribute__((const)) _Float16 __ocml_ceil_f16(_Float16);
290264
__device__ _Float16 __ocml_cos_f16(_Float16);
291265
__device__ __attribute__((const)) _Float16 __ocml_cvtrtn_f16_f32(float);
@@ -305,7 +279,6 @@ __device__ __attribute__((const)) int __ocml_isnan_f16(_Float16);
305279
__device__ __attribute__((pure)) _Float16 __ocml_log_f16(_Float16);
306280
__device__ __attribute__((pure)) _Float16 __ocml_log10_f16(_Float16);
307281
__device__ __attribute__((pure)) _Float16 __ocml_log2_f16(_Float16);
308-
__device__ __attribute__((const)) _Float16 __llvm_amdgcn_rcp_f16(_Float16);
309282
__device__ __attribute__((const)) _Float16 __ocml_rint_f16(_Float16);
310283
__device__ __attribute__((const)) _Float16 __ocml_rsqrt_f16(_Float16);
311284
__device__ _Float16 __ocml_sin_f16(_Float16);
@@ -332,11 +305,6 @@ __device__ __attribute__((const)) __2i16 __ocml_isnan_2f16(__2f16);
332305
__device__ __attribute__((pure)) __2f16 __ocml_log_2f16(__2f16);
333306
__device__ __attribute__((pure)) __2f16 __ocml_log10_2f16(__2f16);
334307
__device__ __attribute__((pure)) __2f16 __ocml_log2_2f16(__2f16);
335-
__device__ inline __2f16
336-
__llvm_amdgcn_rcp_2f16(__2f16 __x) // Not currently exposed by ROCDL.
337-
{
338-
return (__2f16)(__llvm_amdgcn_rcp_f16(__x.x), __llvm_amdgcn_rcp_f16(__x.y));
339-
}
340308
__device__ __attribute__((const)) __2f16 __ocml_rint_2f16(__2f16);
341309
__device__ __attribute__((const)) __2f16 __ocml_rsqrt_2f16(__2f16);
342310
__device__ __2f16 __ocml_sin_2f16(__2f16);

clang/lib/Headers/__clang_hip_math.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ float __frcp_rn(float __x) { return 1.0f / __x; }
647647
#endif
648648

649649
__DEVICE__
650-
float __frsqrt_rn(float __x) { return __llvm_amdgcn_rsq_f32(__x); }
650+
float __frsqrt_rn(float __x) { return __builtin_amdgcn_rsqf(__x); }
651651

652652
#if defined OCML_BASIC_ROUNDED_OPERATIONS
653653
__DEVICE__

0 commit comments

Comments
 (0)