summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-01-10 12:57:19 +0100
committerSamuel Pitoiset <[email protected]>2018-01-10 19:02:23 +0100
commit7239e265ebe200891f161a07337cd31a92bf6ff8 (patch)
tree6a567e45469b614ed612107c2322a04a9b0a1dee /src/gallium/drivers/radeonsi
parentb391fb26df9f1b0c1673cb79be2478b0fe459f9e (diff)
amd/common: import get_{load,store}_intr_attribs() from RadeonSI
v2: move those helpers to the header and use static inline Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> (v1)
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c
index fe0cfcef997..d5c9470974a 100644
--- a/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c
+++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c
@@ -390,22 +390,6 @@ static void load_fetch_args(
}
}
-static unsigned get_load_intr_attribs(bool can_speculate)
-{
- /* READNONE means writes can't affect it, while READONLY means that
- * writes can affect it. */
- return can_speculate && HAVE_LLVM >= 0x0400 ?
- LP_FUNC_ATTR_READNONE :
- LP_FUNC_ATTR_READONLY;
-}
-
-static unsigned get_store_intr_attribs(bool writeonly_memory)
-{
- return writeonly_memory && HAVE_LLVM >= 0x0400 ?
- LP_FUNC_ATTR_INACCESSIBLE_MEM_ONLY :
- LP_FUNC_ATTR_WRITEONLY;
-}
-
static void load_emit_buffer(struct si_shader_context *ctx,
struct lp_build_emit_data *emit_data,
bool can_speculate, bool allow_smem)
@@ -586,7 +570,7 @@ static void load_emit(
lp_build_intrinsic(
builder, "llvm.amdgcn.buffer.load.format.v4f32", emit_data->dst_type,
emit_data->args, emit_data->arg_count,
- get_load_intr_attribs(can_speculate));
+ ac_get_load_intr_attribs(can_speculate));
} else {
ac_get_image_intr_name("llvm.amdgcn.image.load",
emit_data->dst_type, /* vdata */
@@ -598,7 +582,7 @@ static void load_emit(
lp_build_intrinsic(
builder, intrinsic_name, emit_data->dst_type,
emit_data->args, emit_data->arg_count,
- get_load_intr_attribs(can_speculate));
+ ac_get_load_intr_attribs(can_speculate));
}
}
@@ -734,7 +718,7 @@ static void store_emit_buffer(
lp_build_intrinsic(
builder, intrinsic_name, emit_data->dst_type,
emit_data->args, emit_data->arg_count,
- get_store_intr_attribs(writeonly_memory));
+ ac_get_store_intr_attribs(writeonly_memory));
}
}
@@ -798,7 +782,7 @@ static void store_emit(
builder, "llvm.amdgcn.buffer.store.format.v4f32",
emit_data->dst_type, emit_data->args,
emit_data->arg_count,
- get_store_intr_attribs(writeonly_memory));
+ ac_get_store_intr_attribs(writeonly_memory));
} else {
ac_get_image_intr_name("llvm.amdgcn.image.store",
LLVMTypeOf(emit_data->args[0]), /* vdata */
@@ -810,7 +794,7 @@ static void store_emit(
lp_build_intrinsic(
builder, intrinsic_name, emit_data->dst_type,
emit_data->args, emit_data->arg_count,
- get_store_intr_attribs(writeonly_memory));
+ ac_get_store_intr_attribs(writeonly_memory));
}
}