radeonsi: fix doubles and int64
authorMarek Olšák <marek.olsak@amd.com>
Fri, 17 Jan 2020 23:37:35 +0000 (18:37 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 20 Jan 2020 20:40:10 +0000 (15:40 -0500)
Fixes: 57bd73e2296 - radeonsi: remove llvm_type_is_64bit
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/gallium/drivers/radeonsi/si_shader_llvm_gs.c
src/gallium/drivers/radeonsi/si_shader_llvm_tess.c

index a11748325dd367a729bf9389447892401418a5f2..a622ca5b0d21f6584e38cf22b2e06c7ea1709328 100644 (file)
@@ -88,7 +88,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, "");
 
                LLVMValueRef ptr = ac_build_gep0(&ctx->ac, ctx->esgs_ring, vtx_offset);
                LLVMValueRef value = LLVMBuildLoad(ctx->ac.builder, ptr, "");
-               if (ac_get_type_size(type) == 64) {
+               if (ac_get_type_size(type) == 8) {
                        ptr = LLVMBuildGEP(ctx->ac.builder, ptr,
                                           &ctx->ac.i32_1, 1, "");
                        LLVMValueRef values[2] = {
                        ptr = LLVMBuildGEP(ctx->ac.builder, ptr,
                                           &ctx->ac.i32_1, 1, "");
                        LLVMValueRef values[2] = {
@@ -122,7 +122,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);
 
        value = ac_build_buffer_load(&ctx->ac, ctx->esgs_ring, 1, ctx->i32_0,
                                     vtx_offset, soffset, 0, ac_glc, true, false);
-       if (ac_get_type_size(type) == 64) {
+       if (ac_get_type_size(type) == 8) {
                LLVMValueRef value2;
                soffset = LLVMConstInt(ctx->i32, (param * 4 + swizzle + 1) * 256, 0);
 
                LLVMValueRef value2;
                soffset = LLVMConstInt(ctx->i32, (param * 4 + swizzle + 1) * 256, 0);
 
@@ -148,7 +148,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;
        LLVMValueRef value[4];
        for (unsigned i = 0; i < num_components; i++) {
                unsigned offset = i;
-               if (ac_get_type_size(type) == 64)
+               if (ac_get_type_size(type) == 8)
                        offset *= 2;
 
                offset += component;
                        offset *= 2;
 
                offset += component;
index 549c4bf6b11e0a43e093d952ada47ccf5ad39e0f..e809f287ff58030d40886f5e1d41fa711aea4792 100644 (file)
@@ -304,7 +304,7 @@ static LLVMValueRef buffer_load(struct si_shader_context *ctx,
                return LLVMBuildBitCast(ctx->ac.builder, value, vec_type, "");
        }
 
                return LLVMBuildBitCast(ctx->ac.builder, value, vec_type, "");
        }
 
-       if (ac_get_type_size(type) != 64) {
+       if (ac_get_type_size(type) != 8) {
                value = ac_build_buffer_load(&ctx->ac, buffer, 4, NULL, base, offset,
                                             0, ac_glc, can_speculate, false);
 
                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. */
        }
 
        /* Split 64-bit loads. */
-       if (ac_get_type_size(type) == 64) {
+       if (ac_get_type_size(type) == 8) {
                LLVMValueRef lo, hi;
 
                lo = lshs_lds_load(ctx, ctx->i32, swizzle, dw_addr);
                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;
        LLVMValueRef value[4];
        for (unsigned i = 0; i < num_components; i++) {
                unsigned offset = i;
-               if (ac_get_type_size(type) == 64)
+               if (ac_get_type_size(type) == 8)
                        offset *= 2;
 
                offset += component;
                        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;
        LLVMValueRef value[4];
        for (unsigned i = 0; i < num_components; i++) {
                unsigned offset = i;
-               if (ac_get_type_size(type) == 64) {
+               if (ac_get_type_size(type) == 8) {
                        offset *= 2;
                        if (offset == 4) {
                                ubyte name = info->input_semantic_name[driver_location + 1];
                        offset *= 2;
                        if (offset == 4) {
                                ubyte name = info->input_semantic_name[driver_location + 1];