mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
nvc0/ir: Add support for double immediates
Add support for encoding double immediates (up to 20 bits of precision) into the generated nvc0 machine-code. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
parent
5169407221
commit
12c850d01c
1 changed files with 8 additions and 0 deletions
|
|
@ -323,6 +323,14 @@ CodeEmitterNVC0::setImmediate(const Instruction *i, const int s)
|
|||
assert(imm);
|
||||
u32 = imm->reg.data.u32;
|
||||
|
||||
if ((code[0] & 0xf) == 0x1) {
|
||||
// double immediate
|
||||
uint64_t u64 = imm->reg.data.u64;
|
||||
assert(!(u64 & 0x00000fffffffffffULL));
|
||||
assert(!(code[1] & 0xc000));
|
||||
code[0] |= ((u64 >> 44) & 0x3f) << 26;
|
||||
code[1] |= 0xc000 | (u64 >> 50);
|
||||
} else
|
||||
if ((code[0] & 0xf) == 0x2) {
|
||||
// LIMM
|
||||
code[0] |= (u32 & 0x3f) << 26;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue