diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2009-08-17 20:04:02 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2009-08-17 20:04:02 -0700 |
commit | e678df6263ba9cc9e47e6705e276830d3decb15d (patch) | |
tree | 0cbb423343c320f5227c21d85bbf18e3bec544bc /src/arch/x86/isa | |
parent | c278760da0749b1afade222028e9677737f1c8a6 (diff) | |
download | gem5-e678df6263ba9cc9e47e6705e276830d3decb15d.tar.xz |
X86: Implement the media integer addition instructions.
Diffstat (limited to 'src/arch/x86/isa')
3 files changed, 294 insertions, 32 deletions
diff --git a/src/arch/x86/isa/decoder/two_byte_opcodes.isa b/src/arch/x86/isa/decoder/two_byte_opcodes.isa index 200f130dc..c9d1e3add 100644 --- a/src/arch/x86/isa/decoder/two_byte_opcodes.isa +++ b/src/arch/x86/isa/decoder/two_byte_opcodes.isa @@ -945,7 +945,7 @@ 0x1: psrlw_Pq_Qq(); 0x2: psrld_Pq_Qq(); 0x3: psrlq_Pq_Qq(); - 0x4: paddq_Pq_Qq(); + 0x4: Inst::PADDQ(Pq,Qq); 0x5: pmullw_Pq_Qq(); 0x7: pmovmskb_Gd_PRq(); default: Inst::UD2(); @@ -961,7 +961,7 @@ 0x1: psrlw_Vo_Wo(); 0x2: psrld_Vo_Wo(); 0x3: psrlq_Vo_Wo(); - 0x4: paddq_Vo_Wo(); + 0x4: Inst::PADDQ(Vo,Wo); 0x5: pmullw_Vo_Wo(); 0x6: Inst::MOVQ(Wq,Vq); 0x7: pmovmskb_Gd_VRo(); @@ -981,8 +981,8 @@ 0x1: psubusw_Pq_Qq(); 0x2: pminub_Pq_Qq(); 0x3: Inst::PAND(Pq,Qq); - 0x4: paddusb_Pq_Qq(); - 0x5: paddusw_Pq_Qq(); + 0x4: Inst::PADDUSB(Pq,Qq); + 0x5: Inst::PADDUSW(Pq,Qq); 0x6: pmaxub_Pq_Qq(); 0x7: Inst::PANDN(Pq,Qq); } @@ -992,8 +992,8 @@ 0x1: psubusw_Vo_Wo(); 0x2: pminub_Vo_Wo(); 0x3: Inst::PAND(Vo,Wo); - 0x4: paddusb_Vo_Wo(); - 0x5: paddusw_Vo_Wo(); + 0x4: Inst::PADDUSB(Vo,Wo); + 0x5: Inst::PADDUSW(Vo,Wo); 0x6: pmaxub_Vo_Wo(); 0x7: Inst::PANDN(Vo,Wo); } @@ -1041,8 +1041,8 @@ 0x1: psubsw_Pq_Qq(); 0x2: pminsw_Pq_Qq(); 0x3: Inst::POR(Pq,Qq); - 0x4: paddsb_Pq_Qq(); - 0x5: paddsw_Pq_Qq(); + 0x4: Inst::PADDSB(Pq,Qq); + 0x5: Inst::PADDSW(Pq,Qq); 0x6: pmaxsw_Pq_Qq(); 0x7: Inst::PXOR(Pq,Qq); } @@ -1052,8 +1052,8 @@ 0x1: psubsw_Vo_Wo(); 0x2: pminsw_Vo_Wo(); 0x3: Inst::POR(Vo,Wo); - 0x4: paddsb_Vo_Wo(); - 0x5: paddsw_Vo_Wo(); + 0x4: Inst::PADDSB(Vo,Wo); + 0x5: Inst::PADDSW(Vo,Wo); 0x6: pmaxsw_Vo_Wo(); 0x7: Inst::PXOR(Vo,Wo); } @@ -1096,9 +1096,9 @@ 0x1: psubw_Pq_Qq(); 0x2: psubd_Pq_Qq(); 0x3: psubq_Pq_Qq(); - 0x4: paddb_Pq_Qq(); - 0x5: paddw_Pq_Qq(); - 0x6: paddd_Pq_Qq(); + 0x4: Inst::PADDB(Pq,Qq); + 0x5: Inst::PADDW(Pq,Qq); + 0x6: Inst::PADDD(Pq,Qq); 0x7: Inst::UD2(); } // operand size (0x66) @@ -1107,9 +1107,9 @@ 0x1: psubw_Vo_Wo(); 0x2: psubd_Vo_Wo(); 0x3: psubq_Vo_Wo(); - 0x4: paddb_Vo_Wo(); - 0x5: paddw_Vo_Wo(); - 0x6: paddd_Vo_Wo(); + 0x4: Inst::PADDB(Vo,Wo); + 0x5: Inst::PADDW(Vo,Wo); + 0x6: Inst::PADDD(Vo,Wo); 0x7: Inst::UD2(); } default: Inst::UD2(); diff --git a/src/arch/x86/isa/insts/simd128/integer/arithmetic/addition.py b/src/arch/x86/isa/insts/simd128/integer/arithmetic/addition.py index 235a4fc7b..05e2b80d5 100644 --- a/src/arch/x86/isa/insts/simd128/integer/arithmetic/addition.py +++ b/src/arch/x86/isa/insts/simd128/integer/arithmetic/addition.py @@ -54,12 +54,163 @@ # Authors: Gabe Black microcode = ''' -# PADDB -# PADDW -# PADDD -# PADDQ -# PADDSB -# PADDSW -# PADDUSB -# PADDUSW +def macroop PADDB_XMM_XMM { + maddi xmml, xmml, xmmlm, size=1, ext=0 + maddi xmmh, xmmh, xmmhm, size=1, ext=0 +}; + +def macroop PADDB_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=1, ext=0 + maddi xmmh, xmmh, ufp2, size=1, ext=0 +}; + +def macroop PADDB_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=1, ext=0 + maddi xmmh, xmmh, ufp2, size=1, ext=0 +}; + +def macroop PADDW_XMM_XMM { + maddi xmml, xmml, xmmlm, size=2, ext=0 + maddi xmmh, xmmh, xmmhm, size=2, ext=0 +}; + +def macroop PADDW_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=2, ext=0 + maddi xmmh, xmmh, ufp2, size=2, ext=0 +}; + +def macroop PADDW_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=2, ext=0 + maddi xmmh, xmmh, ufp2, size=2, ext=0 +}; + +def macroop PADDD_XMM_XMM { + maddi xmml, xmml, xmmlm, size=4, ext=0 + maddi xmmh, xmmh, xmmhm, size=4, ext=0 +}; + +def macroop PADDD_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=4, ext=0 + maddi xmmh, xmmh, ufp2, size=4, ext=0 +}; + +def macroop PADDD_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=4, ext=0 + maddi xmmh, xmmh, ufp2, size=4, ext=0 +}; + +def macroop PADDQ_XMM_XMM { + maddi xmml, xmml, xmmlm, size=8, ext=0 + maddi xmmh, xmmh, xmmhm, size=8, ext=0 +}; + +def macroop PADDQ_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=8, ext=0 + maddi xmmh, xmmh, ufp2, size=8, ext=0 +}; + +def macroop PADDQ_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=8, ext=0 + maddi xmmh, xmmh, ufp2, size=8, ext=0 +}; + +def macroop PADDSB_XMM_XMM { + maddi xmml, xmml, xmmlm, size=1, ext=4 + maddi xmmh, xmmh, xmmhm, size=1, ext=4 +}; + +def macroop PADDSB_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=1, ext=4 + maddi xmmh, xmmh, ufp2, size=1, ext=4 +}; + +def macroop PADDSB_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=1, ext=4 + maddi xmmh, xmmh, ufp2, size=1, ext=4 +}; + +def macroop PADDSW_XMM_XMM { + maddi xmml, xmml, xmmlm, size=2, ext=4 + maddi xmmh, xmmh, xmmhm, size=2, ext=4 +}; + +def macroop PADDSW_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=2, ext=4 + maddi xmmh, xmmh, ufp2, size=2, ext=4 +}; + +def macroop PADDSW_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=2, ext=4 + maddi xmmh, xmmh, ufp2, size=2, ext=4 +}; + +def macroop PADDUSB_XMM_XMM { + maddi xmml, xmml, xmmlm, size=1, ext=2 + maddi xmmh, xmmh, xmmhm, size=1, ext=2 +}; + +def macroop PADDUSB_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=1, ext=2 + maddi xmmh, xmmh, ufp2, size=1, ext=2 +}; + +def macroop PADDUSB_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=1, ext=2 + maddi xmmh, xmmh, ufp2, size=1, ext=2 +}; + +def macroop PADDUSW_XMM_XMM { + maddi xmml, xmml, xmmlm, size=2, ext=2 + maddi xmmh, xmmh, xmmhm, size=2, ext=2 +}; + +def macroop PADDUSW_XMM_M { + ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=2, ext=2 + maddi xmmh, xmmh, ufp2, size=2, ext=2 +}; + +def macroop PADDUSW_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT + 8", dataSize=8 + maddi xmml, xmml, ufp1, size=2, ext=2 + maddi xmmh, xmmh, ufp2, size=2, ext=2 +}; ''' diff --git a/src/arch/x86/isa/insts/simd64/integer/arithmetic/addition.py b/src/arch/x86/isa/insts/simd64/integer/arithmetic/addition.py index 235a4fc7b..b663d15b7 100644 --- a/src/arch/x86/isa/insts/simd64/integer/arithmetic/addition.py +++ b/src/arch/x86/isa/insts/simd64/integer/arithmetic/addition.py @@ -54,12 +54,123 @@ # Authors: Gabe Black microcode = ''' -# PADDB -# PADDW -# PADDD -# PADDQ -# PADDSB -# PADDSW -# PADDUSB -# PADDUSW +def macroop PADDB_MMX_MMX { + maddi mmx, mmx, mmxm, size=1, ext=0 +}; + +def macroop PADDB_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=1, ext=0 +}; + +def macroop PADDB_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=1, ext=0 +}; + +def macroop PADDW_MMX_MMX { + maddi mmx, mmx, mmxm, size=2, ext=0 +}; + +def macroop PADDW_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=2, ext=0 +}; + +def macroop PADDW_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=2, ext=0 +}; + +def macroop PADDD_MMX_MMX { + maddi mmx, mmx, mmxm, size=4, ext=0 +}; + +def macroop PADDD_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=4, ext=0 +}; + +def macroop PADDD_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=4, ext=0 +}; + +def macroop PADDQ_MMX_MMX { + maddi mmx, mmx, mmxm, size=8, ext=0 +}; + +def macroop PADDQ_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=8, ext=0 +}; + +def macroop PADDQ_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=8, ext=0 +}; + +def macroop PADDSB_MMX_MMX { + maddi mmx, mmx, mmxm, size=1, ext=4 +}; + +def macroop PADDSB_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=1, ext=4 +}; + +def macroop PADDSB_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=1, ext=4 +}; + +def macroop PADDSW_MMX_MMX { + maddi mmx, mmx, mmxm, size=2, ext=4 +}; + +def macroop PADDSW_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=2, ext=4 +}; + +def macroop PADDSW_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=2, ext=4 +}; + +def macroop PADDUSB_MMX_MMX { + maddi mmx, mmx, mmxm, size=1, ext=2 +}; + +def macroop PADDUSB_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=1, ext=2 +}; + +def macroop PADDUSB_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=1, ext=2 +}; + +def macroop PADDUSW_MMX_MMX { + maddi mmx, mmx, mmxm, size=2, ext=2 +}; + +def macroop PADDUSW_MMX_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=2, ext=2 +}; + +def macroop PADDUSW_MMX_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + maddi mmx, mmx, ufp1, size=2, ext=2 +}; ''' |