mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 14:00:16 +01:00
compiler/nir: add nir_fadd_imm() and nir_fmul_imm() helpers
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
5fc9ad1cb0
commit
aeee683780
1 changed files with 12 additions and 0 deletions
|
|
@ -571,6 +571,18 @@ nir_imul_imm(nir_builder *build, nir_ssa_def *x, uint64_t y)
|
|||
return nir_imul(build, x, nir_imm_intN_t(build, y, x->bit_size));
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue