diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2010-06-02 12:58:06 -0500 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2010-06-02 12:58:06 -0500 |
commit | fd6e9f304e8529bf2fda6a06fe6d7524c9293433 (patch) | |
tree | 815c8563dff7fffe3b1d28fd1c81bb41d41b8415 /src/arch/arm/isa/insts | |
parent | bcf0454864b32dfc196585963d1a554149420acc (diff) | |
download | gem5-fd6e9f304e8529bf2fda6a06fe6d7524c9293433.tar.xz |
ARM: Implement the ssub instructions.
Diffstat (limited to 'src/arch/arm/isa/insts')
-rw-r--r-- | src/arch/arm/isa/insts/data.isa | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/src/arch/arm/isa/insts/data.isa b/src/arch/arm/isa/insts/data.isa index 1a42a4ca8..206c218e1 100644 --- a/src/arch/arm/isa/insts/data.isa +++ b/src/arch/arm/isa/insts/data.isa @@ -369,8 +369,8 @@ let {{ for (unsigned i = 0; i < 4; i++) { int high = (i + 1) * 8 - 1; int low = i * 8; - int32_t midRes = sext<8>(bits(Op1, high, low)) + - sext<8>(bits(Op2, high, low)); + int32_t midRes = sext<8>(bits(Op1.sw, high, low)) + + sext<8>(bits(Op2.sw, high, low)); replaceBits(resTemp, high, low, midRes); if (midRes >= 0) { geBits = geBits | (1 << i); @@ -385,8 +385,41 @@ let {{ for (unsigned i = 0; i < 2; i++) { int high = (i + 1) * 16 - 1; int low = i * 16; - int32_t midRes = sext<16>(bits(Op1, high, low)) + - sext<16>(bits(Op2, high, low)); + int32_t midRes = sext<16>(bits(Op1.sw, high, low)) + + sext<16>(bits(Op2.sw, high, low)); + replaceBits(resTemp, high, low, midRes); + if (midRes >= 0) { + geBits = geBits | (0x3 << (i * 2)); + } + } + Dest = resTemp; + resTemp = geBits; + ''', flagType="ge", buildNonCc=False) + + buildRegDataInst("ssub8", ''' + uint32_t geBits = 0; + resTemp = 0; + for (unsigned i = 0; i < 4; i++) { + int high = (i + 1) * 8 - 1; + int low = i * 8; + int32_t midRes = sext<8>(bits(Op1.sw, high, low)) - + sext<8>(bits(Op2.sw, high, low)); + replaceBits(resTemp, high, low, midRes); + if (midRes >= 0) { + geBits = geBits | (1 << i); + } + } + Dest = resTemp; + resTemp = geBits; + ''', flagType="ge", buildNonCc=False) + buildRegDataInst("ssub16", ''' + uint32_t geBits = 0; + resTemp = 0; + for (unsigned i = 0; i < 2; i++) { + int high = (i + 1) * 16 - 1; + int low = i * 16; + int32_t midRes = sext<16>(bits(Op1.sw, high, low)) - + sext<16>(bits(Op2.sw, high, low)); replaceBits(resTemp, high, low, midRes); if (midRes >= 0) { geBits = geBits | (0x3 << (i * 2)); |