<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Oct 18, 2018 at 10:13 AM Connor Abbott <<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">And implement ac_bulid_expand_to_vec4() on top of it.<br>
<br>
Fixes: 7e7ee82698247d8f93fe37775b99f4838b0247dd ("ac: add support for 16bit buffer loads")<br>
---<br>
src/amd/common/ac_llvm_build.c | 40 ++++++++++++++++++++++------------<br>
src/amd/common/ac_llvm_build.h | 3 +++<br>
2 files changed, 29 insertions(+), 14 deletions(-)<br>
<br>
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c<br>
index 2d78ca1b52a..c54a50dcd86 100644<br>
--- a/src/amd/common/ac_llvm_build.c<br>
+++ b/src/amd/common/ac_llvm_build.c<br>
@@ -523,39 +523,51 @@ ac_build_gather_values(struct ac_llvm_context *ctx,<br>
return ac_build_gather_values_extended(ctx, values, value_count, 1, false, false);<br>
}<br>
<br>
-/* Expand a scalar or vector to <4 x type> by filling the remaining channels<br>
- * with undef. Extract at most num_channels components from the input.<br>
+/* Expand a scalar or vector to <dst_channels x type> by filling the remaining<br>
+ * channels with undef. Extract at most src_channels components from the input.<br>
*/<br>
-LLVMValueRef ac_build_expand_to_vec4(struct ac_llvm_context *ctx,<br>
- LLVMValueRef value,<br>
- unsigned num_channels)<br>
+LLVMValueRef ac_build_expand(struct ac_llvm_context *ctx,<br>
+ LLVMValueRef value,<br>
+ unsigned src_channels,<br>
+ unsigned dst_channels)<br>
{<br>
LLVMTypeRef elemtype;<br>
- LLVMValueRef chan[4];<br>
+ LLVMValueRef chan[dst_channels];<br></blockquote><div><br></div><div>That doesn't look like a valid syntax. dst_channel is not a compile-time constant. What was wrong with 4?</div><div><br></div><div>Other than that, this patch is:</div><div><br></div><div>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>></div><div><br></div><div>Marek</div><br></div></div>