aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/codegen/nv50_ir_target_nv50.cpp
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2012-05-04 18:00:40 +0200
committerChristoph Bumiller <[email protected]>2012-05-04 18:00:40 +0200
commitdffc2fb4e659f41b30e80e23ceb833d53417fb8e (patch)
tree4c7efd20c8646fec578b5cc6600895b317e44125 /src/gallium/drivers/nv50/codegen/nv50_ir_target_nv50.cpp
parent02fac2930581b9bea9f6d221eb6d6b471fc3b9c6 (diff)
nv50/ir: move expansion of IMUL to later stage and handle memory operands
Diffstat (limited to 'src/gallium/drivers/nv50/codegen/nv50_ir_target_nv50.cpp')
-rw-r--r--src/gallium/drivers/nv50/codegen/nv50_ir_target_nv50.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_target_nv50.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_target_nv50.cpp
index 5e541e514cb..8b11c6a2fdd 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_target_nv50.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_target_nv50.cpp
@@ -310,7 +310,22 @@ TargetNV50::insnCanLoad(const Instruction *i, int s,
return false;
}
- if (ld->getSrc(0)->reg.data.offset > (int32_t)(127 * typeSizeof(ld->dType)))
+ uint8_t ldSize;
+
+ if ((i->op == OP_MUL || i->op == OP_MAD) && !isFloatType(i->dType)) {
+ // 32-bit MUL will be split into 16-bit MULs
+ if (ld->src(0).isIndirect(0))
+ return false;
+ if (sf == FILE_IMMEDIATE)
+ return false;
+ ldSize = 2;
+ } else {
+ ldSize = typeSizeof(ld->dType);
+ }
+
+ if (ldSize < 4 && sf == FILE_SHADER_INPUT) // no < 4-byte aligned a[] access
+ return false;
+ if (ld->getSrc(0)->reg.data.offset > (int32_t)(127 * ldSize))
return false;
if (ld->src(0).isIndirect(0)) {