diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2016-03-07 18:56:21 +0100 |
---|---|---|
committer | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2016-04-01 22:26:24 +0200 |
commit | 839a469166b9c0b9959620eda85a6481f9efa15f (patch) | |
tree | 1099deba63ed0041734347a00ef770683bd29f79 /src/gallium/drivers/nouveau | |
parent | 543fb95473e404b7212eea3f00a23dd0d23758d5 (diff) | |
download | external_mesa3d-839a469166b9c0b9959620eda85a6481f9efa15f.zip external_mesa3d-839a469166b9c0b9959620eda85a6481f9efa15f.tar.gz external_mesa3d-839a469166b9c0b9959620eda85a6481f9efa15f.tar.bz2 |
nvc0/ir: do not lower shared+atomics on GM107+
For Maxwell, the ATOMS instruction can be used to perform atomic
operations on shared memory instead of this load/store lowering pass.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 17 |
1 files changed, 10 insertions, 7 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 fb2aec6..ce83618 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp @@ -1288,11 +1288,12 @@ NVC0LoweringPass::handleATOM(Instruction *atom) sv = SV_LBASE; break; case FILE_MEMORY_SHARED: - if (targ->getChipset() >= NVISA_GK104_CHIPSET) { - handleSharedATOMNVE4(atom); - } else { + // For Fermi/Kepler, we have to use ld lock/st unlock to perform atomic + // operations on shared memory. For Maxwell, ATOMS is enough. + if (targ->getChipset() < NVISA_GK104_CHIPSET) handleSharedATOM(atom); - } + else if (targ->getChipset() < NVISA_GM107_CHIPSET) + handleSharedATOMNVE4(atom); return true; default: assert(atom->src(0).getFile() == FILE_MEMORY_GLOBAL); @@ -1320,9 +1321,11 @@ NVC0LoweringPass::handleATOM(Instruction *atom) bool NVC0LoweringPass::handleCasExch(Instruction *cas, bool needCctl) { - if (cas->src(0).getFile() == FILE_MEMORY_SHARED) { - // ATOM_CAS and ATOM_EXCH are handled in handleSharedATOM(). - return false; + if (targ->getChipset() < NVISA_GM107_CHIPSET) { + if (cas->src(0).getFile() == FILE_MEMORY_SHARED) { + // ATOM_CAS and ATOM_EXCH are handled in handleSharedATOM(). + return false; + } } if (cas->subOp != NV50_IR_SUBOP_ATOM_CAS && |