summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/insts/simd128
diff options
context:
space:
mode:
authorVince Weaver <vince@csl.cornell.edu>2009-10-30 12:49:37 -0400
committerVince Weaver <vince@csl.cornell.edu>2009-10-30 12:49:37 -0400
commita12557439ba0297fefb558b34ecc761d2bc34017 (patch)
tree598ace115720808989fca84d89716f7e282142e8 /src/arch/x86/isa/insts/simd128
parent5873ec2238e521f34f7e70e6aa1b35a611225d80 (diff)
downloadgem5-a12557439ba0297fefb558b34ecc761d2bc34017.tar.xz
X86: Add support for x86 psrldq and pslldq instructions
These are complicated instructions and the micro-code might be suboptimal. This has been tested with some small sample programs (attached) The psrldq instruction is needed by various spec2k programs.
Diffstat (limited to 'src/arch/x86/isa/insts/simd128')
-rw-r--r--src/arch/x86/isa/insts/simd128/integer/shift/left_logical_shift.py40
-rw-r--r--src/arch/x86/isa/insts/simd128/integer/shift/right_logical_shift.py38
2 files changed, 76 insertions, 2 deletions
diff --git a/src/arch/x86/isa/insts/simd128/integer/shift/left_logical_shift.py b/src/arch/x86/isa/insts/simd128/integer/shift/left_logical_shift.py
index 617033bc0..c13c7064c 100644
--- a/src/arch/x86/isa/insts/simd128/integer/shift/left_logical_shift.py
+++ b/src/arch/x86/isa/insts/simd128/integer/shift/left_logical_shift.py
@@ -122,5 +122,43 @@ def macroop PSLLQ_XMM_I {
mslli xmml, xmml, imm, size=8, ext=0
mslli xmmh, xmmh, imm, size=8, ext=0
};
+
+def macroop PSLLDQ_XMM_I {
+
+ limm t2, 8
+ subi t1, t2, imm, flags=(ECF,), dataSize=1
+ br label("pslldq_less_8"), flags=(nCECF,)
+
+ # Greater than 8
+
+ limm t2, 16
+ subi t1, t2, imm, flags=(ECF,), dataSize=1
+ br label("pslldq_less_16"), flags=(nCECF,)
+
+ # Greater than 16
+
+ lfpimm xmml, 0
+ lfpimm xmmh, 0
+ br label("pslldq_end")
+
+pslldq_less_16:
+
+ # Between 8 and 16
+
+ mslli xmmh, xmml, "(IMMEDIATE-8)<<3", size=8, ext=0
+ lfpimm xmml, 0
+ br label("pslldq_end")
+
+pslldq_less_8:
+
+ # Less than 8
+
+ msrli ufp1, xmml, "(8-IMMEDIATE) << 3", size=8, ext=0
+ mslli xmmh, xmmh, "IMMEDIATE << 3", size=8, ext=0
+ mslli xmml, xmml, "IMMEDIATE << 3", size=8, ext=0
+ mor xmmh, xmmh, ufp1
+
+pslldq_end:
+ fault "NoFault"
+};
'''
-# PSLLDQ
diff --git a/src/arch/x86/isa/insts/simd128/integer/shift/right_logical_shift.py b/src/arch/x86/isa/insts/simd128/integer/shift/right_logical_shift.py
index c904eaf50..61efe1a5d 100644
--- a/src/arch/x86/isa/insts/simd128/integer/shift/right_logical_shift.py
+++ b/src/arch/x86/isa/insts/simd128/integer/shift/right_logical_shift.py
@@ -122,5 +122,41 @@ def macroop PSRLQ_XMM_I {
msrli xmml, xmml, imm, size=8, ext=0
msrli xmmh, xmmh, imm, size=8, ext=0
};
+
+def macroop PSRLDQ_XMM_I {
+ limm t2, 8
+ subi t1, t2, imm, flags=(ECF,), dataSize=1
+ br label("psrldq_less_8"), flags=(nCECF,)
+ # Greater than 8
+
+ limm t2, 16
+ subi t1, t2, imm, flags=(ECF,), dataSize=1
+ br label("psrldq_less_16"), flags=(nCECF,)
+
+ # Greater than 16
+
+ lfpimm xmml, 0
+ lfpimm xmmh, 0
+ br label("psrldq_end")
+
+psrldq_less_16:
+
+ # Between 8 and 16
+
+ msrli xmml, xmmh, "(IMMEDIATE-8)<<3", size=8, ext=0
+ lfpimm xmmh, 0
+ br label("psrldq_end")
+
+psrldq_less_8:
+
+ # Less than 8
+
+ mslli ufp1, xmmh, "(8-IMMEDIATE) << 3", size=8, ext=0
+ msrli xmml, xmml, "IMMEDIATE << 3", size=8, ext=0
+ msrli xmmh, xmmh, "IMMEDIATE << 3", size=8, ext=0
+ mor xmml, xmml, ufp1
+
+psrldq_end:
+ fault "NoFault"
+};
'''
-# PSRLDQ