mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 17:30:20 +01:00
nv50/ir: add support for 16-bit immediates
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Pierre Moreau <dev@pmoreau.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9299>
This commit is contained in:
parent
8a69efa171
commit
fe93723aaa
2 changed files with 20 additions and 0 deletions
|
|
@ -353,6 +353,18 @@ BuildUtil::mkClobber(DataFile f, uint32_t rMask, int unit)
|
|||
}
|
||||
}
|
||||
|
||||
ImmediateValue *
|
||||
BuildUtil::mkImm(uint16_t u)
|
||||
{
|
||||
ImmediateValue *imm = new_ImmediateValue(prog, (uint32_t)0);
|
||||
|
||||
imm->reg.size = 2;
|
||||
imm->reg.type = TYPE_U16;
|
||||
imm->reg.data.u32 = u;
|
||||
|
||||
return imm;
|
||||
}
|
||||
|
||||
ImmediateValue *
|
||||
BuildUtil::mkImm(uint32_t u)
|
||||
{
|
||||
|
|
@ -410,6 +422,12 @@ BuildUtil::loadImm(Value *dst, double d)
|
|||
return mkOp1v(OP_MOV, TYPE_F64, dst ? dst : getScratch(8), mkImm(d));
|
||||
}
|
||||
|
||||
Value *
|
||||
BuildUtil::loadImm(Value *dst, uint16_t u)
|
||||
{
|
||||
return mkOp1v(OP_MOV, TYPE_U16, dst ? dst : getScratch(2), mkImm(u));
|
||||
}
|
||||
|
||||
Value *
|
||||
BuildUtil::loadImm(Value *dst, uint32_t u)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ public:
|
|||
|
||||
ImmediateValue *mkImm(float);
|
||||
ImmediateValue *mkImm(double);
|
||||
ImmediateValue *mkImm(uint16_t);
|
||||
ImmediateValue *mkImm(uint32_t);
|
||||
ImmediateValue *mkImm(uint64_t);
|
||||
|
||||
|
|
@ -98,6 +99,7 @@ public:
|
|||
|
||||
Value *loadImm(Value *dst, float);
|
||||
Value *loadImm(Value *dst, double);
|
||||
Value *loadImm(Value *dst, uint16_t);
|
||||
Value *loadImm(Value *dst, uint32_t);
|
||||
Value *loadImm(Value *dst, uint64_t);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue