ac: make use of ac_build_expand_to_vec4() in visit_image_store()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 12 Feb 2019 14:09:29 +0000 (15:09 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 14 Feb 2019 08:09:48 +0000 (09:09 +0100)
And make ac_build_expand() a static function.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_llvm_build.c
src/amd/common/ac_llvm_build.h
src/amd/common/ac_nir_to_llvm.c

index 9395bd1bbda722ccfa1b41d7d4a109925bb1fd07..d06eb7df50c202bb87ef1969177980af71e24a7a 100644 (file)
@@ -548,10 +548,11 @@ ac_build_gather_values(struct ac_llvm_context *ctx,
 /* Expand a scalar or vector to <dst_channels x type> by filling the remaining
  * channels with undef. Extract at most src_channels components from the input.
  */
-LLVMValueRef ac_build_expand(struct ac_llvm_context *ctx,
-                            LLVMValueRef value,
-                            unsigned src_channels,
-                            unsigned dst_channels)
+static LLVMValueRef
+ac_build_expand(struct ac_llvm_context *ctx,
+               LLVMValueRef value,
+               unsigned src_channels,
+               unsigned dst_channels)
 {
        LLVMTypeRef elemtype;
        LLVMValueRef chan[dst_channels];
index f218eaf2832da66dc2c95f0bbd75356d32e04d20..7f8e2398a2550a990796461757488b202ae9d71f 100644 (file)
@@ -171,9 +171,6 @@ LLVMValueRef
 ac_build_gather_values(struct ac_llvm_context *ctx,
                       LLVMValueRef *values,
                       unsigned value_count);
-LLVMValueRef ac_build_expand(struct ac_llvm_context *ctx,
-                            LLVMValueRef value,
-                            unsigned src_channels, unsigned dst_channels);
 LLVMValueRef ac_build_expand_to_vec4(struct ac_llvm_context *ctx,
                                     LLVMValueRef value,
                                     unsigned num_channels);
index 4f44e32d9f9abea5a1800fad7322c06f67e636c6..946ea9a4a8a6c79e20ca96a2dd2588bf93fb8794 100644 (file)
@@ -2508,7 +2508,7 @@ static void visit_image_store(struct ac_nir_context *ctx,
                unsigned src_channels = ac_get_llvm_num_components(src);
 
                if (src_channels == 3)
-                       src = ac_build_expand(&ctx->ac, src, 3, 4);
+                       src = ac_build_expand_to_vec4(&ctx->ac, src, 3);
 
                params[0] = src; /* data */
                params[1] = rsrc;