aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2015-11-06 19:13:35 -0500
committerIlia Mirkin <[email protected]>2015-11-06 19:39:32 -0500
commit2f9aaed7499499679d44e47b7a070df237f77683 (patch)
tree9ecab157ec6f6ec593bd8d8096facb2163603dbf /src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp
parent76957389fc6952e59c1f0f1cbdf74f6949a7a956 (diff)
nv50/ir: add support for const-folding OP_CVT with F64 source/dest
Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp
index ece6ce40643..dca799dd9b5 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp
@@ -392,6 +392,12 @@ BuildUtil::mkImm(float f)
return mkImm(u.u32);
}
+ImmediateValue *
+BuildUtil::mkImm(double d)
+{
+ return new_ImmediateValue(prog, d);
+}
+
Value *
BuildUtil::loadImm(Value *dst, float f)
{
@@ -399,6 +405,12 @@ BuildUtil::loadImm(Value *dst, float f)
}
Value *
+BuildUtil::loadImm(Value *dst, double d)
+{
+ return mkOp1v(OP_MOV, TYPE_F64, dst ? dst : getScratch(), mkImm(d));
+}
+
+Value *
BuildUtil::loadImm(Value *dst, uint32_t u)
{
return mkOp1v(OP_MOV, TYPE_U32, dst ? dst : getScratch(), mkImm(u));