diff options
author | Iago Toral Quiroga <[email protected]> | 2018-12-14 09:28:56 +0100 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2019-01-02 07:54:05 +0100 |
commit | aeee68378083ed02b8e2e0e538ee50eb2fcc9d38 (patch) | |
tree | 3c969081d9b0a2039d8c6693312b2842e86f76a4 /src/compiler | |
parent | 5fc9ad1cb0f205b3fcf988338bc28a86e2b572b6 (diff) |
compiler/nir: add nir_fadd_imm() and nir_fmul_imm() helpers
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_builder.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index 74ecde798d5..14f3baab20b 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -572,6 +572,18 @@ nir_imul_imm(nir_builder *build, nir_ssa_def *x, uint64_t y) } static inline nir_ssa_def * +nir_fadd_imm(nir_builder *build, nir_ssa_def *x, double y) +{ + return nir_fadd(build, x, nir_imm_floatN_t(build, y, x->bit_size)); +} + +static inline nir_ssa_def * +nir_fmul_imm(nir_builder *build, nir_ssa_def *x, double y) +{ + return nir_fmul(build, x, nir_imm_floatN_t(build, y, x->bit_size)); +} + +static inline nir_ssa_def * nir_pack_bits(nir_builder *b, nir_ssa_def *src, unsigned dest_bit_size) { assert(src->num_components * src->bit_size == dest_bit_size); |