summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-08-17 20:04:03 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-08-17 20:04:03 -0700
commitbe6267e895e4657192fc72872a70c0ab6bbc6537 (patch)
treeded7390ec9902509e4527e74e95cb5cebd4171c7
parente2759fe69c6b450a46624a9f97af74a330b41383 (diff)
downloadgem5-be6267e895e4657192fc72872a70c0ab6bbc6537.tar.xz
X86: Implement the integer media min instructions.
-rw-r--r--src/arch/x86/isa/decoder/two_byte_opcodes.isa8
-rw-r--r--src/arch/x86/isa/insts/simd128/integer/compare/compare_and_write_minimum_or_maximum.py42
-rw-r--r--src/arch/x86/isa/insts/simd64/integer/compare/compare_and_write_minimum_or_maximum.py32
3 files changed, 74 insertions, 8 deletions
diff --git a/src/arch/x86/isa/decoder/two_byte_opcodes.isa b/src/arch/x86/isa/decoder/two_byte_opcodes.isa
index c9d1e3add..c53cdc838 100644
--- a/src/arch/x86/isa/decoder/two_byte_opcodes.isa
+++ b/src/arch/x86/isa/decoder/two_byte_opcodes.isa
@@ -979,7 +979,7 @@
0x0: decode OPCODE_OP_BOTTOM3 {
0x0: psubusb_Pq_Qq();
0x1: psubusw_Pq_Qq();
- 0x2: pminub_Pq_Qq();
+ 0x2: Inst::PMINUB(Pq,Qq);
0x3: Inst::PAND(Pq,Qq);
0x4: Inst::PADDUSB(Pq,Qq);
0x5: Inst::PADDUSW(Pq,Qq);
@@ -990,7 +990,7 @@
0x1: decode OPCODE_OP_BOTTOM3 {
0x0: psubusb_Vo_Wo();
0x1: psubusw_Vo_Wo();
- 0x2: pminub_Vo_Wo();
+ 0x2: Inst::PMINUB(Vo,Wo);
0x3: Inst::PAND(Vo,Wo);
0x4: Inst::PADDUSB(Vo,Wo);
0x5: Inst::PADDUSW(Vo,Wo);
@@ -1039,7 +1039,7 @@
0x0: decode OPCODE_OP_BOTTOM3 {
0x0: psubsb_Pq_Qq();
0x1: psubsw_Pq_Qq();
- 0x2: pminsw_Pq_Qq();
+ 0x2: Inst::PMINSW(Pq,Qq);
0x3: Inst::POR(Pq,Qq);
0x4: Inst::PADDSB(Pq,Qq);
0x5: Inst::PADDSW(Pq,Qq);
@@ -1050,7 +1050,7 @@
0x1: decode OPCODE_OP_BOTTOM3 {
0x0: psubsb_Vo_Wo();
0x1: psubsw_Vo_Wo();
- 0x2: pminsw_Vo_Wo();
+ 0x2: Inst::PMINSW(Vo,Wo);
0x3: Inst::POR(Vo,Wo);
0x4: Inst::PADDSB(Vo,Wo);
0x5: Inst::PADDSW(Vo,Wo);
diff --git a/src/arch/x86/isa/insts/simd128/integer/compare/compare_and_write_minimum_or_maximum.py b/src/arch/x86/isa/insts/simd128/integer/compare/compare_and_write_minimum_or_maximum.py
index 79b1aca4c..d7f191506 100644
--- a/src/arch/x86/isa/insts/simd128/integer/compare/compare_and_write_minimum_or_maximum.py
+++ b/src/arch/x86/isa/insts/simd128/integer/compare/compare_and_write_minimum_or_maximum.py
@@ -54,8 +54,46 @@
# Authors: Gabe Black
microcode = '''
+def macroop PMINUB_XMM_XMM {
+ mmini xmml, xmml, xmmlm, size=1, ext=0
+ mmini xmmh, xmmh, xmmhm, size=1, ext=0
+};
+
+def macroop PMINUB_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ mmini xmml, xmml, ufp1, size=1, ext=0
+ mmini xmmh, xmmh, ufp2, size=1, ext=0
+};
+
+def macroop PMINUB_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ mmini xmml, xmml, ufp1, size=1, ext=0
+ mmini xmmh, xmmh, ufp2, size=1, ext=0
+};
+
+def macroop PMINSW_XMM_XMM {
+ mmini xmml, xmml, xmmlm, size=2, ext=2
+ mmini xmmh, xmmh, xmmhm, size=2, ext=2
+};
+
+def macroop PMINSW_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ mmini xmml, xmml, ufp1, size=2, ext=2
+ mmini xmmh, xmmh, ufp2, size=2, ext=2
+};
+
+def macroop PMINSW_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ mmini xmml, xmml, ufp1, size=2, ext=2
+ mmini xmmh, xmmh, ufp2, size=2, ext=2
+};
+
# PMAXUB
-# PMINUB
# PMAXSW
-# PMINSW
'''
diff --git a/src/arch/x86/isa/insts/simd64/integer/compare/compare_and_write_minimum_or_maximum.py b/src/arch/x86/isa/insts/simd64/integer/compare/compare_and_write_minimum_or_maximum.py
index 79b1aca4c..34c1799b0 100644
--- a/src/arch/x86/isa/insts/simd64/integer/compare/compare_and_write_minimum_or_maximum.py
+++ b/src/arch/x86/isa/insts/simd64/integer/compare/compare_and_write_minimum_or_maximum.py
@@ -54,8 +54,36 @@
# Authors: Gabe Black
microcode = '''
+def macroop PMINUB_MMX_MMX {
+ mmini mmx, mmx, mmxm, size=1, ext=0
+};
+
+def macroop PMINUB_MMX_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ mmini mmx, mmx, ufp1, size=1, ext=0
+};
+
+def macroop PMINUB_MMX_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ mmini mmx, mmx, ufp1, size=1, ext=0
+};
+
+def macroop PMINSW_MMX_MMX {
+ mmini mmx, mmx, mmxm, size=2, ext=2
+};
+
+def macroop PMINSW_MMX_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ mmini mmx, mmx, ufp1, size=2, ext=2
+};
+
+def macroop PMINSW_MMX_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ mmini mmx, mmx, ufp1, size=2, ext=2
+};
+
# PMAXUB
-# PMINUB
# PMAXSW
-# PMINSW
'''