summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-08-17 20:25:14 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-08-17 20:25:14 -0700
commit1606663aa983d69f964d26cd1522b37b772fe413 (patch)
tree59eb6a9696f5058d2bbc15c48814ae25b6d2a36b /src/arch/x86/isa
parente3ef432a552de0d4891c5b21b76069a8d90c6daa (diff)
downloadgem5-1606663aa983d69f964d26cd1522b37b772fe413.tar.xz
X86: Implement the media instructions that convert fp values to ints.
Diffstat (limited to 'src/arch/x86/isa')
-rw-r--r--src/arch/x86/isa/decoder/two_byte_opcodes.isa22
-rw-r--r--src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py65
-rw-r--r--src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py73
-rw-r--r--src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py89
-rw-r--r--src/arch/x86/isa/insts/simd64/floating_point/data_conversion.py5
5 files changed, 225 insertions, 29 deletions
diff --git a/src/arch/x86/isa/decoder/two_byte_opcodes.isa b/src/arch/x86/isa/decoder/two_byte_opcodes.isa
index 11fc92abc..c670390ad 100644
--- a/src/arch/x86/isa/decoder/two_byte_opcodes.isa
+++ b/src/arch/x86/isa/decoder/two_byte_opcodes.isa
@@ -377,16 +377,16 @@
0x1: Inst::MOVAPS(Wq,Vq);
0x2: Inst::CVTPI2PS(Vq,Qq);
0x3: movntps_Mo_Vo();
- 0x4: cvttps2pi_Pq_Wq();
- 0x5: cvtpS2pi_Pq_Wq();
+ 0x4: Inst::CVTTPS2PI(Pq,Wq);
+ 0x5: Inst::CVTPS2PI(Pq,Wq);
0x6: Inst::UCOMISS(Vd,Wd);
0x7: Inst::COMISS(Vd,Wd);
}
// repe (0xF3)
0x4: decode OPCODE_OP_BOTTOM3 {
0x2: Inst::CVTSI2SS(Vd,Ed);
- 0x4: cvttss2si_Gd_Wd();
- 0x5: cvtss2si_Gd_Wd();
+ 0x4: Inst::CVTTSS2SI(Gd,Wd);
+ 0x5: Inst::CVTSS2SI(Gd,Wd);
default: Inst::UD2();
}
// operand size (0x66)
@@ -395,8 +395,8 @@
0x1: Inst::MOVAPD(Wo,Vo);
0x2: Inst::CVTPI2PD(Vo,Qq);
0x3: movntpd_Mo_Vo();
- 0x4: cvttpd2pi_Pq_Wo();
- 0x5: cvtpd2pi_Pq_Wo();
+ 0x4: Inst::CVTTPD2PI(Pq,Wo);
+ 0x5: Inst::CVTPD2PI(Pq,Wo);
0x6: Inst::UCOMISD(Vq,Wq);
0x7: Inst::COMISD(Vq,Wq);
}
@@ -406,7 +406,7 @@
0x2: Inst::CVTSI2SD(Vdp,Edp);
// The size of the W operand should be q, not dp
0x4: Inst::CVTTSD2SI(Gdp,Wdp);
- 0x5: cvtsd2si_Gd_Wq();
+ 0x5: Inst::CVTSD2SI(Gd,Wq);
default: Inst::UD2();
}
default: Inst::UD2();
@@ -511,7 +511,7 @@
0x0: ADDSS(Vd,Wd);
0x1: MULSS(Vd,Wd);
0x2: CVTSS2SD(Vq,Wd);
- 0x3: WarnUnimpl::cvttps2dq_Vo_Wo();
+ 0x3: CVTTPS2DQ(Vo,Wo);
0x4: SUBSS(Vd,Wd);
0x5: MINSS(Vd,Wd);
0x6: DIVSS(Vd,Wd);
@@ -522,7 +522,7 @@
0x0: ADDPD(Vo,Wo);
0x1: MULPD(Vo,Wo);
0x2: CVTPD2PS(Vo,Wo);
- 0x3: WarnUnimpl::cvtps2dq_Vo_Wo();
+ 0x3: CVTPS2DQ(Vo,Wo);
0x4: SUBPD(Vo,Wo);
0x5: MINPD(Vo,Wo);
0x6: DIVPD(Vo,Wo);
@@ -1023,12 +1023,12 @@
0x3: PAVGW(Vo,Wo);
0x4: PMULHUW(Vo,Wo);
0x5: PMULHW(Vo,Wo);
- 0x6: WarnUnimpl::cvttpd2dq_Vo_Wo();
+ 0x6: CVTTPD2DQ(Vo,Wo);
0x7: WarnUnimpl::movntdq_Mo_Vo();
}
// repne (0xF2)
0x8: decode OPCODE_OP_BOTTOM3 {
- 0x6: WarnUnimpl::cvtpd2dq_Vo_Wo();
+ 0x6: CVTPD2DQ(Vo,Wo);
default: UD2();
}
default: UD2();
diff --git a/src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py b/src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py
index 413026d63..16abd96f4 100644
--- a/src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py
+++ b/src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_gpr_integer.py
@@ -54,22 +54,75 @@
# Authors: Gabe Black
microcode = '''
-# CVTSS2SI
-# CVTSD2SI
-# CVTTSS2SI
+def macroop CVTSS2SI_R_XMM {
+ cvtf2i ufp1, xmmlm, srcSize=4, destSize=dsz, ext=(1 | 4)
+ mov2int reg, ufp1, size=dsz
+};
+
+def macroop CVTSS2SI_R_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ cvtf2i ufp1, ufp1, srcSize=4, destSize=dsz, ext=(1 | 4)
+ mov2int reg, ufp1, size=dsz
+};
+
+def macroop CVTSS2SI_R_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ cvtf2i ufp1, ufp1, srcSize=4, destSize=dsz, ext=(1 | 4)
+ mov2int reg, ufp1, size=dsz
+};
+
+def macroop CVTSD2SI_R_XMM {
+ cvtf2i ufp1, xmmlm, srcSize=8, destSize=dsz, ext=(1 | 4)
+ mov2int reg, ufp1, size=dsz
+};
+
+def macroop CVTSD2SI_R_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ cvtf2i ufp1, ufp1, srcSize=8, destSize=dsz, ext=(1 | 4)
+ mov2int reg, ufp1, size=dsz
+};
+
+def macroop CVTSD2SI_R_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ cvtf2i ufp1, ufp1, srcSize=8, destSize=dsz, ext=(1 | 4)
+ mov2int reg, ufp1, size=dsz
+};
+
+def macroop CVTTSS2SI_R_XMM {
+ cvtf2i ufp1, xmmlm, srcSize=4, destSize=dsz, ext=1
+ mov2int reg, ufp1, size=dsz
+};
+
+def macroop CVTTSS2SI_R_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ cvtf2i ufp1, ufp1, srcSize=4, destSize=dsz, ext=1
+ mov2int reg, ufp1, size=dsz
+};
+
+def macroop CVTTSS2SI_R_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ cvtf2i ufp1, ufp1, srcSize=4, destSize=dsz, ext=1
+ mov2int reg, ufp1, size=dsz
+};
def macroop CVTTSD2SI_R_XMM {
- cvtf_d2i reg, xmmlm
+ cvtf2i ufp1, xmmlm, srcSize=8, destSize=dsz, ext=1
+ mov2int reg, ufp1, size=dsz
};
def macroop CVTTSD2SI_R_M {
ldfp ufp1, seg, sib, disp, dataSize=8
- cvtf_d2i reg, ufp1
+ cvtf2i ufp1, ufp1, srcSize=8, destSize=dsz, ext=1
+ mov2int reg, ufp1, size=dsz
};
def macroop CVTTSD2SI_R_P {
rdip t7
ldfp ufp1, seg, riprel, disp, dataSize=8
- cvtf_d2i reg, ufp1
+ cvtf2i ufp1, ufp1, srcSize=8, destSize=dsz, ext=1
+ mov2int reg, ufp1, size=dsz
};
'''
diff --git a/src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py b/src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py
index af579a46f..900e91c99 100644
--- a/src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py
+++ b/src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_mmx_integer.py
@@ -54,8 +54,73 @@
# Authors: Gabe Black
microcode = '''
-# CVTPS2PI
-# CVTPD2PI
-# CVTTPS2PI
-# CVTTPD2PI
+def macroop CVTPS2PI_MMX_XMM {
+ cvtf2i mmx, xmmlm, size=4, ext=4
+};
+
+def macroop CVTPS2PI_MMX_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ cvtf2i mmx, ufp1, size=4, ext=4
+};
+
+def macroop CVTPS2PI_MMX_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ cvtf2i mmx, ufp1, size=4, ext=4
+};
+
+def macroop CVTPD2PI_MMX_XMM {
+ cvtf2i mmx, xmmlm, srcSize=8, destSize=4, ext=4
+ cvtf2i mmx, xmmhm, srcSize=8, destSize=4, ext=(4 | 2)
+};
+
+def macroop CVTPD2PI_MMX_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ cvtf2i mmx, ufp1, srcSize=8, destSize=4, ext=4
+ cvtf2i mmx, ufp2, srcSize=8, destSize=4, ext=(4 | 2)
+};
+
+def macroop CVTPD2PI_MMX_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ cvtf2i mmx, ufp1, srcSize=8, destSize=4, ext=4
+ cvtf2i mmx, ufp2, srcSize=8, destSize=4, ext=(4 | 2)
+};
+
+def macroop CVTTPS2PI_MMX_XMM {
+ cvtf2i mmx, xmmlm, size=4, ext=0
+};
+
+def macroop CVTTPS2PI_MMX_M {
+ ldfp ufp1, seg, sib, disp, dataSize=8
+ cvtf2i mmx, ufp1, size=4, ext=0
+};
+
+def macroop CVTTPS2PI_MMX_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, disp, dataSize=8
+ cvtf2i mmx, ufp1, size=4, ext=0
+};
+
+def macroop CVTTPD2PI_MMX_XMM {
+ cvtf2i mmx, xmmlm, srcSize=8, destSize=4, ext=0
+ cvtf2i mmx, xmmhm, srcSize=8, destSize=4, ext=2
+};
+
+def macroop CVTTPD2PI_MMX_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ cvtf2i mmx, ufp1, srcSize=8, destSize=4, ext=0
+ cvtf2i mmx, ufp2, srcSize=8, destSize=4, ext=2
+};
+
+def macroop CVTTPD2PI_MMX_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ cvtf2i mmx, ufp1, srcSize=8, destSize=4, ext=0
+ cvtf2i mmx, ufp2, srcSize=8, destSize=4, ext=2
+};
'''
diff --git a/src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py b/src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py
index 683e2808d..041f891ef 100644
--- a/src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py
+++ b/src/arch/x86/isa/insts/simd128/floating_point/data_conversion/convert_floating_point_to_xmm_integer.py
@@ -54,8 +54,89 @@
# Authors: Gabe Black
microcode = '''
-# CVTPS2DQ
-# CVTPD2DQ
-# CVTTPS2DQ
-# CVTTPD2DQ
+def macroop CVTPS2DQ_XMM_XMM {
+ cvtf2i xmml, xmmlm, size=4, ext=4
+ cvtf2i xmmh, xmmhm, size=4, ext=4
+};
+
+def macroop CVTPS2DQ_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ cvtf2i xmml, ufp1, size=4, ext=4
+ cvtf2i xmmh, ufp2, size=4, ext=4
+};
+
+def macroop CVTPS2DQ_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ cvtf2i xmml, ufp1, size=4, ext=4
+ cvtf2i xmmh, ufp2, size=4, ext=4
+};
+
+def macroop CVTPD2DQ_XMM_XMM {
+ cvtf2i xmml, xmmlm, srcSize=8, destSize=4, ext=4
+ cvtf2i xmml, xmmhm, srcSize=8, destSize=4, ext=(4 | 2)
+ lfpimm xmmh, 0
+};
+
+def macroop CVTPD2DQ_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ cvtf2i xmml, ufp1, srcSize=8, destSize=4, ext=4
+ cvtf2i xmml, ufp2, srcSize=8, destSize=4, ext=(4 | 2)
+ lfpimm xmmh, 0
+};
+
+def macroop CVTPD2DQ_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ cvtf2i xmml, ufp1, srcSize=8, destSize=4, ext=4
+ cvtf2i xmml, ufp2, srcSize=8, destSize=4, ext=(4 | 2)
+ lfpimm xmmh, 0
+};
+
+def macroop CVTTPS2DQ_XMM_XMM {
+ cvtf2i xmml, xmmlm, size=4, ext=0
+ cvtf2i xmmh, xmmhm, size=4, ext=0
+};
+
+def macroop CVTTPS2DQ_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ cvtf2i xmml, ufp1, size=4, ext=0
+ cvtf2i xmmh, ufp2, size=4, ext=0
+};
+
+def macroop CVTTPS2DQ_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ cvtf2i xmml, ufp1, size=4, ext=0
+ cvtf2i xmmh, ufp2, size=4, ext=0
+};
+
+def macroop CVTTPD2DQ_XMM_XMM {
+ cvtf2i xmml, xmmlm, srcSize=8, destSize=4, ext=0
+ cvtf2i xmml, xmmhm, srcSize=8, destSize=4, ext=2
+ lfpimm xmmh, 0
+};
+
+def macroop CVTTPD2DQ_XMM_M {
+ ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
+ cvtf2i xmml, ufp1, srcSize=8, destSize=4, ext=0
+ cvtf2i xmml, ufp2, srcSize=8, destSize=4, ext=2
+ lfpimm xmmh, 0
+};
+
+def macroop CVTTPD2DQ_XMM_P {
+ rdip t7
+ ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8
+ ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8
+ cvtf2i xmml, ufp1, srcSize=8, destSize=4, ext=0
+ cvtf2i xmml, ufp2, srcSize=8, destSize=4, ext=2
+ lfpimm xmmh, 0
+};
'''
diff --git a/src/arch/x86/isa/insts/simd64/floating_point/data_conversion.py b/src/arch/x86/isa/insts/simd64/floating_point/data_conversion.py
index 6c942065d..1ade48152 100644
--- a/src/arch/x86/isa/insts/simd64/floating_point/data_conversion.py
+++ b/src/arch/x86/isa/insts/simd64/floating_point/data_conversion.py
@@ -54,10 +54,7 @@
# Authors: Gabe Black
microcode = '''
-# CVTPS2PI
-# CVTTPS2PI
-# CVTPD2PI
-# CVTTPD2PI
+# CVTPS2PI, CVTTPS2PI, CVTPD2PI, and CVTTPD2PI are implemented in simd128
# PF2IW
# PF2ID
'''