summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/isa')
-rw-r--r--src/arch/x86/isa/decoder/two_byte_opcodes.isa16
-rw-r--r--src/arch/x86/isa/insts/simd128/integer/arithmetic/multiplication.py83
-rw-r--r--src/arch/x86/isa/insts/simd64/integer/arithmetic/multiplication.py79
3 files changed, 161 insertions, 17 deletions
diff --git a/src/arch/x86/isa/decoder/two_byte_opcodes.isa b/src/arch/x86/isa/decoder/two_byte_opcodes.isa
index c230380d6..df4512b7c 100644
--- a/src/arch/x86/isa/decoder/two_byte_opcodes.isa
+++ b/src/arch/x86/isa/decoder/two_byte_opcodes.isa
@@ -948,7 +948,7 @@
0x2: psrld_Pq_Qq();
0x3: psrlq_Pq_Qq();
0x4: Inst::PADDQ(Pq,Qq);
- 0x5: pmullw_Pq_Qq();
+ 0x5: Inst::PMULLW(Pq,Qq);
0x7: pmovmskb_Gd_PRq();
default: Inst::UD2();
}
@@ -964,7 +964,7 @@
0x2: psrld_Vo_Wo();
0x3: psrlq_Vo_Wo();
0x4: Inst::PADDQ(Vo,Wo);
- 0x5: pmullw_Vo_Wo();
+ 0x5: Inst::PMULLW(Vo,Wo);
0x6: Inst::MOVQ(Wq,Vq);
0x7: pmovmskb_Gd_VRo();
}
@@ -1010,8 +1010,8 @@
0x1: psraw_Pq_Qq();
0x2: psrad_Pq_Qq();
0x3: pavgw_Pq_Qq();
- 0x4: pmulhuw_Pq_Qq();
- 0x5: pmulhw_Pq_Qq();
+ 0x4: Inst::PMULHUW(Pq,Qq);
+ 0x5: Inst::PMULHW(Pq,Qq);
0x7: movntq_Mq_Pq();
default: Inst::UD2();
}
@@ -1026,8 +1026,8 @@
0x1: psraw_Vo_Wo();
0x2: psrad_Vo_Wo();
0x3: pavgw_Vo_Wo();
- 0x4: pmulhuw_Vo_Wo();
- 0x5: pmulhw_Vo_Wo();
+ 0x4: Inst::PMULHUW(Vo,Wo);
+ 0x5: Inst::PMULHW(Vo,Wo);
0x6: cvttpd2dq_Vo_Wo();
0x7: movntdq_Mo_Vo();
}
@@ -1071,7 +1071,7 @@
0x1: psllw_Pq_Qq();
0x2: pslld_Pq_Qq();
0x3: psllq_Pq_Qq();
- 0x4: pmuludq_Pq_Qq();
+ 0x4: Inst::PMULUDQ(Pq,Qq);
0x5: pmaddwd_Pq_Qq();
0x6: psadbw_Pq_Qq();
0x7: maskmovq_Pq_PRq();
@@ -1082,7 +1082,7 @@
0x1: psllw_Vo_Wo();
0x2: pslld_Vo_Wo();
0x3: psllq_Vo_Wo();
- 0x4: pmuludq_Vo_Wo();
+ 0x4: Inst::PMULUDQ(Vo,Wo);
0x5: pmaddwd_Vo_Wo();
0x6: psadbw_Vo_Wo();
0x7: maskmovdqu_Vo_VRo();
diff --git a/src/arch/x86/isa/insts/simd128/integer/arithmetic/multiplication.py b/src/arch/x86/isa/insts/simd128/integer/arithmetic/multiplication.py
index 3e7345a9f..a5d90c6b2 100644
--- a/src/arch/x86/isa/insts/simd128/integer/arithmetic/multiplication.py
+++ b/src/arch/x86/isa/insts/simd128/integer/arithmetic/multiplication.py
@@ -54,8 +54,83 @@
# Authors: Gabe Black
microcode = '''
-# PMULHW
-# PMULLW
-# PMULHUW
-# PMULUDQ
+def macroop PMULHW_XMM_XMM {
+ mmuli xmml, xmml, xmmlm, size=2, ext=(0x2 | 0x8)
+ mmuli xmmh, xmmh, xmmhm, size=2, ext=(0x2 | 0x8)
+};
+
+def macroop PMULHW_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ mmuli xmml, xmml, ufp1, size=2, ext=(0x2 | 0x8)
+ mmuli xmmh, xmmh, ufp2, size=2, ext=(0x2 | 0x8)
+};
+
+def macroop PMULHW_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ mmuli xmml, xmml, ufp1, size=2, ext=(0x2 | 0x8)
+ mmuli xmmh, xmmh, ufp2, size=2, ext=(0x2 | 0x8)
+};
+
+def macroop PMULLW_XMM_XMM {
+ mmuli xmml, xmml, xmmlm, size=2, ext=2
+ mmuli xmmh, xmmh, xmmhm, size=2, ext=2
+};
+
+def macroop PMULLW_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ mmuli xmml, xmml, ufp1, size=2, ext=2
+ mmuli xmmh, xmmh, ufp2, size=2, ext=2
+};
+
+def macroop PMULLW_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ mmuli xmml, xmml, ufp1, size=2, ext=2
+ mmuli xmmh, xmmh, ufp2, size=2, ext=2
+};
+
+def macroop PMULHUW_XMM_XMM {
+ mmuli xmml, xmml, xmmlm, size=2, ext=8
+ mmuli xmmh, xmmh, xmmhm, size=2, ext=8
+};
+
+def macroop PMULHUW_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ mmuli xmml, xmml, ufp1, size=2, ext=8
+ mmuli xmmh, xmmh, ufp2, size=2, ext=8
+};
+
+def macroop PMULHUW_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ mmuli xmml, xmml, ufp1, size=2, ext=8
+ mmuli xmmh, xmmh, ufp2, size=2, ext=8
+};
+
+def macroop PMULUDQ_XMM_XMM {
+ mmuli xmml, xmml, xmmlm, srcSize=4, destSize=8, ext=1
+ mmuli xmmh, xmmh, xmmhm, srcSize=4, destSize=8, ext=1
+};
+
+def macroop PMULUDQ_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ mmuli xmml, xmml, ufp1, srcSize=4, destSize=8, ext=1
+ mmuli xmmh, xmmh, ufp2, srcSize=4, destSize=8, ext=1
+};
+
+def macroop PMULUDQ_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ mmuli xmml, xmml, ufp1, srcSize=4, destSize=8, ext=1
+ mmuli xmmh, xmmh, ufp2, srcSize=4, destSize=8, ext=1
+};
'''
diff --git a/src/arch/x86/isa/insts/simd64/integer/arithmetic/multiplication.py b/src/arch/x86/isa/insts/simd64/integer/arithmetic/multiplication.py
index 8382bc439..7383a744f 100644
--- a/src/arch/x86/isa/insts/simd64/integer/arithmetic/multiplication.py
+++ b/src/arch/x86/isa/insts/simd64/integer/arithmetic/multiplication.py
@@ -54,9 +54,78 @@
# Authors: Gabe Black
microcode = '''
-# PMULHW
-# PMULLW
-# PMULHRW
-# PMULHUW
-# PMULUDQ
+def macroop PMULHW_MMX_MMX {
+ mmuli mmx, mmx, mmxm, size=2, ext=(0x2 | 0x8)
+};
+
+def macroop PMULHW_MMX_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ mmuli mmx, mmx, ufp1, size=2, ext=(0x2 | 0x8)
+};
+
+def macroop PMULHW_MMX_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ mmuli mmx, mmx, ufp1, size=2, ext=(0x2 | 0x8)
+};
+
+def macroop PMULLW_MMX_MMX {
+ mmuli mmx, mmx, mmxm, size=2, ext=2
+};
+
+def macroop PMULLW_MMX_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ mmuli mmx, mmx, ufp1, size=2, ext=2
+};
+
+def macroop PMULLW_MMX_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ mmuli mmx, mmx, ufp1, size=2, ext=2
+};
+
+def macroop PMULHRW_MMX_MMX {
+ mmuli mmx, mmx, mmxm, size=2, ext=(0x2 | 0x4 | 0x8)
+};
+
+def macroop PMULHRW_MMX_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ mmuli mmx, mmx, ufp1, size=2, ext=(0x2 | 0x4 | 0x8)
+};
+
+def macroop PMULHRW_MMX_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ mmuli mmx, mmx, ufp1, size=2, ext=(0x2 | 0x4 | 0x8)
+};
+
+def macroop PMULHUW_MMX_MMX {
+ mmuli mmx, mmx, mmxm, size=2, ext=8
+};
+
+def macroop PMULHUW_MMX_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ mmuli mmx, mmx, ufp1, size=2, ext=8
+};
+
+def macroop PMULHUW_MMX_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ mmuli mmx, mmx, ufp1, size=2, ext=8
+};
+
+def macroop PMULUDQ_MMX_MMX {
+ mmuli mmx, mmx, mmxm, srcSize=4, destSize=8, ext=1
+};
+
+def macroop PMULUDQ_MMX_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ mmuli mmx, mmx, ufp1, srcSize=4, destSize=8, ext=1
+};
+
+def macroop PMULUDQ_MMX_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ mmuli mmx, mmx, ufp1, srcSize=4, destSize=8, ext=1
+};
'''