Skip to content

Commit

Permalink
tcg: Constify TCGLabelQemuLdst.raddr
Browse files Browse the repository at this point in the history
Now that all native tcg hosts support splitwx,
make this pointer const.

Reviewed-by: Joelle van Dyne <j@getutm.app>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Jan 7, 2021
1 parent c8bc116 commit e5e2e4c
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 15 deletions.
3 changes: 1 addition & 2 deletions tcg/aarch64/tcg-target.c.inc
Expand Up @@ -1636,8 +1636,7 @@ static void add_qemu_ldst_label(TCGContext *s, bool is_ld, TCGMemOpIdx oi,
label->type = ext;
label->datalo_reg = data_reg;
label->addrlo_reg = addr_reg;
/* TODO: Cast goes away when all hosts converted */
label->raddr = (void *)tcg_splitwx_to_rx(raddr);
label->raddr = tcg_splitwx_to_rx(raddr);
label->label_ptr[0] = label_ptr;
}

Expand Down
3 changes: 1 addition & 2 deletions tcg/arm/tcg-target.c.inc
Expand Up @@ -1340,8 +1340,7 @@ static void add_qemu_ldst_label(TCGContext *s, bool is_ld, TCGMemOpIdx oi,
label->datahi_reg = datahi;
label->addrlo_reg = addrlo;
label->addrhi_reg = addrhi;
/* TODO: Cast goes away when all hosts converted */
label->raddr = (void *)tcg_splitwx_to_rx(raddr);
label->raddr = tcg_splitwx_to_rx(raddr);
label->label_ptr[0] = label_ptr;
}

Expand Down
3 changes: 1 addition & 2 deletions tcg/i386/tcg-target.c.inc
Expand Up @@ -1795,8 +1795,7 @@ static void add_qemu_ldst_label(TCGContext *s, bool is_ld, bool is_64,
label->datahi_reg = datahi;
label->addrlo_reg = addrlo;
label->addrhi_reg = addrhi;
/* TODO: Cast goes away when all hosts converted */
label->raddr = (void *)tcg_splitwx_to_rx(raddr);
label->raddr = tcg_splitwx_to_rx(raddr);
label->label_ptr[0] = label_ptr[0];
if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) {
label->label_ptr[1] = label_ptr[1];
Expand Down
3 changes: 1 addition & 2 deletions tcg/mips/tcg-target.c.inc
Expand Up @@ -1283,8 +1283,7 @@ static void add_qemu_ldst_label(TCGContext *s, int is_ld, TCGMemOpIdx oi,
label->datahi_reg = datahi;
label->addrlo_reg = addrlo;
label->addrhi_reg = addrhi;
/* TODO: Cast goes away when all hosts converted */
label->raddr = (void *)tcg_splitwx_to_rx(raddr);
label->raddr = tcg_splitwx_to_rx(raddr);
label->label_ptr[0] = label_ptr[0];
if (TCG_TARGET_REG_BITS < TARGET_LONG_BITS) {
label->label_ptr[1] = label_ptr[1];
Expand Down
3 changes: 1 addition & 2 deletions tcg/ppc/tcg-target.c.inc
Expand Up @@ -2001,8 +2001,7 @@ static void add_qemu_ldst_label(TCGContext *s, bool is_ld, TCGMemOpIdx oi,
label->datahi_reg = datahi_reg;
label->addrlo_reg = addrlo_reg;
label->addrhi_reg = addrhi_reg;
/* TODO: Cast goes away when all hosts converted */
label->raddr = (void *)tcg_splitwx_to_rx(raddr);
label->raddr = tcg_splitwx_to_rx(raddr);
label->label_ptr[0] = lptr;
}

Expand Down
3 changes: 1 addition & 2 deletions tcg/riscv/tcg-target.c.inc
Expand Up @@ -996,8 +996,7 @@ static void add_qemu_ldst_label(TCGContext *s, int is_ld, TCGMemOpIdx oi,
label->datahi_reg = datahi;
label->addrlo_reg = addrlo;
label->addrhi_reg = addrhi;
/* TODO: Cast goes away when all hosts converted */
label->raddr = (void *)tcg_splitwx_to_rx(raddr);
label->raddr = tcg_splitwx_to_rx(raddr);
label->label_ptr[0] = label_ptr[0];
}

Expand Down
3 changes: 1 addition & 2 deletions tcg/s390/tcg-target.c.inc
Expand Up @@ -1587,8 +1587,7 @@ static void add_qemu_ldst_label(TCGContext *s, bool is_ld, TCGMemOpIdx oi,
label->oi = oi;
label->datalo_reg = data;
label->addrlo_reg = addr;
/* TODO: Cast goes away when all hosts converted */
label->raddr = (void *)tcg_splitwx_to_rx(raddr);
label->raddr = tcg_splitwx_to_rx(raddr);
label->label_ptr[0] = label_ptr;
}

Expand Down
2 changes: 1 addition & 1 deletion tcg/tcg-ldst.c.inc
Expand Up @@ -28,7 +28,7 @@ typedef struct TCGLabelQemuLdst {
TCGReg addrhi_reg; /* reg index for high word of guest virtual addr */
TCGReg datalo_reg; /* reg index for low word to be loaded or stored */
TCGReg datahi_reg; /* reg index for high word to be loaded or stored */
tcg_insn_unit *raddr; /* gen code addr of the next IR of qemu_ld/st IR */
const tcg_insn_unit *raddr; /* addr of the next IR of qemu_ld/st IR */
tcg_insn_unit *label_ptr[2]; /* label pointers to be updated */
QSIMPLEQ_ENTRY(TCGLabelQemuLdst) next;
} TCGLabelQemuLdst;
Expand Down

0 comments on commit e5e2e4c

Please sign in to comment.