[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 23/30] tcg/loongarch64: Add softmmu load/store helpers, i
From: |
Richard Henderson |
Subject: |
Re: [PATCH v3 23/30] tcg/loongarch64: Add softmmu load/store helpers, implement qemu_ld/qemu_st ops |
Date: |
Thu, 23 Sep 2021 10:25:52 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
+ /* fallthrough */
+ default:
+ tcg_out_mov(s, size == MO_64, l->datalo_reg, TCG_REG_A0);
+ break;
Here in tcg_out_qemu_ld_slow_path, "size == MO_64" is "type".
+ /* TLB Hit - translate address using addend. */
+ if (TCG_TARGET_REG_BITS > TARGET_LONG_BITS) {
+ tcg_out_ext32u(s, TCG_REG_TMP0, addrl);
+ addrl = TCG_REG_TMP0;
+ }
+ tcg_out_opc_add_d(s, TCG_REG_TMP0, TCG_REG_TMP2, addrl);
Note for future optimization: Unlike RISC-V, LoongArch has indexed addressing, and we
should make use of it to eliminate this final add ...
+ if (USE_GUEST_BASE) {
+ tcg_out_opc_add_d(s, base, TCG_GUEST_BASE_REG, addr_regl);
... as well as these adds.
Compare tcg/ppc/ or tcg/sparc/, both of which always use indexed addressing (and indeed,
their reverse-endian memory ops do not have an offset form):
tcg_out_ldst_rr(s, data, addr,
(guest_base ? TCG_GUEST_BASE_REG : TCG_REG_G0),
qemu_ld_opc[memop & (MO_BSWAP | MO_SSIZE)]);
(It is not useful to compare tcg/aarch64/, which cannot represent "zero" with indexed
addressing, and so has to swap between offset and indexed addressing, depending on the
size of the guest address space and guest_base == 0.)
Oops, I've just noticed that the !CONFIG_SOFTMMU case is not zero-extending the guest
address for TARGET_LONG_BITS == 32.
r~
- [PATCH v3 14/30] tcg/loongarch64: Implement bswap{16,32,64} ops, (continued)
- [PATCH v3 14/30] tcg/loongarch64: Implement bswap{16,32,64} ops, WANG Xuerui, 2021/09/22
- [PATCH v3 12/30] tcg/loongarch64: Implement not/and/or/xor/nor/andc/orc ops, WANG Xuerui, 2021/09/22
- [PATCH v3 16/30] tcg/loongarch64: Implement shl/shr/sar/rotl/rotr ops, WANG Xuerui, 2021/09/22
- [PATCH v3 15/30] tcg/loongarch64: Implement clz/ctz ops, WANG Xuerui, 2021/09/22
- [PATCH v3 22/30] tcg/loongarch64: Implement simple load/store ops, WANG Xuerui, 2021/09/22
- [PATCH v3 25/30] tcg/loongarch64: Implement exit_tb/goto_tb, WANG Xuerui, 2021/09/22
- [PATCH v3 29/30] accel/tcg/user-exec: Implement CPU-specific signal handler for loongarch64 hosts, WANG Xuerui, 2021/09/22
- [PATCH v3 27/30] tcg/loongarch64: Register the JIT, WANG Xuerui, 2021/09/22
- [PATCH v3 23/30] tcg/loongarch64: Add softmmu load/store helpers, implement qemu_ld/qemu_st ops, WANG Xuerui, 2021/09/22
- Re: [PATCH v3 23/30] tcg/loongarch64: Add softmmu load/store helpers, implement qemu_ld/qemu_st ops,
Richard Henderson <=
- [PATCH v3 18/30] tcg/loongarch64: Implement mul/mulsh/muluh/div/divu/rem/remu ops, WANG Xuerui, 2021/09/22
- [PATCH v3 30/30] configure, meson.build: Mark support for loongarch64 hosts, WANG Xuerui, 2021/09/22
- [PATCH v3 20/30] tcg/loongarch64: Implement setcond ops, WANG Xuerui, 2021/09/22
- [PATCH v3 21/30] tcg/loongarch64: Implement tcg_out_call, WANG Xuerui, 2021/09/22
- [PATCH v3 26/30] tcg/loongarch64: Implement tcg_target_init, WANG Xuerui, 2021/09/22
- [PATCH v3 24/30] tcg/loongarch64: Implement tcg_target_qemu_prologue, WANG Xuerui, 2021/09/22
- [PATCH v3 28/30] linux-user: Add safe syscall handling for loongarch64 hosts, WANG Xuerui, 2021/09/22