summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/insts
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-08-17 18:32:08 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-08-17 18:32:08 -0700
commite20c8a4b05b7b4529ac03a0bc203c584ccc52cc5 (patch)
treef273929316dba136bd5e0a63958aad703b59551f /src/arch/x86/isa/insts
parent1273277d3be26fa40ceaddd3d0a137496d098914 (diff)
downloadgem5-e20c8a4b05b7b4529ac03a0bc203c584ccc52cc5.tar.xz
X86: Implement the pack instructions.
Diffstat (limited to 'src/arch/x86/isa/insts')
-rw-r--r--src/arch/x86/isa/insts/simd128/integer/data_reordering/pack_with_saturation.py65
-rw-r--r--src/arch/x86/isa/insts/simd64/integer/data_reordering/pack_with_saturation.py47
2 files changed, 106 insertions, 6 deletions
diff --git a/src/arch/x86/isa/insts/simd128/integer/data_reordering/pack_with_saturation.py b/src/arch/x86/isa/insts/simd128/integer/data_reordering/pack_with_saturation.py
index 859d2bc7e..9112a7382 100644
--- a/src/arch/x86/isa/insts/simd128/integer/data_reordering/pack_with_saturation.py
+++ b/src/arch/x86/isa/insts/simd128/integer/data_reordering/pack_with_saturation.py
@@ -54,7 +54,66 @@
# Authors: Gabe Black
microcode = '''
-# PACKSSDW
-# PACKSSWB
-# PACKUSWB
+def macroop PACKSSDW_XMM_XMM {
+ pack ufp1, xmml, xmmh, ext=1, srcSize=4, destSize=2
+ pack xmmh, xmmlm, xmmhm, ext=1, srcSize=4, destSize=2
+ movfp xmml, ufp1, dataSize=8
+};
+
+def macroop PACKSSDW_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ pack xmml, xmml, xmmh, ext=1, srcSize=4, destSize=2
+ pack xmmh, ufp1, ufp2, ext=1, srcSize=4, destSize=2
+};
+
+def macroop PACKSSDW_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ pack xmml, xmml, xmmh, ext=1, srcSize=4, destSize=2
+ pack xmmh, ufp1, ufp2, ext=1, srcSize=4, destSize=2
+};
+
+def macroop PACKSSWB_XMM_XMM {
+ pack ufp1, xmml, xmmh, ext=1, srcSize=2, destSize=1
+ pack xmmh, xmmlm, xmmhm, ext=1, srcSize=2, destSize=1
+ movfp xmml, ufp1, dataSize=8
+};
+
+def macroop PACKSSWB_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ pack xmml, xmml, xmmh, ext=1, srcSize=2, destSize=1
+ pack xmmh, ufp1, ufp2, ext=1, srcSize=2, destSize=1
+};
+
+def macroop PACKSSWB_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ pack xmml, xmml, xmmh, ext=1, srcSize=2, destSize=1
+ pack xmmh, ufp1, ufp2, ext=1, srcSize=2, destSize=1
+};
+
+def macroop PACKUSWB_XMM_XMM {
+ pack ufp1, xmml, xmmh, ext=0, srcSize=2, destSize=1
+ pack xmmh, xmmlm, xmmhm, ext=0, srcSize=2, destSize=1
+ movfp xmml, ufp1, dataSize=8
+};
+
+def macroop PACKUSWB_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ pack xmml, xmml, xmmh, ext=0, srcSize=2, destSize=1
+ pack xmmh, ufp1, ufp2, ext=0, srcSize=2, destSize=1
+};
+
+def macroop PACKUSWB_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ pack xmml, xmml, xmmh, ext=0, srcSize=2, destSize=1
+ pack xmmh, ufp1, ufp2, ext=0, srcSize=2, destSize=1
+};
'''
diff --git a/src/arch/x86/isa/insts/simd64/integer/data_reordering/pack_with_saturation.py b/src/arch/x86/isa/insts/simd64/integer/data_reordering/pack_with_saturation.py
index 859d2bc7e..4235d7f26 100644
--- a/src/arch/x86/isa/insts/simd64/integer/data_reordering/pack_with_saturation.py
+++ b/src/arch/x86/isa/insts/simd64/integer/data_reordering/pack_with_saturation.py
@@ -54,7 +54,48 @@
# Authors: Gabe Black
microcode = '''
-# PACKSSDW
-# PACKSSWB
-# PACKUSWB
+def macroop PACKSSDW_MMX_MMX {
+ pack mmx, mmx, mmxm, ext=1, srcSize=4, destSize=2
+};
+
+def macroop PACKSSDW_MMX_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ pack mmx, mmx, ufp1, ext=1, srcSize=4, destSize=2
+};
+
+def macroop PACKSSDW_MMX_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ pack mmx, mmx, ufp1, ext=1, srcSize=4, destSize=2
+};
+
+def macroop PACKSSWB_MMX_MMX {
+ pack mmx, mmx, mmxm, ext=1, srcSize=2, destSize=1
+};
+
+def macroop PACKSSWB_MMX_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ pack mmx, mmx, ufp1, ext=1, srcSize=2, destSize=1
+};
+
+def macroop PACKSSWB_MMX_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ pack mmx, mmx, ufp1, ext=1, srcSize=2, destSize=1
+};
+
+def macroop PACKUSWB_MMX_MMX {
+ pack mmx, mmx, mmxm, ext=0, srcSize=2, destSize=1
+};
+
+def macroop PACKUSWB_MMX_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ pack mmx, mmx, ufp1, ext=0, srcSize=2, destSize=1
+};
+
+def macroop PACKUSWB_MMX_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ pack mmx, mmx, ufp1, ext=0, srcSize=2, destSize=1
+};
'''