diff options
author | Eric Anholt <[email protected]> | 2019-04-11 09:49:13 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2019-04-12 15:56:12 -0700 |
commit | b88ef3bd76a1fad3c2a99ea19df62f7be8c57961 (patch) | |
tree | dee4af913a4b9fe2ad6522c6243102f49c8eae94 /src/compiler/nir/nir_intrinsics.py | |
parent | 35355b4860b87884373838f5db03001f9e988e0c (diff) |
nir: Add a comment about how intrinsic definitions work.
I was thinking about a refactor, and needed to read this first.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_intrinsics.py')
-rw-r--r-- | src/compiler/nir/nir_intrinsics.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index 1b4fcf9f98b..9b3f480f7af 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -128,6 +128,17 @@ CAN_REORDER = "NIR_INTRINSIC_CAN_REORDER" INTR_OPCODES = {} +# Defines a new NIR intrinsic. By default, the intrinsic will have no sources +# and no destination. +# +# You can set dest_comp=n to enable a destination for the intrinsic, in which +# case it will have that many components, or =0 for "as many components as the +# NIR destination value." +# +# Set src_comp=n to enable sources for the intruction. It can be an array of +# component counts, or (for convenience) a scalar component count if there's +# only one source. If a component count is 0, it will be as many components as +# the intrinsic has based on the dest_comp. def intrinsic(name, src_comp=[], dest_comp=-1, indices=[], flags=[], sysval=False, bit_sizes=[]): assert name not in INTR_OPCODES |