Commit 9350c823 authored by Robert Sprowson's avatar Robert Sprowson

dis2 corrective actions util.c

  Line 332: Fix typo in R13_hyp table entry (was R12)
  Line 158: A missing comma meant the arch warning table was one entry too short, so any XScale media instructions would cause a NULL pointer access
actions/ARMv7
  Add missing pre-UAL forms of LDRHT LDRSBT LDRSHT STRHT, assuming they take the form [LD|ST]RccSUFFIX
  Fix decoding of banked MRS/MSR SYSm field, this is defined as m:m1, so m needs shifting up more
  Fix opcode for banked MSR, copy paste fumble
Tested using 'testbed', not tagged.
parent 98350188
......@@ -788,7 +788,8 @@ LDRHT_A1(cond,U,Rn,Rt,imm4H:imm4L,nonstandard)
COMMON
ONLY2(ARMv6T2,ARMv7);
_UNPREDICTABLE((Rt==15) || (Rn==15) || (Rn==Rt));
sprintf(params->buf,"LDRHT%s\t%s,[%s],#%s%d",condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),imm4H_imm4L);
const char *fmt = (params->opt->ual?"LDRHT%s\t%s,[%s],#%s%d":"LDR%sHT\t%s,[%s],#%s%d");
sprintf(params->buf,fmt,condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),imm4H_imm4L);
return;
}
......@@ -797,7 +798,8 @@ LDRHT_A2(cond,U,Rn,Rt,Rm,nonstandard)
COMMON
ONLY2(ARMv6T2,ARMv7);
_UNPREDICTABLE((Rt==15) || (Rn==15) || (Rn==Rt) || (Rm==15));
sprintf(params->buf,"LDRHT%s\t%s,[%s],%s%s",condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),REG(Rm));
const char *fmt = (params->opt->ual?"LDRHT%s\t%s,[%s],%s%s":"LDR%sHT\t%s,[%s],%s%s");
sprintf(params->buf,fmt,condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),REG(Rm));
return;
}
......@@ -848,7 +850,8 @@ LDRSBT_A1(cond,U,Rn,Rt,imm4H:imm4L,nonstandard)
COMMON
ONLY2(ARMv6T2,ARMv7);
_UNPREDICTABLE((Rt==15) || (Rn==15) || (Rn==Rt));
sprintf(params->buf,"LDRSBT%s\t%s,[%s],#%s%d",condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),imm4H_imm4L);
const char *fmt = (params->opt->ual?"LDRSBT%s\t%s,[%s],#%s%d":"LDR%sSBT\t%s,[%s],#%s%d");
sprintf(params->buf,fmt,condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),imm4H_imm4L);
return;
}
......@@ -857,7 +860,8 @@ LDRSBT_A2(cond,U,Rn,Rt,Rm,nonstandard)
COMMON
ONLY2(ARMv6T2,ARMv7);
_UNPREDICTABLE((Rt==15) || (Rn==15) || (Rn==Rt) || (Rm==15));
sprintf(params->buf,"LDRSBT%s\t%s,[%s],%s%s",condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),REG(Rm));
const char *fmt = (params->opt->ual?"LDRSBT%s\t%s,[%s],%s%s":"LDR%sSBT\t%s,[%s],%s%s");
sprintf(params->buf,fmt,condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),REG(Rm));
return;
}
......@@ -908,7 +912,8 @@ LDRSHT_A1(cond,U,Rn,Rt,imm4H:imm4L,nonstandard)
COMMON
ONLY2(ARMv6T2,ARMv7);
_UNPREDICTABLE((Rt==15) || (Rn==15) || (Rn==Rt));
sprintf(params->buf,"LDRSHT%s\t%s,[%s],#%s%d",condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),imm4H_imm4L);
const char *fmt = (params->opt->ual?"LDRSHT%s\t%s,[%s],#%s%d":"LDR%sSHT\t%s,[%s],#%s%d");
sprintf(params->buf,fmt,condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),imm4H_imm4L);
return;
}
......@@ -917,7 +922,8 @@ LDRSHT_A2(cond,U,Rn,Rt,Rm,nonstandard)
COMMON
ONLY2(ARMv6T2,ARMv7);
_UNPREDICTABLE((Rt==15) || (Rn==15) || (Rn==Rt) || (Rm==15));
sprintf(params->buf,"LDRSHT%s\t%s,[%s],%s%s",condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),REG(Rm));
const char *fmt = (params->opt->ual?"LDRSHT%s\t%s,[%s],%s%s":"LDR%sSHT\t%s,[%s],%s%s");
sprintf(params->buf,fmt,condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),REG(Rm));
return;
}
......@@ -2197,7 +2203,8 @@ STRHT_A1(cond,U,Rn,Rt,imm4H:imm4L,nonstandard)
COMMON
ONLY2(ARMv6T2,ARMv7);
_UNPREDICTABLE((Rt==15) || (Rn==15) || (Rn==Rt));
sprintf(params->buf,"STRHT%s\t%s,[%s],#%s%d",condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),imm4H_imm4L);
const char *fmt = (params->opt->ual?"STRHT%s\t%s,[%s],#%s%d":"STR%sHT\t%s,[%s],#%s%d");
sprintf(params->buf,fmt,condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),imm4H_imm4L);
return;
}
......@@ -2206,7 +2213,8 @@ STRHT_A2(cond,U,Rn,Rt,Rm,nonstandard)
COMMON
ONLY2(ARMv6T2,ARMv7);
_UNPREDICTABLE((Rt==15) || (Rn==15) || (Rn==Rt) || (Rm==15));
sprintf(params->buf,"STRHT%s\t%s,[%s],%s%s",condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),REG(Rm));
const char *fmt = (params->opt->ual?"STRHT%s\t%s,[%s],%s%s":"STR%sHT\t%s,[%s],%s%s");
sprintf(params->buf,fmt,condition(JUSTPARAMS,cond),REG(Rt),REG(Rn),(U?"":"-"),REG(Rm));
return;
}
......@@ -2841,7 +2849,7 @@ MRS_banked_A1(cond,R,m1,Rd,m,nonstandard)
ONLY1(ARMv7VE);
_UNPREDICTABLE(Rd==15);
sprintf(params->buf,"MRS%s\t%s,",condition(JUSTPARAMS,cond),REG(Rd));
dobankedmsr(JUSTPARAMS,(m<<1)|m1,R);
dobankedmsr(JUSTPARAMS,(m<<4)|m1,R);
return;
}
......@@ -2858,8 +2866,8 @@ MSR_banked_A1(cond,R,m1,Rn,m,nonstandard)
COMMON
ONLY1(ARMv7VE);
_UNPREDICTABLE(Rn==15);
sprintf(params->buf,"MRS%s\t",condition(JUSTPARAMS,cond));
dobankedmsr(JUSTPARAMS,(m<<1)|m1,R);
sprintf(params->buf,"MSR%s\t",condition(JUSTPARAMS,cond));
dobankedmsr(JUSTPARAMS,(m<<4)|m1,R);
scatf(params->buf,",%s",REG(Rn));
return;
}
......
......@@ -152,7 +152,7 @@ const char *archwarnings[ARCH_MAX] =
"ASIMD",
"ASIMD half-precision",
"ASIMD FP required",
"ASIMDv2 FP or later"
"ASIMDv2 FP or later",
"FPA",
"XScale DSP instruction",
};
......@@ -326,7 +326,7 @@ void dobankedmsr(JUSTPARAMDECL,uint32_t SYSm,uint32_t R)
{8,USR32},{9,USR32},{10,USR32},{11,USR32},{12,USR32},{13,USR32},{14,USR32},{0,0},
{8,FIQ32},{9,FIQ32},{10,FIQ32},{11,FIQ32},{12,FIQ32},{13,FIQ32},{14,FIQ32},{0,0},
{14,IRQ32},{13,IRQ32},{14,SVC32},{13,SVC32},{14,ABT32},{13,ABT32},{14,UND32},{13,UND32},
{0,0},{0,0},{0,0},{0,0},{14,MON32},{13,MON32},{14,HYP32},{12,HYP32},
{0,0},{0,0},{0,0},{0,0},{14,MON32},{13,MON32},{14,HYP32},{13,HYP32},
};
reg = REG(enc[SYSm][0]);
mode = enc[SYSm][1];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment