aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-01-14 19:29:34 -0500
committerMarge Bot <[email protected]>2020-01-15 21:54:55 +0000
commit57bd73e2296a93a738960b183ea57c2aa0ccf4c2 (patch)
tree0ec67b30976242c936c58874a7b4e6a87787d0b3 /src/gallium
parent194449a405bfc391cf730f88ef45dee768960c4a (diff)
radeonsi: remove llvm_type_is_64bit
Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3399>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c6
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_internal.h10
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_llvm_tess.c8
3 files changed, 7 insertions, 17 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index e3676dddd67..cd352ec4cb2 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -473,7 +473,7 @@ static LLVMValueRef si_llvm_load_input_gs(struct ac_shader_abi *abi,
LLVMValueRef ptr = ac_build_gep0(&ctx->ac, ctx->esgs_ring, vtx_offset);
LLVMValueRef value = LLVMBuildLoad(ctx->ac.builder, ptr, "");
- if (llvm_type_is_64bit(ctx, type)) {
+ if (ac_get_type_size(type) == 64) {
ptr = LLVMBuildGEP(ctx->ac.builder, ptr,
&ctx->ac.i32_1, 1, "");
LLVMValueRef values[2] = {
@@ -507,7 +507,7 @@ static LLVMValueRef si_llvm_load_input_gs(struct ac_shader_abi *abi,
value = ac_build_buffer_load(&ctx->ac, ctx->esgs_ring, 1, ctx->i32_0,
vtx_offset, soffset, 0, ac_glc, true, false);
- if (llvm_type_is_64bit(ctx, type)) {
+ if (ac_get_type_size(type) == 64) {
LLVMValueRef value2;
soffset = LLVMConstInt(ctx->i32, (param * 4 + swizzle + 1) * 256, 0);
@@ -533,7 +533,7 @@ static LLVMValueRef si_nir_load_input_gs(struct ac_shader_abi *abi,
LLVMValueRef value[4];
for (unsigned i = 0; i < num_components; i++) {
unsigned offset = i;
- if (llvm_type_is_64bit(ctx, type))
+ if (ac_get_type_size(type) == 64)
offset *= 2;
offset += component;
diff --git a/src/gallium/drivers/radeonsi/si_shader_internal.h b/src/gallium/drivers/radeonsi/si_shader_internal.h
index 2c36e6d3007..dd3dafe77bf 100644
--- a/src/gallium/drivers/radeonsi/si_shader_internal.h
+++ b/src/gallium/drivers/radeonsi/si_shader_internal.h
@@ -333,14 +333,4 @@ void si_llvm_build_monolithic_ps(struct si_shader_context *ctx,
struct si_shader *shader);
void si_llvm_init_ps_callbacks(struct si_shader_context *ctx);
-/* TODO: remove */
-static inline bool llvm_type_is_64bit(struct si_shader_context *ctx,
- LLVMTypeRef type)
-{
- if (type == ctx->ac.i64 || type == ctx->ac.f64)
- return true;
-
- return false;
-}
-
#endif
diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c b/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c
index b01d0a4b5dc..549c4bf6b11 100644
--- a/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c
+++ b/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c
@@ -304,7 +304,7 @@ static LLVMValueRef buffer_load(struct si_shader_context *ctx,
return LLVMBuildBitCast(ctx->ac.builder, value, vec_type, "");
}
- if (!llvm_type_is_64bit(ctx, type)) {
+ if (ac_get_type_size(type) != 64) {
value = ac_build_buffer_load(&ctx->ac, buffer, 4, NULL, base, offset,
0, ac_glc, can_speculate, false);
@@ -345,7 +345,7 @@ static LLVMValueRef lshs_lds_load(struct si_shader_context *ctx,
}
/* Split 64-bit loads. */
- if (llvm_type_is_64bit(ctx, type)) {
+ if (ac_get_type_size(type) == 64) {
LLVMValueRef lo, hi;
lo = lshs_lds_load(ctx, ctx->i32, swizzle, dw_addr);
@@ -489,7 +489,7 @@ static LLVMValueRef si_nir_load_tcs_varyings(struct ac_shader_abi *abi,
LLVMValueRef value[4];
for (unsigned i = 0; i < num_components; i++) {
unsigned offset = i;
- if (llvm_type_is_64bit(ctx, type))
+ if (ac_get_type_size(type) == 64)
offset *= 2;
offset += component;
@@ -541,7 +541,7 @@ LLVMValueRef si_nir_load_input_tes(struct ac_shader_abi *abi,
LLVMValueRef value[4];
for (unsigned i = 0; i < num_components; i++) {
unsigned offset = i;
- if (llvm_type_is_64bit(ctx, type)) {
+ if (ac_get_type_size(type) == 64) {
offset *= 2;
if (offset == 4) {
ubyte name = info->input_semantic_name[driver_location + 1];