Re: [Mesa-dev] [PATCH] ac: fix incorrect argument type for tbuffer.{load, store} with LLVM 7

2019-03-21 Thread Bas Nieuwenhuizen
r-b

On Thu, Mar 21, 2019 at 12:41 PM Samuel Pitoiset
 wrote:
>
> GLC/SLC are boolean.
>
> This fixes the following LLVM error when checkir is set:
> Intrinsic has incorrect argument type!
> void (i32, <4 x i32>, i32, i32, i32, i32, i32, i32, i32, i32)* 
> @llvm.amdgcn.tbuffer.store.i32
>
> Signed-off-by: Samuel Pitoiset 
> ---
>  src/amd/common/ac_llvm_build.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
> index 8701d2ca43a..1123dce2cc8 100644
> --- a/src/amd/common/ac_llvm_build.c
> +++ b/src/amd/common/ac_llvm_build.c
> @@ -1537,8 +1537,8 @@ ac_build_tbuffer_load(struct ac_llvm_context *ctx,
> immoffset,
> LLVMConstInt(ctx->i32, dfmt, false),
> LLVMConstInt(ctx->i32, nfmt, false),
> -   LLVMConstInt(ctx->i32, glc, false),
> -   LLVMConstInt(ctx->i32, slc, false),
> +   LLVMConstInt(ctx->i1, glc, false),
> +   LLVMConstInt(ctx->i1, slc, false),
> };
> unsigned func = CLAMP(num_channels, 1, 3) - 1;
> LLVMTypeRef types[] = {ctx->i32, ctx->v2i32, ctx->v4i32};
> @@ -1699,8 +1699,8 @@ ac_build_tbuffer_store(struct ac_llvm_context *ctx,
> immoffset,
> LLVMConstInt(ctx->i32, dfmt, false),
> LLVMConstInt(ctx->i32, nfmt, false),
> -   LLVMConstInt(ctx->i32, glc, false),
> -   LLVMConstInt(ctx->i32, slc, false),
> +   LLVMConstInt(ctx->i1, glc, false),
> +   LLVMConstInt(ctx->i1, slc, false),
> };
> unsigned func = CLAMP(num_channels, 1, 3) - 1;
> const char *type_names[] = {"i32", "v2i32", "v4i32"};
> --
> 2.21.0
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] ac: fix incorrect argument type for tbuffer.{load, store} with LLVM 7

2019-03-21 Thread Samuel Pitoiset
GLC/SLC are boolean.

This fixes the following LLVM error when checkir is set:
Intrinsic has incorrect argument type!
void (i32, <4 x i32>, i32, i32, i32, i32, i32, i32, i32, i32)* 
@llvm.amdgcn.tbuffer.store.i32

Signed-off-by: Samuel Pitoiset 
---
 src/amd/common/ac_llvm_build.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index 8701d2ca43a..1123dce2cc8 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -1537,8 +1537,8 @@ ac_build_tbuffer_load(struct ac_llvm_context *ctx,
immoffset,
LLVMConstInt(ctx->i32, dfmt, false),
LLVMConstInt(ctx->i32, nfmt, false),
-   LLVMConstInt(ctx->i32, glc, false),
-   LLVMConstInt(ctx->i32, slc, false),
+   LLVMConstInt(ctx->i1, glc, false),
+   LLVMConstInt(ctx->i1, slc, false),
};
unsigned func = CLAMP(num_channels, 1, 3) - 1;
LLVMTypeRef types[] = {ctx->i32, ctx->v2i32, ctx->v4i32};
@@ -1699,8 +1699,8 @@ ac_build_tbuffer_store(struct ac_llvm_context *ctx,
immoffset,
LLVMConstInt(ctx->i32, dfmt, false),
LLVMConstInt(ctx->i32, nfmt, false),
-   LLVMConstInt(ctx->i32, glc, false),
-   LLVMConstInt(ctx->i32, slc, false),
+   LLVMConstInt(ctx->i1, glc, false),
+   LLVMConstInt(ctx->i1, slc, false),
};
unsigned func = CLAMP(num_channels, 1, 3) - 1;
const char *type_names[] = {"i32", "v2i32", "v4i32"};
-- 
2.21.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev