diff options
author | Hrvoje Varga <Hrvoje.Varga@imgtec.com> | 2015-11-20 07:14:52 +0000 |
---|---|---|
committer | Hrvoje Varga <Hrvoje.Varga@imgtec.com> | 2015-11-20 07:14:52 +0000 |
commit | b65518c15cbb944ada72837a7ff7da19753ad539 (patch) | |
tree | 1ac1bdc57cf783777d64eca93991ea29790a7605 | |
parent | 3d42f340cd44edf7a79ee2d58e68251a4318a081 (diff) | |
download | bcm5719-llvm-b65518c15cbb944ada72837a7ff7da19753ad539.tar.gz bcm5719-llvm-b65518c15cbb944ada72837a7ff7da19753ad539.zip |
[mips][microMIPS] Implement MUL[_S].PH, MULEQ_S.W.PHL, MULEQ_S.W.PHR, MULEU_S.PH.QBL, MULEU_S.PH.QBR, MULQ_RS.PH, MULQ_RS.W, MULQ_S.PH and MULQ_S.W instructions
Differential Revision: http://reviews.llvm.org/D14280
llvm-svn: 253651
-rw-r--r-- | llvm/lib/Target/Mips/MicroMipsDSPInstrInfo.td | 20 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/MipsDSPInstrInfo.td | 20 | ||||
-rw-r--r-- | llvm/test/MC/Disassembler/Mips/micromips-dsp/valid.txt | 5 | ||||
-rw-r--r-- | llvm/test/MC/Disassembler/Mips/micromips-dspr2/valid.txt | 10 | ||||
-rw-r--r-- | llvm/test/MC/Mips/micromips-dsp/valid.s | 5 | ||||
-rw-r--r-- | llvm/test/MC/Mips/micromips-dspr2/valid.s | 10 |
6 files changed, 60 insertions, 10 deletions
diff --git a/llvm/lib/Target/Mips/MicroMipsDSPInstrInfo.td b/llvm/lib/Target/Mips/MicroMipsDSPInstrInfo.td index 7f8f88b9552..b2e5ec61c8b 100644 --- a/llvm/lib/Target/Mips/MicroMipsDSPInstrInfo.td +++ b/llvm/lib/Target/Mips/MicroMipsDSPInstrInfo.td @@ -110,6 +110,16 @@ class DPSQX_SA_W_PH_MMR2_ENC : POOL32A_2RAC_FMT<"dpsqx_sa.w.ph", 0b11011010>; class DPSU_H_QBL_MM_ENC : POOL32A_2RAC_FMT<"dpsu.h.qbl", 0b10010010>; class DPSU_H_QBR_MM_ENC : POOL32A_2RAC_FMT<"dpsu.h.qbr", 0b11010010>; class DPSX_W_PH_MMR2_ENC : POOL32A_2RAC_FMT<"dpsx.w.ph", 0b01010010>; +class MUL_PH_MMR2_ENC : POOL32A_3R_FMT<"mul.ph", 0b00000101101>; +class MUL_S_PH_MMR2_ENC : POOL32A_3R_FMT<"mul_s.ph", 0b10000101101>; +class MULEQ_S_W_PHL_MM_ENC : POOL32A_3RB0_FMT<"muleq_s.w.phl", 0b0000100101>; +class MULEQ_S_W_PHR_MM_ENC : POOL32A_3RB0_FMT<"muleq_s.w.phr", 0b0001100101>; +class MULEU_S_PH_QBL_MM_ENC : POOL32A_3RB0_FMT<"muleu_s.ph.qbl", 0b0010010101>; +class MULEU_S_PH_QBR_MM_ENC : POOL32A_3RB0_FMT<"muleu_s.ph.qbr", 0b0011010101>; +class MULQ_RS_PH_MM_ENC : POOL32A_3RB0_FMT<"mulq_rs.ph", 0b0100010101>; +class MULQ_RS_W_MMR2_ENC : POOL32A_3RB0_FMT<"mulq_rs.w", 0b0110010101>; +class MULQ_S_PH_MMR2_ENC : POOL32A_3RB0_FMT<"mulq_s.ph", 0b0101010101>; +class MULQ_S_W_MMR2_ENC : POOL32A_3RB0_FMT<"mulq_s.w", 0b0111010101>; // Instruction desc. class ABSQ_S_PH_MM_R2_DESC_BASE<string opstr, SDPatternOperator OpNode, @@ -339,6 +349,11 @@ def DPSQ_S_W_PH_MM : DspMMRel, DPSQ_S_W_PH_MM_ENC, DPSQ_S_W_PH_DESC; def DPSQ_SA_L_W_MM : DspMMRel, DPSQ_SA_L_W_MM_ENC, DPSQ_SA_L_W_DESC; def DPSU_H_QBL_MM : DspMMRel, DPSU_H_QBL_MM_ENC, DPSU_H_QBL_DESC; def DPSU_H_QBR_MM : DspMMRel, DPSU_H_QBR_MM_ENC, DPSU_H_QBR_DESC; +def MULEQ_S_W_PHL_MM : DspMMRel, MULEQ_S_W_PHL_MM_ENC, MULEQ_S_W_PHL_DESC; +def MULEQ_S_W_PHR_MM : DspMMRel, MULEQ_S_W_PHR_MM_ENC, MULEQ_S_W_PHR_DESC; +def MULEU_S_PH_QBL_MM : DspMMRel, MULEU_S_PH_QBL_MM_ENC, MULEU_S_PH_QBL_DESC; +def MULEU_S_PH_QBR_MM : DspMMRel, MULEU_S_PH_QBR_MM_ENC, MULEU_S_PH_QBR_DESC; +def MULQ_RS_PH_MM : DspMMRel, MULQ_RS_PH_MM_ENC, MULQ_RS_PH_DESC; // microMIPS DSP Rev 2 def ABSQ_S_QB_MMR2 : DspMMRel, ABSQ_S_QB_MMR2_ENC, ABSQ_S_QB_MMR2_DESC, ISA_DSPR2; @@ -378,3 +393,8 @@ def DPSQX_S_W_PH_MMR2 : DspMMRel, DPSQX_S_W_PH_MMR2_ENC, DPSQX_S_W_PH_DESC, def DPSQX_SA_W_PH_MMR2 : DspMMRel, DPSQX_SA_W_PH_MMR2_ENC, DPSQX_SA_W_PH_DESC, ISA_DSPR2; def DPSX_W_PH_MMR2 : DspMMRel, DPSX_W_PH_MMR2_ENC, DPSX_W_PH_DESC, ISA_DSPR2; +def MUL_PH_MMR2 : DspMMRel, MUL_PH_MMR2_ENC, MUL_PH_DESC, ISA_DSPR2; +def MUL_S_PH_MMR2 : DspMMRel, MUL_S_PH_MMR2_ENC, MUL_S_PH_DESC, ISA_DSPR2; +def MULQ_RS_W_MMR2 : DspMMRel, MULQ_RS_W_MMR2_ENC, MULQ_RS_W_DESC, ISA_DSPR2; +def MULQ_S_PH_MMR2 : DspMMRel, MULQ_S_PH_MMR2_ENC, MULQ_S_PH_DESC, ISA_DSPR2; +def MULQ_S_W_MMR2 : DspMMRel, MULQ_S_W_MMR2_ENC, MULQ_S_W_DESC, ISA_DSPR2; diff --git a/llvm/lib/Target/Mips/MipsDSPInstrInfo.td b/llvm/lib/Target/Mips/MipsDSPInstrInfo.td index 9a7c7944ca1..0ad0d344efb 100644 --- a/llvm/lib/Target/Mips/MipsDSPInstrInfo.td +++ b/llvm/lib/Target/Mips/MipsDSPInstrInfo.td @@ -1135,11 +1135,11 @@ def SHLL_S_W : DspMMRel, SHLL_S_W_ENC, SHLL_S_W_DESC; def SHLLV_S_W : DspMMRel, SHLLV_S_W_ENC, SHLLV_S_W_DESC; def SHRA_R_W : DspMMRel, SHRA_R_W_ENC, SHRA_R_W_DESC; def SHRAV_R_W : DspMMRel, SHRAV_R_W_ENC, SHRAV_R_W_DESC; -def MULEU_S_PH_QBL : MULEU_S_PH_QBL_ENC, MULEU_S_PH_QBL_DESC; -def MULEU_S_PH_QBR : MULEU_S_PH_QBR_ENC, MULEU_S_PH_QBR_DESC; -def MULEQ_S_W_PHL : MULEQ_S_W_PHL_ENC, MULEQ_S_W_PHL_DESC; -def MULEQ_S_W_PHR : MULEQ_S_W_PHR_ENC, MULEQ_S_W_PHR_DESC; -def MULQ_RS_PH : MULQ_RS_PH_ENC, MULQ_RS_PH_DESC; +def MULEU_S_PH_QBL : DspMMRel, MULEU_S_PH_QBL_ENC, MULEU_S_PH_QBL_DESC; +def MULEU_S_PH_QBR : DspMMRel, MULEU_S_PH_QBR_ENC, MULEU_S_PH_QBR_DESC; +def MULEQ_S_W_PHL : DspMMRel, MULEQ_S_W_PHL_ENC, MULEQ_S_W_PHL_DESC; +def MULEQ_S_W_PHR : DspMMRel, MULEQ_S_W_PHR_ENC, MULEQ_S_W_PHR_DESC; +def MULQ_RS_PH : DspMMRel, MULQ_RS_PH_ENC, MULQ_RS_PH_DESC; def MULSAQ_S_W_PH : MULSAQ_S_W_PH_ENC, MULSAQ_S_W_PH_DESC; def MAQ_S_W_PHL : MAQ_S_W_PHL_ENC, MAQ_S_W_PHL_DESC; def MAQ_S_W_PHR : MAQ_S_W_PHR_ENC, MAQ_S_W_PHR_DESC; @@ -1226,11 +1226,11 @@ def ADDQH_W : DspMMRel, ADDQH_W_ENC, ADDQH_W_DESC; def ADDQH_R_W : DspMMRel, ADDQH_R_W_ENC, ADDQH_R_W_DESC; def SUBQH_W : DspMMRel, SUBQH_W_ENC, SUBQH_W_DESC; def SUBQH_R_W : DspMMRel, SUBQH_R_W_ENC, SUBQH_R_W_DESC; -def MUL_PH : MUL_PH_ENC, MUL_PH_DESC; -def MUL_S_PH : MUL_S_PH_ENC, MUL_S_PH_DESC; -def MULQ_S_W : MULQ_S_W_ENC, MULQ_S_W_DESC; -def MULQ_RS_W : MULQ_RS_W_ENC, MULQ_RS_W_DESC; -def MULQ_S_PH : MULQ_S_PH_ENC, MULQ_S_PH_DESC; +def MUL_PH : DspMMRel, MUL_PH_ENC, MUL_PH_DESC; +def MUL_S_PH : DspMMRel, MUL_S_PH_ENC, MUL_S_PH_DESC; +def MULQ_S_W : DspMMRel, MULQ_S_W_ENC, MULQ_S_W_DESC; +def MULQ_RS_W : DspMMRel, MULQ_RS_W_ENC, MULQ_RS_W_DESC; +def MULQ_S_PH : DspMMRel, MULQ_S_PH_ENC, MULQ_S_PH_DESC; def DPA_W_PH : DspMMRel, DPA_W_PH_ENC, DPA_W_PH_DESC; def DPS_W_PH : DspMMRel, DPS_W_PH_ENC, DPS_W_PH_DESC; def DPAQX_S_W_PH : DspMMRel, DPAQX_S_W_PH_ENC, DPAQX_S_W_PH_DESC; diff --git a/llvm/test/MC/Disassembler/Mips/micromips-dsp/valid.txt b/llvm/test/MC/Disassembler/Mips/micromips-dsp/valid.txt index 93a7f966a56..2bae34e2d83 100644 --- a/llvm/test/MC/Disassembler/Mips/micromips-dsp/valid.txt +++ b/llvm/test/MC/Disassembler/Mips/micromips-dsp/valid.txt @@ -67,3 +67,8 @@ 0x00 0xc4 0x56 0xbc # CHECK: dpsq_sa.l.w $ac1, $4, $6 0x00 0xc4 0x64 0xbc # CHECK: dpsu.h.qbl $ac1, $4, $6 0x00 0xc4 0x74 0xbc # CHECK: dpsu.h.qbr $ac1, $4, $6 +0x00 0x62 0x08 0x25 # CHECK: muleq_s.w.phl $1, $2, $3 +0x00 0x62 0x08 0x65 # CHECK: muleq_s.w.phr $1, $2, $3 +0x00 0x62 0x08 0x95 # CHECK: muleu_s.ph.qbl $1, $2, $3 +0x00 0x62 0x08 0xd5 # CHECK: muleu_s.ph.qbr $1, $2, $3 +0x00,0x62,0x09,0x15 # CHECK: mulq_rs.ph $1, $2, $3 diff --git a/llvm/test/MC/Disassembler/Mips/micromips-dspr2/valid.txt b/llvm/test/MC/Disassembler/Mips/micromips-dspr2/valid.txt index c1d076365b8..d35f3f0019d 100644 --- a/llvm/test/MC/Disassembler/Mips/micromips-dspr2/valid.txt +++ b/llvm/test/MC/Disassembler/Mips/micromips-dspr2/valid.txt @@ -98,3 +98,13 @@ 0x00 0xc4 0x66 0xbc # CHECK: dpsqx_s.w.ph $ac1, $4, $6 0x00 0xc4 0x76 0xbc # CHECK: dpsqx_sa.w.ph $ac1, $4, $6 0x00 0xc4 0x54 0xbc # CHECK: dpsx.w.ph $ac1, $4, $6 +0x00 0x62 0x08 0x2d # CHECK: mul.ph $1, $2, $3 +0x00 0x62 0x0c 0x2d # CHECK: mul_s.ph $1, $2, $3 +0x00 0x62 0x09 0x95 # CHECK: mulq_rs.w $1, $2, $3 +0x00 0x62 0x09 0x55 # CHECK: mulq_s.ph $1, $2, $3 +0x00 0x62 0x09 0xd5 # CHECK: mulq_s.w $1, $2, $3 +0x00 0x62 0x08 0x25 # CHECK: muleq_s.w.phl $1, $2, $3 +0x00 0x62 0x08 0x65 # CHECK: muleq_s.w.phr $1, $2, $3 +0x00 0x62 0x08 0x95 # CHECK: muleu_s.ph.qbl $1, $2, $3 +0x00 0x62 0x08 0xd5 # CHECK: muleu_s.ph.qbr $1, $2, $3 +0x00,0x62,0x09,0x15 # CHECK: mulq_rs.ph $1, $2, $3 diff --git a/llvm/test/MC/Mips/micromips-dsp/valid.s b/llvm/test/MC/Mips/micromips-dsp/valid.s index fb13144b25e..a78f6c1bf21 100644 --- a/llvm/test/MC/Mips/micromips-dsp/valid.s +++ b/llvm/test/MC/Mips/micromips-dsp/valid.s @@ -68,3 +68,8 @@ dpsq_sa.l.w $ac1, $4, $6 # CHECK: dpsq_sa.l.w $ac1, $4, $6 # encoding: [0x00,0xc4,0x56,0xbc] dpsu.h.qbl $ac1, $4, $6 # CHECK: dpsu.h.qbl $ac1, $4, $6 # encoding: [0x00,0xc4,0x64,0xbc] dpsu.h.qbr $ac1, $4, $6 # CHECK: dpsu.h.qbr $ac1, $4, $6 # encoding: [0x00,0xc4,0x74,0xbc] + muleq_s.w.phl $1, $2, $3 # CHECK: muleq_s.w.phl $1, $2, $3 # encoding: [0x00,0x62,0x08,0x25] + muleq_s.w.phr $1, $2, $3 # CHECK: muleq_s.w.phr $1, $2, $3 # encoding: [0x00,0x62,0x08,0x65] + muleu_s.ph.qbl $1, $2, $3 # CHECK: muleu_s.ph.qbl $1, $2, $3 # encoding: [0x00,0x62,0x08,0x95] + muleu_s.ph.qbr $1, $2, $3 # CHECK: muleu_s.ph.qbr $1, $2, $3 # encoding: [0x00,0x62,0x08,0xd5] + mulq_rs.ph $1, $2, $3 # CHECK: mulq_rs.ph $1, $2, $3 # encoding: [0x00,0x62,0x09,0x15] diff --git a/llvm/test/MC/Mips/micromips-dspr2/valid.s b/llvm/test/MC/Mips/micromips-dspr2/valid.s index 8978c54c8ef..37949d4f561 100644 --- a/llvm/test/MC/Mips/micromips-dspr2/valid.s +++ b/llvm/test/MC/Mips/micromips-dspr2/valid.s @@ -99,3 +99,13 @@ dpsqx_s.w.ph $ac1, $4, $6 # CHECK: dpsqx_s.w.ph $ac1, $4, $6 # encoding: [0x00,0xc4,0x66,0xbc] dpsqx_sa.w.ph $ac1, $4, $6 # CHECK: dpsqx_sa.w.ph $ac1, $4, $6 # encoding: [0x00,0xc4,0x76,0xbc] dpsx.w.ph $ac1, $4, $6 # CHECK: dpsx.w.ph $ac1, $4, $6 # encoding: [0x00,0xc4,0x54,0xbc] + mul.ph $1, $2, $3 # CHECK: mul.ph $1, $2, $3 # encoding: [0x00,0x62,0x08,0x2d] + mul_s.ph $1, $2, $3 # CHECK: mul_s.ph $1, $2, $3 # encoding: [0x00,0x62,0x0c,0x2d] + mulq_rs.w $1, $2, $3 # CHECK: mulq_rs.w $1, $2, $3 # encoding: [0x00,0x62,0x09,0x95] + mulq_s.ph $1, $2, $3 # CHECK: mulq_s.ph $1, $2, $3 # encoding: [0x00,0x62,0x09,0x55] + mulq_s.w $1, $2, $3 # CHECK: mulq_s.w $1, $2, $3 # encoding: [0x00,0x62,0x09,0xd5] + muleq_s.w.phl $1, $2, $3 # CHECK: muleq_s.w.phl $1, $2, $3 # encoding: [0x00,0x62,0x08,0x25] + muleq_s.w.phr $1, $2, $3 # CHECK: muleq_s.w.phr $1, $2, $3 # encoding: [0x00,0x62,0x08,0x65] + muleu_s.ph.qbl $1, $2, $3 # CHECK: muleu_s.ph.qbl $1, $2, $3 # encoding: [0x00,0x62,0x08,0x95] + muleu_s.ph.qbr $1, $2, $3 # CHECK: muleu_s.ph.qbr $1, $2, $3 # encoding: [0x00,0x62,0x08,0xd5] + mulq_rs.ph $1, $2, $3 # CHECK: mulq_rs.ph $1, $2, $3 # encoding: [0x00,0x62,0x09,0x15] |