From 4d5c57edca71ae93ded74099d067d293c1fe265b Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Tue, 14 Jul 2020 22:38:05 +0200 Subject: [PATCH] gv100/ir: fix quadop/pop lowering Fixes: texture_cube_map_array.sampling Signed-off-by: Karol Herbst Reviewed-by: Ilia Mirkin Part-of: --- src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.h | 7 +++++++ .../drivers/nouveau/codegen/nv50_ir_lowering_gv100.cpp | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.h b/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.h index 6fe77211a89..5c3a01df95f 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.h @@ -66,6 +66,7 @@ public: Instruction *mkMov(Value *, Value *, DataType = TYPE_U32); Instruction *mkMovToReg(int id, Value *); Instruction *mkMovFromReg(Value *, int id); + inline Instruction *mkBMov(Value *, Value *); Instruction *mkInterp(unsigned mode, Value *, int32_t offset, Value *rel); Instruction *mkFetch(Value *, DataType, DataFile, int32_t offset, @@ -305,6 +306,12 @@ BuildUtil::mkLoadv(DataType ty, Symbol *mem, Value *ptr) return dst; } +inline Instruction * +BuildUtil::mkBMov(Value *dst, Value *src) +{ + return mkCvt(OP_CVT, TYPE_U32, dst, TYPE_U32, src); +} + bool BuildUtil::DataArray::exists(ValueMap &m, unsigned int i, unsigned int c) { diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gv100.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gv100.cpp index 480b574e393..29346765a46 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gv100.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gv100.cpp @@ -158,13 +158,17 @@ GV100LegalizeSSA::handlePREEX2(Instruction *i) bool GV100LegalizeSSA::handleQUADON(Instruction *i) { - handleSHFL(i); // Inserts OP_WARPSYNC + bld.mkBMov(i->getDef(0), bld.mkTSVal(TS_MACTIVE)); + Instruction *b = bld.mkBMov(bld.mkTSVal(TS_PQUAD_MACTIVE), i->getDef(0)); + b->fixed = 1; return true; } bool GV100LegalizeSSA::handleQUADPOP(Instruction *i) { + Instruction *b = bld.mkBMov(bld.mkTSVal(TS_MACTIVE), i->getSrc(0)); + b->fixed = 1; return true; }