changeset 3c810b64ee7d in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=3c810b64ee7d
description:
        X86: Implement the X86 sse2 haddpd instruction

        This patch implements the haddpd instruction.

        It fixes the problem in the previous version (pointed out by Gabe Black)
        where an incorrect result would happen if you issue the instruction
        with the same argument twice, i.e. "haddpd %xmm0,%xmm0"

        This instruction is used by many spec2k benchmarks.

diffstat:

2 files changed, 22 insertions(+), 2 deletions(-)
src/arch/x86/isa/decoder/two_byte_opcodes.isa                                   
|    2 
src/arch/x86/isa/insts/simd128/floating_point/arithmetic/horizontal_addition.py 
|   22 +++++++++-

diffs (42 lines):

diff -r bd221a106f08 -r 3c810b64ee7d 
src/arch/x86/isa/decoder/two_byte_opcodes.isa
--- a/src/arch/x86/isa/decoder/two_byte_opcodes.isa     Fri Oct 30 12:51:13 
2009 -0400
+++ b/src/arch/x86/isa/decoder/two_byte_opcodes.isa     Fri Oct 30 14:19:06 
2009 -0400
@@ -707,7 +707,7 @@
                     }
                     // operand size (0x66)
                     0x1: decode OPCODE_OP_BOTTOM3 {
-                        0x4: WarnUnimpl::haddpd_Vo_Wo();
+                        0x4: HADDPD(Vo,Wo);
                         0x5: WarnUnimpl::hsubpd_Vo_Wo();
                         0x6: WarnUnimpl::movd_Ed_Vd();
                         0x7: MOVDQA(Wo,Vo);
diff -r bd221a106f08 -r 3c810b64ee7d 
src/arch/x86/isa/insts/simd128/floating_point/arithmetic/horizontal_addition.py
--- 
a/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/horizontal_addition.py
   Fri Oct 30 12:51:13 2009 -0400
+++ 
b/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/horizontal_addition.py
   Fri Oct 30 14:19:06 2009 -0400
@@ -55,5 +55,25 @@
 
 microcode = '''
 # HADDPS
-# HADDPD
+
+def macroop HADDPD_XMM_XMM {
+    maddf ufp1, xmmh , xmml, size=8, ext=1
+    maddf xmmh, xmmlm, xmmhm, size=8, ext=1
+    movfp xmml, ufp1
+};
+
+def macroop HADDPD_XMM_M {
+    ldfp ufp1, seg, sib, disp, dataSize=8
+    ldfp ufp2, seg, sib, "DISPLACEMENT+8", dataSize=8
+    maddf xmml, xmmh, xmml, size=8, ext=1
+    maddf xmmh, ufp1, ufp2, size=8, ext=1
+};
+
+def macroop HADDPD_XMM_P {
+    rdip t7
+    ldfp ufp1, seg, riprel, disp, dataSize=8
+    ldfp ufp2, seg, riprel, "DISPLACEMENT+8", dataSize=8
+    maddf xmml, xmmh, xmml, size=8, ext=1
+    maddf xmmh, ufp1, ufp2, size=8, ext=1
+};
 '''
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to