From d995f44f0bba2ec5edcede66c31f63753f178a75 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Thu, 28 Feb 2013 23:41:41 +0100 Subject: [PATCH] nv50/ir/ra: swap copyCompound args if src is compound and dst isn't --- src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp index dbf43d4..b6209bd 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp @@ -857,11 +857,20 @@ static inline uint8_t makeCompMask(int compSize, int base, int size) } } +// Used when coalescing moves. The non-compound value will become one, e.g.: +// mov b32 $r0 $r2 / merge b64 $r0d { $r0 $r1 } +// split b64 { $r0 $r1 } $r0d / mov b64 $r0d f64 $r2d static inline void copyCompound(Value *dst, Value *src) { LValue *ldst = dst->asLValue(); LValue *lsrc = src->asLValue(); + if (ldst->compound && !lsrc->compound) { + LValue *swap = lsrc; + lsrc = ldst; + ldst = swap; + } + ldst->compound = lsrc->compound; ldst->compMask = lsrc->compMask; } -- 2.7.4