tcg/s390x: Use tcg_use_softmmu

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2023-10-01 21:16:32 +00:00
parent 4944d35910
commit 2e486b5901

View file

@ -46,9 +46,7 @@
/* A scratch register that may be be used throughout the backend. */ /* A scratch register that may be be used throughout the backend. */
#define TCG_TMP0 TCG_REG_R1 #define TCG_TMP0 TCG_REG_R1
#ifndef CONFIG_SOFTMMU
#define TCG_GUEST_BASE_REG TCG_REG_R13 #define TCG_GUEST_BASE_REG TCG_REG_R13
#endif
/* All of the following instructions are prefixed with their instruction /* All of the following instructions are prefixed with their instruction
format, and are defined as 8- or 16-bit quantities, even when the two format, and are defined as 8- or 16-bit quantities, even when the two
@ -1768,7 +1766,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h,
h->aa = atom_and_align_for_opc(s, opc, MO_ATOM_IFALIGN, s_bits == MO_128); h->aa = atom_and_align_for_opc(s, opc, MO_ATOM_IFALIGN, s_bits == MO_128);
a_mask = (1 << h->aa.align) - 1; a_mask = (1 << h->aa.align) - 1;
#ifdef CONFIG_SOFTMMU if (tcg_use_softmmu) {
unsigned s_mask = (1 << s_bits) - 1; unsigned s_mask = (1 << s_bits) - 1;
int mem_index = get_mmuidx(oi); int mem_index = get_mmuidx(oi);
int fast_off = tlb_mask_table_ofs(s, mem_index); int fast_off = tlb_mask_table_ofs(s, mem_index);
@ -1789,9 +1787,10 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h,
tcg_out_insn(s, RXY, AG, TCG_TMP0, TCG_AREG0, TCG_REG_NONE, table_off); tcg_out_insn(s, RXY, AG, TCG_TMP0, TCG_AREG0, TCG_REG_NONE, table_off);
/* /*
* For aligned accesses, we check the first byte and include the alignment * For aligned accesses, we check the first byte and include the
* bits within the address. For unaligned access, we check that we don't * alignment bits within the address. For unaligned access, we
* cross pages using the address of the last byte of the access. * check that we don't cross pages using the address of the last
* byte of the access.
*/ */
a_off = (a_mask >= s_mask ? 0 : s_mask - a_mask); a_off = (a_mask >= s_mask ? 0 : s_mask - a_mask);
tlb_mask = (uint64_t)s->page_mask | a_mask; tlb_mask = (uint64_t)s->page_mask | a_mask;
@ -1828,7 +1827,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h,
h->base = addr_reg; h->base = addr_reg;
} }
h->disp = 0; h->disp = 0;
#else } else {
if (a_mask) { if (a_mask) {
ldst = new_ldst_label(s); ldst = new_ldst_label(s);
ldst->is_ld = is_ld; ldst->is_ld = is_ld;
@ -1855,7 +1854,7 @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h,
h->index = TCG_GUEST_BASE_REG; h->index = TCG_GUEST_BASE_REG;
h->disp = 0; h->disp = 0;
} }
#endif }
return ldst; return ldst;
} }
@ -3453,12 +3452,10 @@ static void tcg_target_qemu_prologue(TCGContext *s)
TCG_STATIC_CALL_ARGS_SIZE + TCG_TARGET_CALL_STACK_OFFSET, TCG_STATIC_CALL_ARGS_SIZE + TCG_TARGET_CALL_STACK_OFFSET,
CPU_TEMP_BUF_NLONGS * sizeof(long)); CPU_TEMP_BUF_NLONGS * sizeof(long));
#ifndef CONFIG_SOFTMMU if (!tcg_use_softmmu && guest_base >= 0x80000) {
if (guest_base >= 0x80000) {
tcg_out_movi(s, TCG_TYPE_PTR, TCG_GUEST_BASE_REG, guest_base); tcg_out_movi(s, TCG_TYPE_PTR, TCG_GUEST_BASE_REG, guest_base);
tcg_regset_set_reg(s->reserved_regs, TCG_GUEST_BASE_REG); tcg_regset_set_reg(s->reserved_regs, TCG_GUEST_BASE_REG);
} }
#endif
tcg_out_mov(s, TCG_TYPE_PTR, TCG_AREG0, tcg_target_call_iarg_regs[0]); tcg_out_mov(s, TCG_TYPE_PTR, TCG_AREG0, tcg_target_call_iarg_regs[0]);