summaryrefslogtreecommitdiff
path: root/src/arch/arm/isa/insts/data.isa
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:06 -0500
committerGabe Black <gblack@eecs.umich.edu>2010-06-02 12:58:06 -0500
commitfd6e9f304e8529bf2fda6a06fe6d7524c9293433 (patch)
tree815c8563dff7fffe3b1d28fd1c81bb41d41b8415 /src/arch/arm/isa/insts/data.isa
parentbcf0454864b32dfc196585963d1a554149420acc (diff)
downloadgem5-fd6e9f304e8529bf2fda6a06fe6d7524c9293433.tar.xz
ARM: Implement the ssub instructions.
Diffstat (limited to 'src/arch/arm/isa/insts/data.isa')
-rw-r--r--src/arch/arm/isa/insts/data.isa41
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));