Hi, Richard
On 2022/4/26 上午6:55, Richard Henderson wrote:
On 4/25/22 02:10, Xiaojuan Yang wrote:
+static void output_r_csr(DisasContext *ctx, arg_r_csr *a,
+ const char *mnemonic)
+{
+ output(ctx, mnemonic, "r%d, %d # %s", a->rd, a->csr,
csr_names[a->csr]);
+}
+
+static void output_rr_csr(DisasContext *ctx, arg_rr_csr *a,
+ const char *mnemonic)
+{
+ output(ctx, mnemonic, "r%d, r%d, %d # %s",
+ a->rd, a->rj, a->csr, csr_names[a->csr]);
Need to check for csr not in csr_names.
I will re-used get_csr() to check csr,
like this:
if (get_csr() == NULL)
{
printf("Undefined CSR.\n");
} else {
printf(" %s\n", csr_names[a->csr]);
}
+ CSR_OFF_FLAGS(CPUID, CSRFL_READONLY),
You've dropped the special case from the previous version. Why?
Hmm, I readly lost this special case, I will correct it on v3.
like this:
CSR_OFF_FUNCS(CPUID, CSRFL_READONLY, gen_helper_csrrd_cpuid, NULL),
target_ulong helper_csrrd_cpuid(CPULoongArchState *env)
{
return (env_cpu(env))->cpu_index;
}
Thanks.
Xiaojuan