ac: properly document a buffer.store LLVM workaround
authorMarek Olšák <marek.olsak@amd.com>
Sat, 30 Sep 2017 13:36:18 +0000 (15:36 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 6 Oct 2017 00:56:11 +0000 (02:56 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/amd/common/ac_llvm_build.c
src/amd/common/ac_llvm_build.h

index 46153a0c39c59c9473b56ef9c524e23844910985..1d97b09cd4f772558399414884a6012aa9227354 100644 (file)
@@ -760,10 +760,13 @@ ac_build_buffer_store_dword(struct ac_llvm_context *ctx,
                            bool glc,
                            bool slc,
                            bool writeonly_memory,
-                           bool has_add_tid)
+                           bool swizzle_enable_hint)
 {
-       /* TODO: Fix stores with ADD_TID and remove the "has_add_tid" flag. */
-       if (!has_add_tid) {
+       /* SWIZZLE_ENABLE requires that soffset isn't folded into voffset
+        * (voffset is swizzled, but soffset isn't swizzled).
+        * llvm.amdgcn.buffer.store doesn't have a separate soffset parameter.
+        */
+       if (!swizzle_enable_hint) {
                /* Split 3 channel stores, becase LLVM doesn't support 3-channel
                 * intrinsics. */
                if (num_channels == 3) {
@@ -777,11 +780,11 @@ ac_build_buffer_store_dword(struct ac_llvm_context *ctx,
 
                        ac_build_buffer_store_dword(ctx, rsrc, v01, 2, voffset,
                                                    soffset, inst_offset, glc, slc,
-                                                   writeonly_memory, has_add_tid);
+                                                   writeonly_memory, swizzle_enable_hint);
                        ac_build_buffer_store_dword(ctx, rsrc, v[2], 1, voffset,
                                                    soffset, inst_offset + 8,
                                                    glc, slc,
-                                                   writeonly_memory, has_add_tid);
+                                                   writeonly_memory, swizzle_enable_hint);
                        return;
                }
 
index 1d6dc0ab2f5512531881c2f2a9451a6a4114ba60..ac8ea9c4152e1814384059ba7185744a3af49fef 100644 (file)
@@ -170,7 +170,7 @@ ac_build_buffer_store_dword(struct ac_llvm_context *ctx,
                            bool glc,
                            bool slc,
                            bool writeonly_memory,
-                           bool has_add_tid);
+                           bool swizzle_enable_hint);
 LLVMValueRef
 ac_build_buffer_load(struct ac_llvm_context *ctx,
                     LLVMValueRef rsrc,