putLO(mkWidenFrom32(ty, unop(Iop_64to32, mkexpr(t5)), True));
} else {
if ( (1 <= ac) && ( 3 >= ac) ) {
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
/* If DSP is present -> DSP ASE MADD */
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
putLO(mkWidenFrom32(ty, unop(Iop_64to32, mkexpr(t5)), True));
} else {
if ( (1 <= ac) && ( 3 >= ac) ) {
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
/* If DSP is present -> DSP ASE MADDU */
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
putLO(mkWidenFrom32(ty, unop(Iop_64to32, mkexpr(t5)), True));
} else {
if ( (1 <= ac) && ( 3 >= ac) ) {
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
/* If DSP is present -> DSP ASE MSUB */
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
putLO(mkWidenFrom32(ty, unop(Iop_64to32, mkexpr(t5)), True));
} else {
if ( (1 <= ac) && ( 3 >= ac) ) {
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
/* If DSP is present -> DSP ASE MSUBU */
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
case 0xA: /* LX */
case 0xC: /* INSV */
case 0x38: { /* EXTR.W */
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
goto decode_failure_dsp;
case 0xC: /* SUBU_S.PH */
case 0xD: /* ADDU_S.PH */
case 0x1E: { /* MULQ_S.PH */
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP2P)) {
+ if (VEX_MIPS_PROC_DSP2(archinfo->hwcaps)) {
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
goto decode_failure_dsp;
break;
}
default: {
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
goto decode_failure_dsp;
case 0x0D: /* PRECR.QB.PH */
case 0x1E: /* PRECR_SRA.PH.W */
case 0x1F: { /* PRECR_SRA_R.PH.W */
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP2P)) {
+ if (VEX_MIPS_PROC_DSP2(archinfo->hwcaps)) {
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
goto decode_failure_dsp;
break;
}
default: {
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
goto decode_failure_dsp;
case 0x12: { /* ABSQ_S.PH */
switch(sa){
case 0x1: { /* ABSQ_S.QB */
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP2P)) {
+ if (VEX_MIPS_PROC_DSP2(archinfo->hwcaps)) {
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
goto decode_failure_dsp;
break;
}
default: {
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
goto decode_failure_dsp;
case 0x07: /* SHRAV_R.QB */
case 0x19: /* SHLR.PH */
case 0x1B: { /* SHLRV.PH */
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP2P)) {
+ if (VEX_MIPS_PROC_DSP2(archinfo->hwcaps)) {
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
goto decode_failure_dsp;
break;
}
default: {
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
goto decode_failure_dsp;
case 0x1B: /* DPSQX_SA.W.PH */
case 0x9: /* DPSX.W.PH */
case 0x2: { /* MULSA.W.PH */
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP2P)) {
+ if (VEX_MIPS_PROC_DSP2(archinfo->hwcaps)) {
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
goto decode_failure_dsp;
break;
}
default: {
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
goto decode_failure_dsp;
}
case 0x18: /* ADDUH.QB/MUL.PH */
case 0x31: { /* APPEND */
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP2P)) {
+ if (VEX_MIPS_PROC_DSP2(archinfo->hwcaps)) {
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
goto decode_failure_dsp;
break; /* Special3 */
case 0x3B:
- if (0x3B == function && (archinfo->hwcaps & VEX_PRID_COMP_BROADCOM)) {
+ if (0x3B == function &&
+ (VEX_MIPS_COMP_ID(archinfo->hwcaps) == VEX_PRID_COMP_BROADCOM)) {
/*RDHWR*/
DIP("rdhwr r%d, r%d", rt, rd);
if (rd == 29) {
case 0x18: { /* MULT */
if ( (1 <= ac) && ( 3 >= ac) ) {
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
/* If DSP is present -> DSP ASE MULT */
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
}
case 0x19: { /* MULTU */
if ( (1 <= ac) && ( 3 >= ac) ) {
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
/* If DSP is present -> DSP ASE MULTU */
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
break;
case 0x10: { /* MFHI */
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
/* If DSP is present -> DSP ASE MFHI */
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
}
case 0x11: { /* MTHI */
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
/* If DSP is present -> DSP ASE MTHI */
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
}
case 0x12: { /* MFLO */
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
/* If DSP is present -> DSP ASE MFLO */
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
}
case 0x13: { /* MTLO */
- if ((archinfo->hwcaps & VEX_MIPS_ASE_DSP)) {
+ if (VEX_MIPS_PROC_DSP(archinfo->hwcaps)) {
/* If DSP is present -> DSP ASE MTLO */
UInt retVal = disDSPInstr_MIPS_WRK ( cins );
if (0 != retVal ) {
#define VEX_PRID_COMP_MIPS 0x00010000
#define VEX_PRID_COMP_BROADCOM 0x00020000
-#define VEX_PRID_COMP_NETLOGIC 0x000c0000
+#define VEX_PRID_COMP_NETLOGIC 0x000C0000
+#define VEX_PRID_COMP_CAVIUM 0x000D0000
-/* MIPS additional capabilities */
-#define VEX_MIPS_ASE_DSP 0x00000010 /* Signal Processing ASE */
-#define VEX_MIPS_ASE_DSP2P 0x00000040 /* Signal Processing ASE Rev 2 */
+/*
+ * These are the PRID's for when 23:16 == PRID_COMP_MIPS
+ */
+#define VEX_PRID_IMP_34K 0x9500
+#define VEX_PRID_IMP_74K 0x9700
+
+/* Get MIPS Company ID from HWCAPS */
+#define VEX_MIPS_COMP_ID(x) ((x) & 0x00FF0000)
+/* Get MIPS Processor ID from HWCAPS */
+#define VEX_MIPS_PROC_ID(x) ((x) & 0x0000FFFF)
+/* Check if the processor supports DSP ASE Rev 2. */
+#define VEX_MIPS_PROC_DSP2(x) ((VEX_MIPS_COMP_ID(x) == VEX_PRID_COMP_MIPS) && \
+ (VEX_MIPS_PROC_ID(x) == VEX_PRID_IMP_74K))
+/* Check if the processor supports DSP ASE Rev 1. */
+#define VEX_MIPS_PROC_DSP(x) (VEX_MIPS_PROC_DSP2(x) || \
+ ((VEX_MIPS_COMP_ID(x) == VEX_PRID_COMP_MIPS) && \
+ (VEX_MIPS_PROC_ID(x) == VEX_PRID_IMP_34K)))
/* These return statically allocated strings. */