changeset d45a02bd5391 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=d45a02bd5391
description:
        x86 ISA: Implement the sse3 haddps instruction.

        Shuffle the 32 bit values into position, and then add in parallel.

diffstat:

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

diffs (59 lines):

diff -r 59d2bcf37782 -r d45a02bd5391 
src/arch/x86/isa/decoder/two_byte_opcodes.isa
--- a/src/arch/x86/isa/decoder/two_byte_opcodes.isa     Sat May 19 04:13:47 
2012 -0700
+++ b/src/arch/x86/isa/decoder/two_byte_opcodes.isa     Sat May 19 04:32:25 
2012 -0700
@@ -669,7 +669,7 @@
                     }
                     // repne (0xF2)
                     0x8: decode OPCODE_OP_BOTTOM3 {
-                        0x4: WarnUnimpl::haddps_Vo_Wo();
+                        0x4: HADDPS(Vo,Wo);
                         0x5: WarnUnimpl::hsubps_Vo_Wo();
                         default: UD2();
                     }
diff -r 59d2bcf37782 -r d45a02bd5391 
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
   Sat May 19 04:13:47 2012 -0700
+++ 
b/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/horizontal_addition.py
   Sat May 19 04:32:25 2012 -0700
@@ -36,7 +36,42 @@
 # Authors: Gabe Black
 
 microcode = '''
-# HADDPS
+def macroop HADDPS_XMM_XMM {
+    shuffle ufp1, xmml, xmmh, ext=((0 << 0) | (2 << 2)), size=4
+    shuffle ufp2, xmml, xmmh, ext=((1 << 0) | (3 << 2)), size=4
+    shuffle ufp3, xmmlm, xmmhm, ext=((0 << 0) | (2 << 2)), size=4
+    shuffle ufp4, xmmlm, xmmhm, ext=((1 << 0) | (3 << 2)), size=4
+
+    maddf xmml, ufp1, ufp2, size=4
+    maddf xmmh, ufp3, ufp4, size=4
+};
+
+def macroop HADDPS_XMM_M {
+    ldfp ufp1, seg, sib, disp, dataSize=8
+    ldfp ufp2, seg, sib, "DISPLACEMENT+8", dataSize=8
+
+    shuffle ufp3, xmml, xmmh, ext=((0 << 0) | (2 << 2)), size=4
+    shuffle ufp4, xmml, xmmh, ext=((1 << 0) | (3 << 2)), size=4
+    shuffle ufp5, ufp1, ufp2, ext=((0 << 0) | (2 << 2)), size=4
+    shuffle ufp6, ufp1, ufp2, ext=((1 << 0) | (3 << 2)), size=4
+
+    maddf xmml, ufp3, ufp4, size=4
+    maddf xmmh, ufp5, ufp6, size=4
+};
+
+def macroop HADDPS_XMM_P {
+    rdip t7
+    ldfp ufp1, seg, riprel, disp, dataSize=8
+    ldfp ufp2, seg, riprel, "DISPLACEMENT+8", dataSize=8
+
+    shuffle ufp3, xmml, xmmh, ext=((0 << 0) | (2 << 2)), size=4
+    shuffle ufp4, xmml, xmmh, ext=((1 << 0) | (3 << 2)), size=4
+    shuffle ufp5, ufp1, ufp2, ext=((0 << 0) | (2 << 2)), size=4
+    shuffle ufp6, ufp1, ufp2, ext=((1 << 0) | (3 << 2)), size=4
+
+    maddf xmml, ufp3, ufp4, size=4
+    maddf xmmh, ufp5, ufp6, size=4
+};
 
 def macroop HADDPD_XMM_XMM {
     maddf ufp1, xmmh , xmml, size=8, ext=Scalar
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to