[Mesa-dev] [PATCH 7/9] nir: Add ir3-specific version of most SSBO intrinsics
Eduardo Lima Mitev
elima at igalia.com
Wed Feb 13 21:29:54 UTC 2019
These are Freedreno specific versions of SSBO intrinsics that add an
extra source to hold the dword-offset, which is needed by the backend
apart from the byte-offset already provided by NIR in one of the
sources.
NIR lowering pass 'ir3_nir_lower_io_offset' will replace the original
SSBO intrinsics by these, placing the computed dword-offset always in
the last source.
'ssbo_atomic_[f]comp_swap' are not handled because those already use
the 4 sources.
---
src/compiler/nir/nir_intrinsics.py | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py
index f79a8cebc54..2eb88c290a6 100644
--- a/src/compiler/nir/nir_intrinsics.py
+++ b/src/compiler/nir/nir_intrinsics.py
@@ -659,3 +659,31 @@ store("global", 2, [WRMASK, ACCESS, ALIGN_MUL, ALIGN_OFFSET])
# Both seem semantically similar.
intrinsic("image_deref_load_param_ir3", src_comp=[1], dest_comp=0,
indices=[BASE], flags=[CAN_ELIMINATE, CAN_REORDER])
+
+# IR3-specific version of most SSBO intrinsics. The only different
+# compare to the originals is that they add an extra source to hold
+# the dword-offset, which is needed by the backend code apart from
+# the byte-offset already provided by NIR in one of the sources.
+#
+# NIR lowering pass 'ir3_nir_lower_io_offset' will replace the
+# original SSBO intrinsics by these, placing the computed
+# dword-offset always in the last source.
+#
+# 'ssbo_atomic_[f]comp_swap' are not handled because those already use
+# the 4 sources.
+intrinsic("store_ssbo_ir3", src_comp=[0, 1, 1, 1],
+ indices=[WRMASK, ACCESS, ALIGN_MUL, ALIGN_OFFSET])
+intrinsic("load_ssbo_ir3", src_comp=[1, 1, 1], dest_comp=0,
+ indices=[ACCESS, ALIGN_MUL, ALIGN_OFFSET], flags=[CAN_ELIMINATE])
+intrinsic("ssbo_atomic_add_ir3", src_comp=[1, 1, 1, 1], dest_comp=1)
+intrinsic("ssbo_atomic_imin_ir3", src_comp=[1, 1, 1, 1], dest_comp=1)
+intrinsic("ssbo_atomic_umin_ir3", src_comp=[1, 1, 1, 1], dest_comp=1)
+intrinsic("ssbo_atomic_imax_ir3", src_comp=[1, 1, 1, 1], dest_comp=1)
+intrinsic("ssbo_atomic_umax_ir3", src_comp=[1, 1, 1, 1], dest_comp=1)
+intrinsic("ssbo_atomic_and_ir3", src_comp=[1, 1, 1, 1], dest_comp=1)
+intrinsic("ssbo_atomic_or_ir3", src_comp=[1, 1, 1, 1], dest_comp=1)
+intrinsic("ssbo_atomic_xor_ir3", src_comp=[1, 1, 1, 1], dest_comp=1)
+intrinsic("ssbo_atomic_exchange_ir3", src_comp=[1, 1, 1, 1], dest_comp=1)
+intrinsic("ssbo_atomic_fadd_ir3", src_comp=[1, 1, 1, 1], dest_comp=1)
+intrinsic("ssbo_atomic_fmin_ir3", src_comp=[1, 1, 1, 1], dest_comp=1)
+intrinsic("ssbo_atomic_fmax_ir3", src_comp=[1, 1, 1, 1], dest_comp=1)
--
2.20.1
More information about the mesa-dev
mailing list