Mahyar Samani has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/26123 )

Change subject: arch-x86: Add hsub instructions to x86
......................................................................

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 <power...@gmail.com>
Maintainer: Jason Lowe-Power <power...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/arch/x86/isa/decoder/two_byte_opcodes.isa
M src/arch/x86/isa/insts/simd128/floating_point/arithmetic/horizontal_subtraction.py
2 files changed, 49 insertions(+), 4 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/arch/x86/isa/decoder/two_byte_opcodes.isa b/src/arch/x86/isa/decoder/two_byte_opcodes.isa
index c7c62c2..28affdb 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 a629ecd..43523c1 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
+};
 '''

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/26123
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I62919017d3c00119123bda89b2f99cb3bf0b55a8
Gerrit-Change-Number: 26123
Gerrit-PatchSet: 8
Gerrit-Owner: Mahyar Samani <msam...@ucdavis.edu>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: Mahyar Samani <msam...@ucdavis.edu>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to