summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorKarol Herbst <kherbst@redhat.com>2020-03-07 16:55:19 +0100
committerMarge Bot <eric+marge@anholt.net>2020-09-01 18:47:30 +0000
commitd7b65cf7d3d51124be590a1b66fb89f94f723fe3 (patch)
treeeb93f6f7aea6aebc0475c142664f00439443a8da /src/gallium
parentd421af3a99374da72c1e661c15d9a46177b745d0 (diff)
nv50/ir: fix cas lowering for 64 bit
Signed-off-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6433>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
index 52106cb931f..0e69f25ca28 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
@@ -1734,9 +1734,10 @@ NVC0LoweringPass::handleCasExch(Instruction *cas, bool needCctl)
// happen elsewhere in the universe.
// Also, it sometimes returns the new value instead of the old one
// under mysterious circumstances.
- Value *dreg = bld.getSSA(8);
+ DataType ty = typeOfSize(typeSizeof(cas->dType) * 2);
+ Value *dreg = bld.getSSA(typeSizeof(ty));
bld.setPosition(cas, false);
- bld.mkOp2(OP_MERGE, TYPE_U64, dreg, cas->getSrc(1), cas->getSrc(2));
+ bld.mkOp2(OP_MERGE, ty, dreg, cas->getSrc(1), cas->getSrc(2));
cas->setSrc(1, dreg);
cas->setSrc(2, dreg);
}