summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-07-18 16:33:56 -0700
committerGabe Black <gblack@eecs.umich.edu>2007-07-18 16:33:56 -0700
commit6c54b654a880ffa83a16a043d90612bd49815de6 (patch)
tree9259c09c5e7480eca19b8fc60978b16542a05ac9 /src/arch/x86
parentbafb7ee5c1ba31c9a52de835a24d9df65b818ab6 (diff)
downloadgem5-6c54b654a880ffa83a16a043d90612bd49815de6.tar.xz
Implement some forms of add.
--HG-- extra : convert_revision : adbff2e9b9952ec09853cc43d40243e7262410a7
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/isa/decoder/one_byte_opcodes.isa2
-rw-r--r--src/arch/x86/isa/insts/arithmetic/add_and_subtract.py23
2 files changed, 24 insertions, 1 deletions
diff --git a/src/arch/x86/isa/decoder/one_byte_opcodes.isa b/src/arch/x86/isa/decoder/one_byte_opcodes.isa
index 6c54f77bc..82e50e745 100644
--- a/src/arch/x86/isa/decoder/one_byte_opcodes.isa
+++ b/src/arch/x86/isa/decoder/one_byte_opcodes.isa
@@ -297,7 +297,7 @@
}
//0x3: group1_Ev_Ib();
0x3: decode MODRM_REG {
- 0x0: add_Ev_Ib();
+ 0x0: Inst::ADD(Ev,Ib);
0x1: or_Ev_Ib();
0x2: adc_Ev_Ib();
0x3: sbb_Ev_Ib();
diff --git a/src/arch/x86/isa/insts/arithmetic/add_and_subtract.py b/src/arch/x86/isa/insts/arithmetic/add_and_subtract.py
index fbfe4be7e..4d6e40c74 100644
--- a/src/arch/x86/isa/insts/arithmetic/add_and_subtract.py
+++ b/src/arch/x86/isa/insts/arithmetic/add_and_subtract.py
@@ -54,6 +54,29 @@
# Authors: Gabe Black
microcode = '''
+def macroop ADD_R_I
+{
+ limm t1, imm
+ add reg, reg, t1
+};
+
+def macroop ADD_M_I
+{
+ limm t2, imm
+ ld t1, ds, [scale, index, base], disp
+ add t1, t1, t2
+ st t1, ds, [scale, index, base], disp
+};
+
+def macroop ADD_P_I
+{
+ rdip t7
+ limm t2, imm
+ ld t1, ds, [scale, index, base], disp
+ add t1, t1, t2
+ st t1, ds, [scale, index, base], disp
+};
+
def macroop SUB_R_I
{
limm t1, imm