diff options
| author | Tim Rogers <[email protected]> | 2013-02-21 23:56:39 -0800 |
|---|---|---|
| committer | Andrew Boktor <[email protected]> | 2014-08-14 13:50:05 -0700 |
| commit | 355b9bcbc870fb79a5d682748f2475432c5cb6a5 (patch) | |
| tree | b2b4e671874102de77a8d3ab44555aab90413df3 /src/cuda-sim/cuda-sim.cc | |
| parent | b346aa92a4d8a432eb5b6f5aa5d4cc22aef41833 (diff) | |
Fixing a bug exposed by the fix for bug 42.
The "_" "null" register potentially generated by ptx and intentionally generated by ptxplus was being initialized without a
type. This caused the parser to think it was not a register.
Fix is to allow the parser to think of it as register, but ensure the arch-sim does not by adding a flag indicating
that it is special.
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 15305]
Diffstat (limited to 'src/cuda-sim/cuda-sim.cc')
| -rw-r--r-- | src/cuda-sim/cuda-sim.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc index 1dbff50..cba5262 100644 --- a/src/cuda-sim/cuda-sim.cc +++ b/src/cuda-sim/cuda-sim.cc @@ -844,7 +844,8 @@ void ptx_instruction::pre_decode() for ( ; opr != op_iter_end(); opr++, n++ ) { //process operands const operand_info &o = *opr; if ( has_dst && n==0 ) { - if ( o.is_reg() ) { + // Do not set the null register "_" as an architectural register + if ( o.is_reg() && !o.is_non_arch_reg() ) { out[0] = o.reg_num(); arch_reg.dst[0] = o.arch_reg_num(); } else if ( o.is_vector() ) { @@ -858,7 +859,7 @@ void ptx_instruction::pre_decode() arch_reg.dst[i] = o.arch_reg_num(i); } } else { - if ( o.is_reg() ) { + if ( o.is_reg() && !o.is_non_arch_reg() ) { int reg_num = o.reg_num(); arch_reg.src[m] = o.arch_reg_num(); switch ( m ) { @@ -898,6 +899,8 @@ void ptx_instruction::pre_decode() const operand_info &o = *op; if(o.is_memory_operand()) { + // We do not support the null register as a memory operand + assert( !o.is_non_arch_reg() ); // Check PTXPlus-type operand // memory operand with addressing (ex. s[0x4] or g[$r1]) |
