From 85f9415a67f3f3b54a615c2e29576235d11428f3 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 23 Jul 2007 01:07:49 +0000 Subject: Make the operand size reflect the size specifier on the operand tags, and implement NEG --HG-- extra : convert_revision : da73ed6820d57f083c18f44b2fa868fc0976dd16 --- .../x86/isa/insts/arithmetic/add_and_subtract.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/arch/x86/isa/insts/arithmetic/add_and_subtract.py') 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 05aa6cd69..e637251d2 100644 --- a/src/arch/x86/isa/insts/arithmetic/add_and_subtract.py +++ b/src/arch/x86/isa/insts/arithmetic/add_and_subtract.py @@ -277,6 +277,26 @@ def macroop SBB_P_R sbb t1, t1, reg st t1, ds, [scale, index, base], disp }; + +def macroop NEG_R +{ + sub reg, t0, reg, flags=(CF,OF,SF,ZF,AF,PF) +}; + +def macroop NEG_M +{ + ld t1, ds, [scale, index, base], disp + sub t1, t0, t1, flags=(CF,OF,SF,ZF,AF,PF) + st t1, ds, [scale, index, base], disp +}; + +def macroop NEG_P +{ + rdip t7 + ld t1, ds, [0, t0, t7], disp + sub t1, t0, t1, flags=(CF,OF,SF,ZF,AF,PF) + st t1, ds, [0, t0, t7], disp +}; ''' #let {{ # class ADC(Inst): -- cgit v1.2.3 From 7e5239343293b85128f6786d436016e805728b3c Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 24 Jul 2007 15:03:43 -0700 Subject: Get rid of an old comment --HG-- extra : convert_revision : 4d626721ad54af9cbf5b0c07a3a6e8a05e4e9ab5 --- src/arch/x86/isa/insts/arithmetic/add_and_subtract.py | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/arch/x86/isa/insts/arithmetic/add_and_subtract.py') 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 e637251d2..e104eaeed 100644 --- a/src/arch/x86/isa/insts/arithmetic/add_and_subtract.py +++ b/src/arch/x86/isa/insts/arithmetic/add_and_subtract.py @@ -298,15 +298,3 @@ def macroop NEG_P st t1, ds, [0, t0, t7], disp }; ''' -#let {{ -# class ADC(Inst): -# "Adc ^0 ^0 ^1" -# class ADD(Inst): -# "Add ^0 ^0 ^1" -# class SBB(Inst): -# "Sbb ^0 ^0 ^1" -# class SUB(Inst): -# "Sub ^0 ^0 ^1" -# class NEG(Inst): -# "Sub ^0 $0 ^0" -#}}; -- cgit v1.2.3 From edaaf1ebf1461b20c0bfa06472d5188a975e47c7 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 26 Jul 2007 22:10:21 -0700 Subject: X86: Fix pc relative versions of add and subtract. --HG-- extra : convert_revision : c7e578aae8d36aa5d279fc27d6d7d28ed0a54181 --- .../x86/isa/insts/arithmetic/add_and_subtract.py | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'src/arch/x86/isa/insts/arithmetic/add_and_subtract.py') 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 e104eaeed..7e5578a3c 100644 --- a/src/arch/x86/isa/insts/arithmetic/add_and_subtract.py +++ b/src/arch/x86/isa/insts/arithmetic/add_and_subtract.py @@ -77,9 +77,9 @@ def macroop ADD_P_I { rdip t7 limm t2, imm - ld t1, ds, [scale, index, base], disp + ld t1, ds, [0, t0, t7], disp add t1, t1, t2 - st t1, ds, [scale, index, base], disp + st t1, ds, [0, t0, t7], disp }; def macroop ADD_M_R @@ -92,9 +92,9 @@ def macroop ADD_M_R def macroop ADD_P_R { rdip t7 - ld t1, ds, [scale, index, base], disp + ld t1, ds, [0, t0, t7], disp add t1, t1, reg - st t1, ds, [scale, index, base], disp + st t1, ds, [0, t0, t7], disp }; def macroop ADD_R_M @@ -106,7 +106,7 @@ def macroop ADD_R_M def macroop ADD_R_P { rdip t7 - ld t1, ds, [scale, index, base], disp + ld t1, ds, [0, t0, t7], disp add reg, reg, t1 }; @@ -130,7 +130,7 @@ def macroop SUB_R_M def macroop SUB_R_P { rdip t7 - ld t1, ds, [scale, index, base], disp + ld t1, ds, [0, t0, t7], disp sub reg, reg, t1 }; @@ -146,9 +146,9 @@ def macroop SUB_P_I { rdip t7 limm t2, imm - ld t1, ds, [scale, index, base], disp + ld t1, ds, [0, t0, t7], disp sub t1, t1, t2 - st t1, ds, [scale, index, base], disp + st t1, ds, [0, t0, t7], disp }; def macroop SUB_M_R @@ -161,9 +161,9 @@ def macroop SUB_M_R def macroop SUB_P_R { rdip t7 - ld t1, ds, [scale, index, base], disp + ld t1, ds, [0, t0, t7], disp sub t1, t1, reg - st t1, ds, [scale, index, base], disp + st t1, ds, [0, t0, t7], disp }; def macroop ADC_R_R @@ -189,9 +189,9 @@ def macroop ADC_P_I { rdip t7 limm t2, imm - ld t1, ds, [scale, index, base], disp + ld t1, ds, [0, t0, t7], disp adc t1, t1, t2 - st t1, ds, [scale, index, base], disp + st t1, ds, [0, t0, t7], disp }; def macroop ADC_M_R @@ -204,9 +204,9 @@ def macroop ADC_M_R def macroop ADC_P_R { rdip t7 - ld t1, ds, [scale, index, base], disp + ld t1, ds, [0, t0, t7], disp adc t1, t1, reg - st t1, ds, [scale, index, base], disp + st t1, ds, [0, t0, t7], disp }; def macroop ADC_R_M @@ -218,7 +218,7 @@ def macroop ADC_R_M def macroop ADC_R_P { rdip t7 - ld t1, ds, [scale, index, base], disp + ld t1, ds, [0, t0, t7], disp adc reg, reg, t1 }; @@ -242,7 +242,7 @@ def macroop SBB_R_M def macroop SBB_R_P { rdip t7 - ld t1, ds, [scale, index, base], disp + ld t1, ds, [0, t0, t7], disp sbb reg, reg, t1 }; @@ -258,9 +258,9 @@ def macroop SBB_P_I { rdip t7 limm t2, imm - ld t1, ds, [scale, index, base], disp + ld t1, ds, [0, t0, t7], disp sbb t1, t1, t2 - st t1, ds, [scale, index, base], disp + st t1, ds, [0, t0, t7], disp }; def macroop SBB_M_R @@ -273,9 +273,9 @@ def macroop SBB_M_R def macroop SBB_P_R { rdip t7 - ld t1, ds, [scale, index, base], disp + ld t1, ds, [0, t0, t7], disp sbb t1, t1, reg - st t1, ds, [scale, index, base], disp + st t1, ds, [0, t0, t7], disp }; def macroop NEG_R -- cgit v1.2.3