From: Mahyar Samani Date: Tue, 3 Mar 2020 19:32:19 +0000 (+0000) Subject: arch-x86: Add hsub instructions to x86 X-Git-Tag: v20.0.0.0~169 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f17fbee4ce2e15bbfa2e9d9beca5ac39cff72edd;p=gem5.git arch-x86: Add hsub instructions to x86 Implemented hsubpd and hsubps instructions from x86. Issue-on: https://gem5.atlassian.net/browse/GEM5-181 Change-Id: I62919017d3c00119123bda89b2f99cb3bf0b55a8 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26123 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/src/arch/x86/isa/decoder/two_byte_opcodes.isa b/src/arch/x86/isa/decoder/two_byte_opcodes.isa index c7c62c25b..28affdb34 100644 --- a/src/arch/x86/isa/decoder/two_byte_opcodes.isa +++ b/src/arch/x86/isa/decoder/two_byte_opcodes.isa @@ -691,7 +691,7 @@ // operand size (0x66) 0x1: decode OPCODE_OP_BOTTOM3 { 0x4: HADDPD(Vo,Wo); - 0x5: WarnUnimpl::hsubpd_Vo_Wo(); + 0x5: HSUBPD(Vo, Wo); 0x6: MOVD(Edp,Vd); 0x7: MOVDQA(Wo,Vo); default: UD2(); @@ -699,7 +699,7 @@ // repne (0xF2) 0x8: decode OPCODE_OP_BOTTOM3 { 0x4: HADDPS(Vo,Wo); - 0x5: WarnUnimpl::hsubps_Vo_Wo(); + 0x5: HSUBPS(Vo, Wo); default: UD2(); } default: UD2(); diff --git a/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/horizontal_subtraction.py b/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/horizontal_subtraction.py index a629ecda8..43523c1be 100644 --- a/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/horizontal_subtraction.py +++ b/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/horizontal_subtraction.py @@ -34,6 +34,51 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. microcode = ''' -# HSUBPS -# HSUBPD +def macroop HSUBPS_XMM_XMM { + shuffle ufp1, xmml, xmmh, ext=((0 << 0) | (2 << 2)), size=4 + shuffle ufp2, xmml, xmmh, ext=((1 << 0) | (3 << 2)), size=4 + shuffle ufp3, xmmlm, xmmhm, ext=((0 << 0) | (2 << 2)), size=4 + shuffle ufp4, xmmlm, xmmhm, ext=((1 << 0) | (3 << 2)), size=4 + msubf xmml, ufp1, ufp2, size=4 + msubf xmmh, ufp3, ufp4, size=4 +}; +def macroop HSUBPS_XMM_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT+8", dataSize=8 + shuffle ufp3, xmml, xmmh, ext=((0 << 0) | (2 << 2)), size=4 + shuffle ufp4, xmml, xmmh, ext=((1 << 0) | (3 << 2)), size=4 + shuffle ufp5, ufp1, ufp2, ext=((0 << 0) | (2 << 2)), size=4 + shuffle ufp6, ufp1, ufp2, ext=((1 << 0) | (3 << 2)), size=4 + msubf xmml, ufp3, ufp4, size=4 + msubf xmmh, ufp5, ufp6, size=4 +}; +def macroop HSUBPS_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT+8", dataSize=8 + shuffle ufp3, xmml, xmmh, ext=((0 << 0) | (2 << 2)), size=4 + shuffle ufp4, xmml, xmmh, ext=((1 << 0) | (3 << 2)), size=4 + shuffle ufp5, ufp1, ufp2, ext=((0 << 0) | (2 << 2)), size=4 + shuffle ufp6, ufp1, ufp2, ext=((1 << 0) | (3 << 2)), size=4 + msubf xmml, ufp3, ufp4, size=4 + msubf xmmh, ufp5, ufp6, size=4 +}; +def macroop HSUBPD_XMM_XMM { + msubf ufp1, xmmh , xmml, size=8, ext=Scalar + msubf xmmh, xmmlm, xmmhm, size=8, ext=Scalar + movfp xmml, ufp1 +}; +def macroop HSUBPD_XMM_M { + ldfp ufp1, seg, sib, disp, dataSize=8 + ldfp ufp2, seg, sib, "DISPLACEMENT+8", dataSize=8 + msubf xmml, xmml, xmmh, size=8, ext=Scalar + msubf xmmh, ufp1, ufp2, size=8, ext=Scalar +}; +def macroop HSUBPD_XMM_P { + rdip t7 + ldfp ufp1, seg, riprel, disp, dataSize=8 + ldfp ufp2, seg, riprel, "DISPLACEMENT+8", dataSize=8 + msubf xmml, xmml, xmmh, size=8, ext=Scalar + msubf xmmh, ufp1, ufp2, size=8, ext=Scalar +}; '''