diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2009-07-08 23:02:19 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2009-07-08 23:02:19 -0700 |
commit | 1d4f338b391ffea73d05758ecca771bd16625031 (patch) | |
tree | 8e1b01cdaf71de8d5ecb6c2c55e58ae44bc8e57f /src/arch/arm/isa/formats/util.isa | |
parent | 70a75ceb84c3c1964db548a254e2b6abdf8c084c (diff) | |
download | gem5-1d4f338b391ffea73d05758ecca771bd16625031.tar.xz |
ARM: Move the memory microops out of the decoder and into the ISA desc.
Diffstat (limited to 'src/arch/arm/isa/formats/util.isa')
-rw-r--r-- | src/arch/arm/isa/formats/util.isa | 64 |
1 files changed, 12 insertions, 52 deletions
diff --git a/src/arch/arm/isa/formats/util.isa b/src/arch/arm/isa/formats/util.isa index e9cb533d6..ea4ffa660 100644 --- a/src/arch/arm/isa/formats/util.isa +++ b/src/arch/arm/isa/formats/util.isa @@ -101,67 +101,27 @@ output decoder {{ return str; } - // Generate the bit pattern for an Ldr_uop or Str_uop; - StaticInstPtr - gen_ldrstr_uop(uint32_t baseinst, int loadop, uint32_t rd, int32_t disp) - { - StaticInstPtr newInst; - uint32_t newMachInst = baseinst & 0xffff0000; - newMachInst |= (rd << 12); - newMachInst |= disp; - if (loadop) - newInst = new Ldr_uop(newMachInst); - else - newInst = new Str_uop(newMachInst); - return newInst; - } - // Emits uops for a double fp move - int - emit_ldfstf_uops(StaticInstPtr* microOps, int index, uint32_t baseinst, int loadop, int up, int32_t disp) + void + emit_ldfstf_uops(StaticInstPtr* microOps, int index, ExtMachInst machInst, + bool loadop, bool up, int32_t disp) { - StaticInstPtr newInst; - uint32_t newMachInst; + MachInst newMachInst = machInst & 0xf000f000; if (loadop) { - newMachInst = baseinst & 0xfffff000; - newMachInst |= (disp & 0x0fff); - newInst = new Ldlo_uop(newMachInst); - microOps[index++] = newInst; - - newMachInst = baseinst & 0xfffff000; - if (up) - newMachInst |= ((disp + 4) & 0x0fff); - else - newMachInst |= ((disp - 4) & 0x0fff); - newInst = new Ldhi_uop(newMachInst); - microOps[index++] = newInst; - - newMachInst = baseinst & 0xf000f000; - newInst = new Mvtd_uop(newMachInst); - microOps[index++] = newInst; + microOps[index++] = new MicroLdrUop(machInst, 19, RN, disp); + microOps[index++] = + new MicroLdrUop(machInst, 18, RN, disp + (up ? 4 : -4)); + microOps[index++] = new Mvtd_uop(newMachInst); } else { - newMachInst = baseinst & 0xf000f000; - newInst = new Mvfd_uop(newMachInst); - microOps[index++] = newInst; - - newMachInst = baseinst & 0xfffff000; - newMachInst |= (disp & 0x0fff); - newInst = new Stlo_uop(newMachInst); - microOps[index++] = newInst; - - newMachInst = baseinst & 0xfffff000; - if (up) - newMachInst |= ((disp + 4) & 0x0fff); - else - newMachInst |= ((disp - 4) & 0x0fff); - newInst = new Sthi_uop(newMachInst); - microOps[index++] = newInst; + microOps[index++] = new Mvfd_uop(newMachInst); + microOps[index++] = new MicroStrUop(machInst, 19, RN, disp); + microOps[index++] = + new MicroStrUop(machInst, 18, RN, disp + (up ? 4 : -4)); } - return 3; } }}; |