changeset 4fff54ab52ae in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=4fff54ab52ae
description:
        X86: Implement shrd.

diffstat:

2 files changed, 36 insertions(+), 1 deletion(-)
src/arch/x86/isa/decoder/two_byte_opcodes.isa                    |    2 
src/arch/x86/isa/insts/general_purpose/rotate_and_shift/shift.py |   35 
++++++++++

diffs (57 lines):

diff -r 536125d85fa3 -r 4fff54ab52ae 
src/arch/x86/isa/decoder/two_byte_opcodes.isa
--- a/src/arch/x86/isa/decoder/two_byte_opcodes.isa     Fri Feb 27 09:26:17 
2009 -0800
+++ b/src/arch/x86/isa/decoder/two_byte_opcodes.isa     Fri Feb 27 09:26:26 
2009 -0800
@@ -830,7 +830,7 @@
                 0x1: pop_gs();
                 0x2: rsm_smm();
                 0x3: Inst::BTS(Ev,Gv);
-                0x4: shrd_Ev_Gv_Ib();
+                0x4: Inst::SHRD(Ev,Gv,Ib);
                 0x5: shrd_Ev_Gv_rCl();
                 //0x6: group16();
                 0x6: decode MODRM_REG {
diff -r 536125d85fa3 -r 4fff54ab52ae 
src/arch/x86/isa/insts/general_purpose/rotate_and_shift/shift.py
--- a/src/arch/x86/isa/insts/general_purpose/rotate_and_shift/shift.py  Fri Feb 
27 09:26:17 2009 -0800
+++ b/src/arch/x86/isa/insts/general_purpose/rotate_and_shift/shift.py  Fri Feb 
27 09:26:26 2009 -0800
@@ -174,6 +174,41 @@
     st t1, seg, riprel, disp
 };
 
+# SHRD will not set OF correctly when the shift count is 1.
+def macroop SHRD_R_R_I
+{
+    srli t1, reg, imm, flags=(CF,)
+    rori t2, regm, imm
+    srli t3, regm, imm
+    xor t2, t2, t3
+    or reg, t1, t2
+};
+
+# SHRD will not set OF correctly when the shift count is 1.
+def macroop SHRD_M_R_I
+{
+    ldst t1, seg, sib, disp
+    srli t1, t1, imm, flags=(CF,)
+    rori t2, reg, imm
+    srli t3, reg, imm
+    xor t2, t2, t3
+    or t1, t1, t2
+    st t1, seg, sib, disp
+};
+
+# SHRD will not set OF correctly when the shift count is 1.
+def macroop SHRD_P_R_I
+{
+    rdip t7
+    ldst t1, seg, riprel, disp
+    srli t1, t1, imm, flags=(CF,)
+    rori t2, reg, imm
+    srli t3, reg, imm
+    xor t2, t2, t3
+    or t1, t1, t2
+    st t1, seg, riprel, disp
+};
+
 def macroop SAR_R_I
 {
     srai reg, reg, imm, flags=(CF,OF,SF,ZF,PF)
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to