From 286abcb51ec2c27970e901ed815a814b3f0bebf6 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Fri, 6 Apr 2012 18:34:44 +0200 Subject: nv50/ir: add isAccessSupported check for memory access coalescing --- src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp | 2 +- src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp | 10 ++++++++++ src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers/nvc0/codegen') diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp index da2c885eb87..7468733f699 100644 --- a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp +++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp @@ -1190,7 +1190,7 @@ CodeEmitterNVC0::emitEXPORT(const Instruction *i) code[0] = 0x00000006 | ((size / 4 - 1) << 5); code[1] = 0x0a000000 | i->src[0].get()->reg.data.offset; - assert(size != 12 && !(code[1] & (size - 1))); + assert(!(code[1] & ((size == 12) ? 15 : (size - 1)))); if (i->perPatch) code[0] |= 0x100; diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp index 8e9386494e6..bcc2c43a55f 100644 --- a/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp +++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.cpp @@ -440,6 +440,16 @@ TargetNVC0::insnCanLoad(const Instruction *i, int s, return true; } +bool +TargetNVC0::isAccessSupported(DataFile file, DataType ty) const +{ + if (ty == TYPE_NONE) + return false; + if (ty == TYPE_B96) + return (file == FILE_SHADER_INPUT) || (file == FILE_SHADER_OUTPUT); + return true; +} + bool TargetNVC0::isOpSupported(operation op, DataType ty) const { diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.h b/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.h index 2522d1ea288..1a49f369920 100644 --- a/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.h +++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_target_nvc0.h @@ -45,6 +45,7 @@ public: virtual bool insnCanLoad(const Instruction *insn, int s, const Instruction *ld) const; virtual bool isOpSupported(operation, DataType) const; + virtual bool isAccessSupported(DataFile, DataType) const; virtual bool isModSupported(const Instruction *, int s, Modifier) const; virtual bool isSatSupported(const Instruction *) const; virtual bool mayPredicate(const Instruction *, const Value *) const; -- cgit v1.2.3