1 | With a couple of linux-user and target/sparc patches thrown in for good measure. | 1 | v2: Fix target/loongarch printf formats for vaddr |
---|---|---|---|
2 | Include two more reviewed patches. | ||
3 | |||
2 | 4 | ||
3 | r~ | 5 | r~ |
4 | |||
5 | |||
6 | The following changes since commit 495de0fd82d8bb2d7035f82d9869cfeb48de2f9e: | ||
7 | |||
8 | Merge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into staging (2025-02-14 08:19:05 -0500) | ||
9 | |||
10 | are available in the Git repository at: | ||
11 | |||
12 | https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20250215 | ||
13 | |||
14 | for you to fetch changes up to 2132751069134114814c7e1609e9cf644f077aad: | ||
15 | |||
16 | target/sparc: fake UltraSPARC T1 PCR and PIC registers (2025-02-15 12:04:13 -0800) | ||
17 | |||
18 | ---------------------------------------------------------------- | ||
19 | tcg: Remove last traces of TCG_TARGET_NEED_POOL_LABELS | ||
20 | tcg: Cleanups after disallowing 64-on-32 | ||
21 | tcg: Introduce constraint for zero register | ||
22 | linux-user: Move TARGET_SA_RESTORER out of generic/signal.h | ||
23 | linux-user: Fix alignment when unmapping excess reservation | ||
24 | target/sparc: Fix register selection for all F*TOx and FxTO* instructions | ||
25 | target/sparc: Fix gdbstub incorrectly handling registers f32-f62 | ||
26 | target/sparc: fake UltraSPARC T1 PCR and PIC registers | ||
27 | |||
28 | ---------------------------------------------------------------- | ||
29 | Andreas Schwab (1): | ||
30 | linux-user: Move TARGET_SA_RESTORER out of generic/signal.h | ||
31 | |||
32 | Artyom Tarasenko (1): | ||
33 | target/sparc: fake UltraSPARC T1 PCR and PIC registers | ||
34 | |||
35 | Fabiano Rosas (1): | ||
36 | elfload: Fix alignment when unmapping excess reservation | ||
37 | |||
38 | Mikael Szreder (2): | ||
39 | target/sparc: Fix register selection for all F*TOx and FxTO* instructions | ||
40 | target/sparc: Fix gdbstub incorrectly handling registers f32-f62 | ||
41 | |||
42 | Richard Henderson (19): | ||
43 | tcg: Remove last traces of TCG_TARGET_NEED_POOL_LABELS | ||
44 | tcg: Remove TCG_OVERSIZED_GUEST | ||
45 | tcg: Drop support for two address registers in gen_ldst | ||
46 | tcg: Merge INDEX_op_qemu_*_{a32,a64}_* | ||
47 | tcg/arm: Drop addrhi from prepare_host_addr | ||
48 | tcg/i386: Drop addrhi from prepare_host_addr | ||
49 | tcg/mips: Drop addrhi from prepare_host_addr | ||
50 | tcg/ppc: Drop addrhi from prepare_host_addr | ||
51 | tcg: Replace addr{lo,hi}_reg with addr_reg in TCGLabelQemuLdst | ||
52 | plugins: Fix qemu_plugin_read_memory_vaddr parameters | ||
53 | accel/tcg: Fix tlb_set_page_with_attrs, tlb_set_page | ||
54 | include/exec: Change vaddr to uintptr_t | ||
55 | include/exec: Use uintptr_t in CPUTLBEntry | ||
56 | tcg: Introduce the 'z' constraint for a hardware zero register | ||
57 | tcg/aarch64: Use 'z' constraint | ||
58 | tcg/loongarch64: Use 'z' constraint | ||
59 | tcg/mips: Use 'z' constraint | ||
60 | tcg/riscv: Use 'z' constraint | ||
61 | tcg/sparc64: Use 'z' constraint | ||
62 | |||
63 | include/exec/tlb-common.h | 10 +- | ||
64 | include/exec/vaddr.h | 16 ++-- | ||
65 | include/qemu/atomic.h | 18 +--- | ||
66 | include/tcg/oversized-guest.h | 23 ----- | ||
67 | include/tcg/tcg-opc.h | 28 ++---- | ||
68 | include/tcg/tcg.h | 3 +- | ||
69 | linux-user/aarch64/target_signal.h | 2 + | ||
70 | linux-user/arm/target_signal.h | 2 + | ||
71 | linux-user/generic/signal.h | 1 - | ||
72 | linux-user/i386/target_signal.h | 2 + | ||
73 | linux-user/m68k/target_signal.h | 1 + | ||
74 | linux-user/microblaze/target_signal.h | 2 + | ||
75 | linux-user/ppc/target_signal.h | 2 + | ||
76 | linux-user/s390x/target_signal.h | 2 + | ||
77 | linux-user/sh4/target_signal.h | 2 + | ||
78 | linux-user/x86_64/target_signal.h | 2 + | ||
79 | linux-user/xtensa/target_signal.h | 2 + | ||
80 | tcg/aarch64/tcg-target-con-set.h | 12 +-- | ||
81 | tcg/aarch64/tcg-target.h | 2 + | ||
82 | tcg/loongarch64/tcg-target-con-set.h | 15 ++- | ||
83 | tcg/loongarch64/tcg-target-con-str.h | 1 - | ||
84 | tcg/loongarch64/tcg-target.h | 2 + | ||
85 | tcg/mips/tcg-target-con-set.h | 26 +++--- | ||
86 | tcg/mips/tcg-target-con-str.h | 1 - | ||
87 | tcg/mips/tcg-target.h | 2 + | ||
88 | tcg/riscv/tcg-target-con-set.h | 10 +- | ||
89 | tcg/riscv/tcg-target-con-str.h | 1 - | ||
90 | tcg/riscv/tcg-target.h | 2 + | ||
91 | tcg/sparc64/tcg-target-con-set.h | 12 +-- | ||
92 | tcg/sparc64/tcg-target-con-str.h | 1 - | ||
93 | tcg/sparc64/tcg-target.h | 3 +- | ||
94 | tcg/tci/tcg-target.h | 1 - | ||
95 | accel/tcg/cputlb.c | 32 ++----- | ||
96 | accel/tcg/tcg-all.c | 9 +- | ||
97 | linux-user/elfload.c | 4 +- | ||
98 | plugins/api.c | 2 +- | ||
99 | target/arm/ptw.c | 34 ------- | ||
100 | target/riscv/cpu_helper.c | 13 +-- | ||
101 | target/sparc/gdbstub.c | 18 +++- | ||
102 | target/sparc/translate.c | 19 ++++ | ||
103 | tcg/optimize.c | 21 ++--- | ||
104 | tcg/tcg-op-ldst.c | 103 +++++---------------- | ||
105 | tcg/tcg.c | 97 +++++++++---------- | ||
106 | tcg/tci.c | 119 +++++------------------- | ||
107 | docs/devel/multi-thread-tcg.rst | 1 - | ||
108 | docs/devel/tcg-ops.rst | 4 +- | ||
109 | target/sparc/insns.decode | 19 ++-- | ||
110 | tcg/aarch64/tcg-target.c.inc | 86 +++++++---------- | ||
111 | tcg/arm/tcg-target.c.inc | 104 ++++++--------------- | ||
112 | tcg/i386/tcg-target.c.inc | 125 +++++++------------------ | ||
113 | tcg/loongarch64/tcg-target.c.inc | 72 ++++++--------- | ||
114 | tcg/mips/tcg-target.c.inc | 169 +++++++++++----------------------- | ||
115 | tcg/ppc/tcg-target.c.inc | 164 ++++++++------------------------- | ||
116 | tcg/riscv/tcg-target.c.inc | 56 +++++------ | ||
117 | tcg/s390x/tcg-target.c.inc | 40 +++----- | ||
118 | tcg/sparc64/tcg-target.c.inc | 45 ++++----- | ||
119 | tcg/tci/tcg-target.c.inc | 60 +++--------- | ||
120 | 57 files changed, 536 insertions(+), 1089 deletions(-) | ||
121 | delete mode 100644 include/tcg/oversized-guest.h | diff view generated by jsdifflib |
1 | These should have been removed with the rest. There are | 1 | These should have been removed with the rest. There are |
---|---|---|---|
2 | a couple of hosts which can emit guest_base into the | 2 | a couple of hosts which can emit guest_base into the |
3 | constant pool: aarch64, mips64, ppc64, riscv64. | 3 | constant pool: aarch64, mips64, ppc64, riscv64. |
4 | 4 | ||
5 | Fixes: a417ef835058 ("tcg: Remove TCG_TARGET_NEED_LDST_LABELS and TCG_TARGET_NEED_POOL_LABELS") | 5 | Fixes: a417ef835058 ("tcg: Remove TCG_TARGET_NEED_LDST_LABELS and TCG_TARGET_NEED_POOL_LABELS") |
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
7 | --- | 8 | --- |
8 | tcg/tci/tcg-target.h | 1 - | 9 | tcg/tci/tcg-target.h | 1 - |
9 | tcg/tcg.c | 4 ---- | 10 | tcg/tcg.c | 4 ---- |
10 | 2 files changed, 5 deletions(-) | 11 | 2 files changed, 5 deletions(-) |
11 | 12 | ||
... | ... | ||
46 | 47 | ||
47 | prologue_size = tcg_current_code_size(s); | 48 | prologue_size = tcg_current_code_size(s); |
48 | perf_report_prologue(s->code_gen_ptr, prologue_size); | 49 | perf_report_prologue(s->code_gen_ptr, prologue_size); |
49 | -- | 50 | -- |
50 | 2.43.0 | 51 | 2.43.0 |
52 | |||
53 | diff view generated by jsdifflib |
1 | This is now prohibited in configuration. | 1 | This is now prohibited in configuration. |
---|---|---|---|
2 | 2 | ||
3 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | 3 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> |
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
5 | --- | 5 | --- |
6 | include/qemu/atomic.h | 18 +++-------------- | 6 | include/qemu/atomic.h | 18 +++-------------- |
7 | include/tcg/oversized-guest.h | 23 ---------------------- | 7 | include/tcg/oversized-guest.h | 23 ---------------------- |
8 | accel/tcg/cputlb.c | 7 ------- | 8 | accel/tcg/cputlb.c | 7 ------- |
9 | accel/tcg/tcg-all.c | 9 ++++----- | 9 | accel/tcg/tcg-all.c | 9 ++++----- |
10 | target/arm/ptw.c | 34 --------------------------------- | 10 | target/arm/ptw.c | 34 --------------------------------- |
11 | target/riscv/cpu_helper.c | 13 +------------ | 11 | target/riscv/cpu_helper.c | 13 +------------ |
12 | docs/devel/multi-thread-tcg.rst | 1 - | 12 | docs/devel/multi-thread-tcg.rst | 1 - |
13 | 7 files changed, 8 insertions(+), 97 deletions(-) | 13 | 7 files changed, 8 insertions(+), 97 deletions(-) |
14 | delete mode 100644 include/tcg/oversized-guest.h | 14 | delete mode 100644 include/tcg/oversized-guest.h |
15 | 15 | ||
16 | diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h | 16 | diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h |
17 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/include/qemu/atomic.h | 18 | --- a/include/qemu/atomic.h |
19 | +++ b/include/qemu/atomic.h | 19 | +++ b/include/qemu/atomic.h |
20 | @@ -XXX,XX +XXX,XX @@ | 20 | @@ -XXX,XX +XXX,XX @@ |
21 | */ | 21 | */ |
22 | #define signal_barrier() __atomic_signal_fence(__ATOMIC_SEQ_CST) | 22 | #define signal_barrier() __atomic_signal_fence(__ATOMIC_SEQ_CST) |
23 | 23 | ||
24 | -/* Sanity check that the size of an atomic operation isn't "overly large". | 24 | -/* Sanity check that the size of an atomic operation isn't "overly large". |
25 | +/* | 25 | +/* |
26 | + * Sanity check that the size of an atomic operation isn't "overly large". | 26 | + * Sanity check that the size of an atomic operation isn't "overly large". |
27 | * Despite the fact that e.g. i686 has 64-bit atomic operations, we do not | 27 | * Despite the fact that e.g. i686 has 64-bit atomic operations, we do not |
28 | * want to use them because we ought not need them, and this lets us do a | 28 | * want to use them because we ought not need them, and this lets us do a |
29 | * bit of sanity checking that other 32-bit hosts might build. | 29 | * bit of sanity checking that other 32-bit hosts might build. |
30 | - * | 30 | - * |
31 | - * That said, we have a problem on 64-bit ILP32 hosts in that in order to | 31 | - * That said, we have a problem on 64-bit ILP32 hosts in that in order to |
32 | - * sync with TCG_OVERSIZED_GUEST, this must match TCG_TARGET_REG_BITS. | 32 | - * sync with TCG_OVERSIZED_GUEST, this must match TCG_TARGET_REG_BITS. |
33 | - * We'd prefer not want to pull in everything else TCG related, so handle | 33 | - * We'd prefer not want to pull in everything else TCG related, so handle |
34 | - * those few cases by hand. | 34 | - * those few cases by hand. |
35 | - * | 35 | - * |
36 | - * Note that x32 is fully detected with __x86_64__ + _ILP32, and that for | 36 | - * Note that x32 is fully detected with __x86_64__ + _ILP32, and that for |
37 | - * Sparc we always force the use of sparcv9 in configure. MIPS n32 (ILP32) & | 37 | - * Sparc we always force the use of sparcv9 in configure. MIPS n32 (ILP32) & |
38 | - * n64 (LP64) ABIs are both detected using __mips64. | 38 | - * n64 (LP64) ABIs are both detected using __mips64. |
39 | */ | 39 | */ |
40 | -#if defined(__x86_64__) || defined(__sparc__) || defined(__mips64) | 40 | -#if defined(__x86_64__) || defined(__sparc__) || defined(__mips64) |
41 | -# define ATOMIC_REG_SIZE 8 | 41 | -# define ATOMIC_REG_SIZE 8 |
42 | -#else | 42 | -#else |
43 | -# define ATOMIC_REG_SIZE sizeof(void *) | 43 | -# define ATOMIC_REG_SIZE sizeof(void *) |
44 | -#endif | 44 | -#endif |
45 | +#define ATOMIC_REG_SIZE sizeof(void *) | 45 | +#define ATOMIC_REG_SIZE sizeof(void *) |
46 | 46 | ||
47 | /* Weak atomic operations prevent the compiler moving other | 47 | /* Weak atomic operations prevent the compiler moving other |
48 | * loads/stores past the atomic operation load/store. However there is | 48 | * loads/stores past the atomic operation load/store. However there is |
49 | diff --git a/include/tcg/oversized-guest.h b/include/tcg/oversized-guest.h | 49 | diff --git a/include/tcg/oversized-guest.h b/include/tcg/oversized-guest.h |
50 | deleted file mode 100644 | 50 | deleted file mode 100644 |
51 | index XXXXXXX..XXXXXXX | 51 | index XXXXXXX..XXXXXXX |
52 | --- a/include/tcg/oversized-guest.h | 52 | --- a/include/tcg/oversized-guest.h |
53 | +++ /dev/null | 53 | +++ /dev/null |
54 | @@ -XXX,XX +XXX,XX @@ | 54 | @@ -XXX,XX +XXX,XX @@ |
55 | -/* SPDX-License-Identifier: MIT */ | 55 | -/* SPDX-License-Identifier: MIT */ |
56 | -/* | 56 | -/* |
57 | - * Define TCG_OVERSIZED_GUEST | 57 | - * Define TCG_OVERSIZED_GUEST |
58 | - * Copyright (c) 2008 Fabrice Bellard | 58 | - * Copyright (c) 2008 Fabrice Bellard |
59 | - */ | 59 | - */ |
60 | - | 60 | - |
61 | -#ifndef EXEC_TCG_OVERSIZED_GUEST_H | 61 | -#ifndef EXEC_TCG_OVERSIZED_GUEST_H |
62 | -#define EXEC_TCG_OVERSIZED_GUEST_H | 62 | -#define EXEC_TCG_OVERSIZED_GUEST_H |
63 | - | 63 | - |
64 | -#include "tcg-target-reg-bits.h" | 64 | -#include "tcg-target-reg-bits.h" |
65 | -#include "cpu-param.h" | 65 | -#include "cpu-param.h" |
66 | - | 66 | - |
67 | -/* | 67 | -/* |
68 | - * Oversized TCG guests make things like MTTCG hard | 68 | - * Oversized TCG guests make things like MTTCG hard |
69 | - * as we can't use atomics for cputlb updates. | 69 | - * as we can't use atomics for cputlb updates. |
70 | - */ | 70 | - */ |
71 | -#if TARGET_LONG_BITS > TCG_TARGET_REG_BITS | 71 | -#if TARGET_LONG_BITS > TCG_TARGET_REG_BITS |
72 | -#define TCG_OVERSIZED_GUEST 1 | 72 | -#define TCG_OVERSIZED_GUEST 1 |
73 | -#else | 73 | -#else |
74 | -#define TCG_OVERSIZED_GUEST 0 | 74 | -#define TCG_OVERSIZED_GUEST 0 |
75 | -#endif | 75 | -#endif |
76 | - | 76 | - |
77 | -#endif | 77 | -#endif |
78 | diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c | 78 | diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c |
79 | index XXXXXXX..XXXXXXX 100644 | 79 | index XXXXXXX..XXXXXXX 100644 |
80 | --- a/accel/tcg/cputlb.c | 80 | --- a/accel/tcg/cputlb.c |
81 | +++ b/accel/tcg/cputlb.c | 81 | +++ b/accel/tcg/cputlb.c |
82 | @@ -XXX,XX +XXX,XX @@ | 82 | @@ -XXX,XX +XXX,XX @@ |
83 | #include "qemu/plugin-memory.h" | 83 | #include "qemu/plugin-memory.h" |
84 | #endif | 84 | #endif |
85 | #include "tcg/tcg-ldst.h" | 85 | #include "tcg/tcg-ldst.h" |
86 | -#include "tcg/oversized-guest.h" | 86 | -#include "tcg/oversized-guest.h" |
87 | 87 | ||
88 | /* DEBUG defines, enable DEBUG_TLB_LOG to log to the CPU_LOG_MMU target */ | 88 | /* DEBUG defines, enable DEBUG_TLB_LOG to log to the CPU_LOG_MMU target */ |
89 | /* #define DEBUG_TLB */ | 89 | /* #define DEBUG_TLB */ |
90 | @@ -XXX,XX +XXX,XX @@ static inline uint64_t tlb_read_idx(const CPUTLBEntry *entry, | 90 | @@ -XXX,XX +XXX,XX @@ static inline uint64_t tlb_read_idx(const CPUTLBEntry *entry, |
91 | return qatomic_read(ptr); | 91 | return qatomic_read(ptr); |
92 | #else | 92 | #else |
93 | const uint64_t *ptr = &entry->addr_idx[access_type]; | 93 | const uint64_t *ptr = &entry->addr_idx[access_type]; |
94 | -# if TCG_OVERSIZED_GUEST | 94 | -# if TCG_OVERSIZED_GUEST |
95 | - return *ptr; | 95 | - return *ptr; |
96 | -# else | 96 | -# else |
97 | /* ofs might correspond to .addr_write, so use qatomic_read */ | 97 | /* ofs might correspond to .addr_write, so use qatomic_read */ |
98 | return qatomic_read(ptr); | 98 | return qatomic_read(ptr); |
99 | -# endif | 99 | -# endif |
100 | #endif | 100 | #endif |
101 | } | 101 | } |
102 | 102 | ||
103 | @@ -XXX,XX +XXX,XX @@ static void tlb_reset_dirty_range_locked(CPUTLBEntry *tlb_entry, | 103 | @@ -XXX,XX +XXX,XX @@ static void tlb_reset_dirty_range_locked(CPUTLBEntry *tlb_entry, |
104 | uint32_t *ptr_write = (uint32_t *)&tlb_entry->addr_write; | 104 | uint32_t *ptr_write = (uint32_t *)&tlb_entry->addr_write; |
105 | ptr_write += HOST_BIG_ENDIAN; | 105 | ptr_write += HOST_BIG_ENDIAN; |
106 | qatomic_set(ptr_write, *ptr_write | TLB_NOTDIRTY); | 106 | qatomic_set(ptr_write, *ptr_write | TLB_NOTDIRTY); |
107 | -#elif TCG_OVERSIZED_GUEST | 107 | -#elif TCG_OVERSIZED_GUEST |
108 | - tlb_entry->addr_write |= TLB_NOTDIRTY; | 108 | - tlb_entry->addr_write |= TLB_NOTDIRTY; |
109 | #else | 109 | #else |
110 | qatomic_set(&tlb_entry->addr_write, | 110 | qatomic_set(&tlb_entry->addr_write, |
111 | tlb_entry->addr_write | TLB_NOTDIRTY); | 111 | tlb_entry->addr_write | TLB_NOTDIRTY); |
112 | diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c | 112 | diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c |
113 | index XXXXXXX..XXXXXXX 100644 | 113 | index XXXXXXX..XXXXXXX 100644 |
114 | --- a/accel/tcg/tcg-all.c | 114 | --- a/accel/tcg/tcg-all.c |
115 | +++ b/accel/tcg/tcg-all.c | 115 | +++ b/accel/tcg/tcg-all.c |
116 | @@ -XXX,XX +XXX,XX @@ | 116 | @@ -XXX,XX +XXX,XX @@ |
117 | #include "exec/replay-core.h" | 117 | #include "exec/replay-core.h" |
118 | #include "system/cpu-timers.h" | 118 | #include "system/cpu-timers.h" |
119 | #include "tcg/startup.h" | 119 | #include "tcg/startup.h" |
120 | -#include "tcg/oversized-guest.h" | 120 | -#include "tcg/oversized-guest.h" |
121 | #include "qapi/error.h" | 121 | #include "qapi/error.h" |
122 | #include "qemu/error-report.h" | 122 | #include "qemu/error-report.h" |
123 | #include "qemu/accel.h" | 123 | #include "qemu/accel.h" |
124 | @@ -XXX,XX +XXX,XX @@ | 124 | @@ -XXX,XX +XXX,XX @@ |
125 | #include "hw/boards.h" | 125 | #include "hw/boards.h" |
126 | #endif | 126 | #endif |
127 | #include "internal-common.h" | 127 | #include "internal-common.h" |
128 | +#include "cpu-param.h" | 128 | +#include "cpu-param.h" |
129 | + | 129 | + |
130 | 130 | ||
131 | struct TCGState { | 131 | struct TCGState { |
132 | AccelState parent_obj; | 132 | AccelState parent_obj; |
133 | @@ -XXX,XX +XXX,XX @@ DECLARE_INSTANCE_CHECKER(TCGState, TCG_STATE, | 133 | @@ -XXX,XX +XXX,XX @@ DECLARE_INSTANCE_CHECKER(TCGState, TCG_STATE, |
134 | 134 | ||
135 | static bool default_mttcg_enabled(void) | 135 | static bool default_mttcg_enabled(void) |
136 | { | 136 | { |
137 | - if (icount_enabled() || TCG_OVERSIZED_GUEST) { | 137 | - if (icount_enabled() || TCG_OVERSIZED_GUEST) { |
138 | + if (icount_enabled()) { | 138 | + if (icount_enabled()) { |
139 | return false; | 139 | return false; |
140 | } | 140 | } |
141 | #ifdef TARGET_SUPPORTS_MTTCG | 141 | #ifdef TARGET_SUPPORTS_MTTCG |
142 | @@ -XXX,XX +XXX,XX @@ static void tcg_set_thread(Object *obj, const char *value, Error **errp) | 142 | @@ -XXX,XX +XXX,XX @@ static void tcg_set_thread(Object *obj, const char *value, Error **errp) |
143 | TCGState *s = TCG_STATE(obj); | 143 | TCGState *s = TCG_STATE(obj); |
144 | 144 | ||
145 | if (strcmp(value, "multi") == 0) { | 145 | if (strcmp(value, "multi") == 0) { |
146 | - if (TCG_OVERSIZED_GUEST) { | 146 | - if (TCG_OVERSIZED_GUEST) { |
147 | - error_setg(errp, "No MTTCG when guest word size > hosts"); | 147 | - error_setg(errp, "No MTTCG when guest word size > hosts"); |
148 | - } else if (icount_enabled()) { | 148 | - } else if (icount_enabled()) { |
149 | + if (icount_enabled()) { | 149 | + if (icount_enabled()) { |
150 | error_setg(errp, "No MTTCG when icount is enabled"); | 150 | error_setg(errp, "No MTTCG when icount is enabled"); |
151 | } else { | 151 | } else { |
152 | #ifndef TARGET_SUPPORTS_MTTCG | 152 | #ifndef TARGET_SUPPORTS_MTTCG |
153 | diff --git a/target/arm/ptw.c b/target/arm/ptw.c | 153 | diff --git a/target/arm/ptw.c b/target/arm/ptw.c |
154 | index XXXXXXX..XXXXXXX 100644 | 154 | index XXXXXXX..XXXXXXX 100644 |
155 | --- a/target/arm/ptw.c | 155 | --- a/target/arm/ptw.c |
156 | +++ b/target/arm/ptw.c | 156 | +++ b/target/arm/ptw.c |
157 | @@ -XXX,XX +XXX,XX @@ | 157 | @@ -XXX,XX +XXX,XX @@ |
158 | #include "internals.h" | 158 | #include "internals.h" |
159 | #include "cpu-features.h" | 159 | #include "cpu-features.h" |
160 | #include "idau.h" | 160 | #include "idau.h" |
161 | -#ifdef CONFIG_TCG | 161 | -#ifdef CONFIG_TCG |
162 | -# include "tcg/oversized-guest.h" | 162 | -# include "tcg/oversized-guest.h" |
163 | -#endif | 163 | -#endif |
164 | 164 | ||
165 | typedef struct S1Translate { | 165 | typedef struct S1Translate { |
166 | /* | 166 | /* |
167 | @@ -XXX,XX +XXX,XX @@ static uint64_t arm_casq_ptw(CPUARMState *env, uint64_t old_val, | 167 | @@ -XXX,XX +XXX,XX @@ static uint64_t arm_casq_ptw(CPUARMState *env, uint64_t old_val, |
168 | ptw->out_rw = true; | 168 | ptw->out_rw = true; |
169 | } | 169 | } |
170 | 170 | ||
171 | -#ifdef CONFIG_ATOMIC64 | 171 | -#ifdef CONFIG_ATOMIC64 |
172 | if (ptw->out_be) { | 172 | if (ptw->out_be) { |
173 | old_val = cpu_to_be64(old_val); | 173 | old_val = cpu_to_be64(old_val); |
174 | new_val = cpu_to_be64(new_val); | 174 | new_val = cpu_to_be64(new_val); |
175 | @@ -XXX,XX +XXX,XX @@ static uint64_t arm_casq_ptw(CPUARMState *env, uint64_t old_val, | 175 | @@ -XXX,XX +XXX,XX @@ static uint64_t arm_casq_ptw(CPUARMState *env, uint64_t old_val, |
176 | cur_val = qatomic_cmpxchg__nocheck((uint64_t *)host, old_val, new_val); | 176 | cur_val = qatomic_cmpxchg__nocheck((uint64_t *)host, old_val, new_val); |
177 | cur_val = le64_to_cpu(cur_val); | 177 | cur_val = le64_to_cpu(cur_val); |
178 | } | 178 | } |
179 | -#else | 179 | -#else |
180 | - /* | 180 | - /* |
181 | - * We can't support the full 64-bit atomic cmpxchg on the host. | 181 | - * We can't support the full 64-bit atomic cmpxchg on the host. |
182 | - * Because this is only used for FEAT_HAFDBS, which is only for AA64, | 182 | - * Because this is only used for FEAT_HAFDBS, which is only for AA64, |
183 | - * we know that TCG_OVERSIZED_GUEST is set, which means that we are | 183 | - * we know that TCG_OVERSIZED_GUEST is set, which means that we are |
184 | - * running in round-robin mode and could only race with dma i/o. | 184 | - * running in round-robin mode and could only race with dma i/o. |
185 | - */ | 185 | - */ |
186 | -#if !TCG_OVERSIZED_GUEST | 186 | -#if !TCG_OVERSIZED_GUEST |
187 | -# error "Unexpected configuration" | 187 | -# error "Unexpected configuration" |
188 | -#endif | 188 | -#endif |
189 | - bool locked = bql_locked(); | 189 | - bool locked = bql_locked(); |
190 | - if (!locked) { | 190 | - if (!locked) { |
191 | - bql_lock(); | 191 | - bql_lock(); |
192 | - } | 192 | - } |
193 | - if (ptw->out_be) { | 193 | - if (ptw->out_be) { |
194 | - cur_val = ldq_be_p(host); | 194 | - cur_val = ldq_be_p(host); |
195 | - if (cur_val == old_val) { | 195 | - if (cur_val == old_val) { |
196 | - stq_be_p(host, new_val); | 196 | - stq_be_p(host, new_val); |
197 | - } | 197 | - } |
198 | - } else { | 198 | - } else { |
199 | - cur_val = ldq_le_p(host); | 199 | - cur_val = ldq_le_p(host); |
200 | - if (cur_val == old_val) { | 200 | - if (cur_val == old_val) { |
201 | - stq_le_p(host, new_val); | 201 | - stq_le_p(host, new_val); |
202 | - } | 202 | - } |
203 | - } | 203 | - } |
204 | - if (!locked) { | 204 | - if (!locked) { |
205 | - bql_unlock(); | 205 | - bql_unlock(); |
206 | - } | 206 | - } |
207 | -#endif | 207 | -#endif |
208 | - | 208 | - |
209 | return cur_val; | 209 | return cur_val; |
210 | #else | 210 | #else |
211 | /* AArch32 does not have FEAT_HADFS; non-TCG guests only use debug-mode. */ | 211 | /* AArch32 does not have FEAT_HADFS; non-TCG guests only use debug-mode. */ |
212 | diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c | 212 | diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c |
213 | index XXXXXXX..XXXXXXX 100644 | 213 | index XXXXXXX..XXXXXXX 100644 |
214 | --- a/target/riscv/cpu_helper.c | 214 | --- a/target/riscv/cpu_helper.c |
215 | +++ b/target/riscv/cpu_helper.c | 215 | +++ b/target/riscv/cpu_helper.c |
216 | @@ -XXX,XX +XXX,XX @@ | 216 | @@ -XXX,XX +XXX,XX @@ |
217 | #include "system/cpu-timers.h" | 217 | #include "system/cpu-timers.h" |
218 | #include "cpu_bits.h" | 218 | #include "cpu_bits.h" |
219 | #include "debug.h" | 219 | #include "debug.h" |
220 | -#include "tcg/oversized-guest.h" | 220 | -#include "tcg/oversized-guest.h" |
221 | #include "pmp.h" | 221 | #include "pmp.h" |
222 | 222 | ||
223 | int riscv_env_mmu_index(CPURISCVState *env, bool ifetch) | 223 | int riscv_env_mmu_index(CPURISCVState *env, bool ifetch) |
224 | @@ -XXX,XX +XXX,XX @@ static int get_physical_address(CPURISCVState *env, hwaddr *physical, | 224 | @@ -XXX,XX +XXX,XX @@ static int get_physical_address(CPURISCVState *env, hwaddr *physical, |
225 | hwaddr pte_addr; | 225 | hwaddr pte_addr; |
226 | int i; | 226 | int i; |
227 | 227 | ||
228 | -#if !TCG_OVERSIZED_GUEST | 228 | -#if !TCG_OVERSIZED_GUEST |
229 | -restart: | 229 | -restart: |
230 | -#endif | 230 | -#endif |
231 | + restart: | 231 | + restart: |
232 | for (i = 0; i < levels; i++, ptshift -= ptidxbits) { | 232 | for (i = 0; i < levels; i++, ptshift -= ptidxbits) { |
233 | target_ulong idx; | 233 | target_ulong idx; |
234 | if (i == 0) { | 234 | if (i == 0) { |
235 | @@ -XXX,XX +XXX,XX @@ restart: | 235 | @@ -XXX,XX +XXX,XX @@ restart: |
236 | false, MEMTXATTRS_UNSPECIFIED); | 236 | false, MEMTXATTRS_UNSPECIFIED); |
237 | if (memory_region_is_ram(mr)) { | 237 | if (memory_region_is_ram(mr)) { |
238 | target_ulong *pte_pa = qemu_map_ram_ptr(mr->ram_block, addr1); | 238 | target_ulong *pte_pa = qemu_map_ram_ptr(mr->ram_block, addr1); |
239 | -#if TCG_OVERSIZED_GUEST | 239 | -#if TCG_OVERSIZED_GUEST |
240 | - /* | 240 | - /* |
241 | - * MTTCG is not enabled on oversized TCG guests so | 241 | - * MTTCG is not enabled on oversized TCG guests so |
242 | - * page table updates do not need to be atomic | 242 | - * page table updates do not need to be atomic |
243 | - */ | 243 | - */ |
244 | - *pte_pa = pte = updated_pte; | 244 | - *pte_pa = pte = updated_pte; |
245 | -#else | 245 | -#else |
246 | target_ulong old_pte; | 246 | target_ulong old_pte; |
247 | if (riscv_cpu_sxl(env) == MXL_RV32) { | 247 | if (riscv_cpu_sxl(env) == MXL_RV32) { |
248 | old_pte = qatomic_cmpxchg((uint32_t *)pte_pa, pte, updated_pte); | 248 | old_pte = qatomic_cmpxchg((uint32_t *)pte_pa, pte, updated_pte); |
249 | @@ -XXX,XX +XXX,XX @@ restart: | 249 | @@ -XXX,XX +XXX,XX @@ restart: |
250 | goto restart; | 250 | goto restart; |
251 | } | 251 | } |
252 | pte = updated_pte; | 252 | pte = updated_pte; |
253 | -#endif | 253 | -#endif |
254 | } else { | 254 | } else { |
255 | /* | 255 | /* |
256 | * Misconfigured PTE in ROM (AD bits are not preset) or | 256 | * Misconfigured PTE in ROM (AD bits are not preset) or |
257 | diff --git a/docs/devel/multi-thread-tcg.rst b/docs/devel/multi-thread-tcg.rst | 257 | diff --git a/docs/devel/multi-thread-tcg.rst b/docs/devel/multi-thread-tcg.rst |
258 | index XXXXXXX..XXXXXXX 100644 | 258 | index XXXXXXX..XXXXXXX 100644 |
259 | --- a/docs/devel/multi-thread-tcg.rst | 259 | --- a/docs/devel/multi-thread-tcg.rst |
260 | +++ b/docs/devel/multi-thread-tcg.rst | 260 | +++ b/docs/devel/multi-thread-tcg.rst |
261 | @@ -XXX,XX +XXX,XX @@ if: | 261 | @@ -XXX,XX +XXX,XX @@ if: |
262 | 262 | ||
263 | * forced by --accel tcg,thread=single | 263 | * forced by --accel tcg,thread=single |
264 | * enabling --icount mode | 264 | * enabling --icount mode |
265 | -* 64 bit guests on 32 bit hosts (TCG_OVERSIZED_GUEST) | 265 | -* 64 bit guests on 32 bit hosts (TCG_OVERSIZED_GUEST) |
266 | 266 | ||
267 | In the general case of running translated code there should be no | 267 | In the general case of running translated code there should be no |
268 | inter-vCPU dependencies and all vCPUs should be able to run at full | 268 | inter-vCPU dependencies and all vCPUs should be able to run at full |
269 | -- | 269 | -- |
270 | 2.43.0 | 270 | 2.43.0 |
271 | 271 | ||
272 | 272 | diff view generated by jsdifflib |
1 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | 1 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
---|---|---|---|
2 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 2 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
3 | --- | 3 | --- |
4 | tcg/tcg-op-ldst.c | 21 +++------------------ | 4 | tcg/tcg-op-ldst.c | 21 +++------------------ |
5 | tcg/tcg.c | 4 +--- | 5 | tcg/tcg.c | 4 +--- |
6 | 2 files changed, 4 insertions(+), 21 deletions(-) | 6 | 2 files changed, 4 insertions(+), 21 deletions(-) |
7 | 7 | ||
8 | diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c | 8 | diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c |
9 | index XXXXXXX..XXXXXXX 100644 | 9 | index XXXXXXX..XXXXXXX 100644 |
10 | --- a/tcg/tcg-op-ldst.c | 10 | --- a/tcg/tcg-op-ldst.c |
11 | +++ b/tcg/tcg-op-ldst.c | 11 | +++ b/tcg/tcg-op-ldst.c |
12 | @@ -XXX,XX +XXX,XX @@ static MemOp tcg_canonicalize_memop(MemOp op, bool is64, bool st) | 12 | @@ -XXX,XX +XXX,XX @@ static MemOp tcg_canonicalize_memop(MemOp op, bool is64, bool st) |
13 | static void gen_ldst(TCGOpcode opc, TCGType type, TCGTemp *vl, TCGTemp *vh, | 13 | static void gen_ldst(TCGOpcode opc, TCGType type, TCGTemp *vl, TCGTemp *vh, |
14 | TCGTemp *addr, MemOpIdx oi) | 14 | TCGTemp *addr, MemOpIdx oi) |
15 | { | 15 | { |
16 | - if (TCG_TARGET_REG_BITS == 64 || tcg_ctx->addr_type == TCG_TYPE_I32) { | 16 | - if (TCG_TARGET_REG_BITS == 64 || tcg_ctx->addr_type == TCG_TYPE_I32) { |
17 | - if (vh) { | 17 | - if (vh) { |
18 | - tcg_gen_op4(opc, type, temp_arg(vl), temp_arg(vh), | 18 | - tcg_gen_op4(opc, type, temp_arg(vl), temp_arg(vh), |
19 | - temp_arg(addr), oi); | 19 | - temp_arg(addr), oi); |
20 | - } else { | 20 | - } else { |
21 | - tcg_gen_op3(opc, type, temp_arg(vl), temp_arg(addr), oi); | 21 | - tcg_gen_op3(opc, type, temp_arg(vl), temp_arg(addr), oi); |
22 | - } | 22 | - } |
23 | + if (vh) { | 23 | + if (vh) { |
24 | + tcg_gen_op4(opc, type, temp_arg(vl), temp_arg(vh), temp_arg(addr), oi); | 24 | + tcg_gen_op4(opc, type, temp_arg(vl), temp_arg(vh), temp_arg(addr), oi); |
25 | } else { | 25 | } else { |
26 | - /* See TCGV_LOW/HIGH. */ | 26 | - /* See TCGV_LOW/HIGH. */ |
27 | - TCGTemp *al = addr + HOST_BIG_ENDIAN; | 27 | - TCGTemp *al = addr + HOST_BIG_ENDIAN; |
28 | - TCGTemp *ah = addr + !HOST_BIG_ENDIAN; | 28 | - TCGTemp *ah = addr + !HOST_BIG_ENDIAN; |
29 | - | 29 | - |
30 | - if (vh) { | 30 | - if (vh) { |
31 | - tcg_gen_op5(opc, type, temp_arg(vl), temp_arg(vh), | 31 | - tcg_gen_op5(opc, type, temp_arg(vl), temp_arg(vh), |
32 | - temp_arg(al), temp_arg(ah), oi); | 32 | - temp_arg(al), temp_arg(ah), oi); |
33 | - } else { | 33 | - } else { |
34 | - tcg_gen_op4(opc, type, temp_arg(vl), | 34 | - tcg_gen_op4(opc, type, temp_arg(vl), |
35 | - temp_arg(al), temp_arg(ah), oi); | 35 | - temp_arg(al), temp_arg(ah), oi); |
36 | - } | 36 | - } |
37 | + tcg_gen_op3(opc, type, temp_arg(vl), temp_arg(addr), oi); | 37 | + tcg_gen_op3(opc, type, temp_arg(vl), temp_arg(addr), oi); |
38 | } | 38 | } |
39 | } | 39 | } |
40 | 40 | ||
41 | diff --git a/tcg/tcg.c b/tcg/tcg.c | 41 | diff --git a/tcg/tcg.c b/tcg/tcg.c |
42 | index XXXXXXX..XXXXXXX 100644 | 42 | index XXXXXXX..XXXXXXX 100644 |
43 | --- a/tcg/tcg.c | 43 | --- a/tcg/tcg.c |
44 | +++ b/tcg/tcg.c | 44 | +++ b/tcg/tcg.c |
45 | @@ -XXX,XX +XXX,XX @@ void tcg_func_start(TCGContext *s) | 45 | @@ -XXX,XX +XXX,XX @@ void tcg_func_start(TCGContext *s) |
46 | s->emit_before_op = NULL; | 46 | s->emit_before_op = NULL; |
47 | QSIMPLEQ_INIT(&s->labels); | 47 | QSIMPLEQ_INIT(&s->labels); |
48 | 48 | ||
49 | - tcg_debug_assert(s->addr_type == TCG_TYPE_I32 || | 49 | - tcg_debug_assert(s->addr_type == TCG_TYPE_I32 || |
50 | - s->addr_type == TCG_TYPE_I64); | 50 | - s->addr_type == TCG_TYPE_I64); |
51 | - | 51 | - |
52 | + tcg_debug_assert(s->addr_type <= TCG_TYPE_REG); | 52 | + tcg_debug_assert(s->addr_type <= TCG_TYPE_REG); |
53 | tcg_debug_assert(s->insn_start_words > 0); | 53 | tcg_debug_assert(s->insn_start_words > 0); |
54 | } | 54 | } |
55 | 55 | ||
56 | -- | 56 | -- |
57 | 2.43.0 | 57 | 2.43.0 |
58 | 58 | ||
59 | 59 | diff view generated by jsdifflib |
1 | Since 64-on-32 is now unsupported, guest addresses always | 1 | Since 64-on-32 is now unsupported, guest addresses always |
---|---|---|---|
2 | fit in one host register. Drop the replication of opcodes. | 2 | fit in one host register. Drop the replication of opcodes. |
3 | 3 | ||
4 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
5 | --- | 6 | --- |
6 | include/tcg/tcg-opc.h | 28 ++------ | 7 | include/tcg/tcg-opc.h | 28 ++------ |
7 | tcg/optimize.c | 21 ++---- | 8 | tcg/optimize.c | 21 ++---- |
8 | tcg/tcg-op-ldst.c | 82 +++++---------------- | 9 | tcg/tcg-op-ldst.c | 82 +++++---------------- |
... | ... | ||
1356 | } | 1357 | } |
1357 | break; | 1358 | break; |
1358 | 1359 | ||
1359 | -- | 1360 | -- |
1360 | 2.43.0 | 1361 | 2.43.0 |
1362 | |||
1363 | diff view generated by jsdifflib |
1 | The guest address will now always be TCG_TYPE_I32. | 1 | The guest address will now always be TCG_TYPE_I32. |
---|---|---|---|
2 | 2 | ||
3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | --- | 5 | --- |
5 | tcg/arm/tcg-target.c.inc | 63 ++++++++++++++-------------------------- | 6 | tcg/arm/tcg-target.c.inc | 73 +++++++++++++--------------------------- |
6 | 1 file changed, 21 insertions(+), 42 deletions(-) | 7 | 1 file changed, 23 insertions(+), 50 deletions(-) |
7 | 8 | ||
8 | diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc | 9 | diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc |
9 | index XXXXXXX..XXXXXXX 100644 | 10 | index XXXXXXX..XXXXXXX 100644 |
10 | --- a/tcg/arm/tcg-target.c.inc | 11 | --- a/tcg/arm/tcg-target.c.inc |
11 | +++ b/tcg/arm/tcg-target.c.inc | 12 | +++ b/tcg/arm/tcg-target.c.inc |
13 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_ldrd_r(TCGContext *s, ARMCond cond, TCGReg rt, | ||
14 | tcg_out_memop_r(s, cond, INSN_LDRD_REG, rt, rn, rm, 1, 1, 0); | ||
15 | } | ||
16 | |||
17 | -static void __attribute__((unused)) | ||
18 | -tcg_out_ldrd_rwb(TCGContext *s, ARMCond cond, TCGReg rt, TCGReg rn, TCGReg rm) | ||
19 | -{ | ||
20 | - tcg_out_memop_r(s, cond, INSN_LDRD_REG, rt, rn, rm, 1, 1, 1); | ||
21 | -} | ||
22 | - | ||
23 | -static void __attribute__((unused)) | ||
24 | -tcg_out_strd_8(TCGContext *s, ARMCond cond, TCGReg rt, TCGReg rn, int imm8) | ||
25 | +static void tcg_out_strd_8(TCGContext *s, ARMCond cond, TCGReg rt, | ||
26 | + TCGReg rn, int imm8) | ||
27 | { | ||
28 | tcg_out_memop_8(s, cond, INSN_STRD_IMM, rt, rn, imm8, 1, 0); | ||
29 | } | ||
12 | @@ -XXX,XX +XXX,XX @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *lb) | 30 | @@ -XXX,XX +XXX,XX @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *lb) |
13 | #define MIN_TLB_MASK_TABLE_OFS -256 | 31 | #define MIN_TLB_MASK_TABLE_OFS -256 |
14 | 32 | ||
15 | static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 33 | static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
16 | - TCGReg addrlo, TCGReg addrhi, | 34 | - TCGReg addrlo, TCGReg addrhi, |
... | ... | ||
186 | break; | 204 | break; |
187 | 205 | ||
188 | case INDEX_op_bswap16_i32: | 206 | case INDEX_op_bswap16_i32: |
189 | -- | 207 | -- |
190 | 2.43.0 | 208 | 2.43.0 |
209 | |||
210 | diff view generated by jsdifflib |
1 | The guest address will now always fit in one register. | 1 | The guest address will now always fit in one register. |
---|---|---|---|
2 | 2 | ||
3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | 3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
5 | --- | 5 | --- |
6 | tcg/i386/tcg-target.c.inc | 56 ++++++++++++++------------------------- | 6 | tcg/i386/tcg-target.c.inc | 56 ++++++++++++++------------------------- |
7 | 1 file changed, 20 insertions(+), 36 deletions(-) | 7 | 1 file changed, 20 insertions(+), 36 deletions(-) |
8 | 8 | ||
9 | diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc | 9 | diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc |
10 | index XXXXXXX..XXXXXXX 100644 | 10 | index XXXXXXX..XXXXXXX 100644 |
11 | --- a/tcg/i386/tcg-target.c.inc | 11 | --- a/tcg/i386/tcg-target.c.inc |
12 | +++ b/tcg/i386/tcg-target.c.inc | 12 | +++ b/tcg/i386/tcg-target.c.inc |
13 | @@ -XXX,XX +XXX,XX @@ static inline int setup_guest_base_seg(void) | 13 | @@ -XXX,XX +XXX,XX @@ static inline int setup_guest_base_seg(void) |
14 | * is required and fill in @h with the host address for the fast path. | 14 | * is required and fill in @h with the host address for the fast path. |
15 | */ | 15 | */ |
16 | static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 16 | static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
17 | - TCGReg addrlo, TCGReg addrhi, | 17 | - TCGReg addrlo, TCGReg addrhi, |
18 | - MemOpIdx oi, bool is_ld) | 18 | - MemOpIdx oi, bool is_ld) |
19 | + TCGReg addr, MemOpIdx oi, bool is_ld) | 19 | + TCGReg addr, MemOpIdx oi, bool is_ld) |
20 | { | 20 | { |
21 | TCGLabelQemuLdst *ldst = NULL; | 21 | TCGLabelQemuLdst *ldst = NULL; |
22 | MemOp opc = get_memop(oi); | 22 | MemOp opc = get_memop(oi); |
23 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 23 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
24 | } else { | 24 | } else { |
25 | *h = x86_guest_base; | 25 | *h = x86_guest_base; |
26 | } | 26 | } |
27 | - h->base = addrlo; | 27 | - h->base = addrlo; |
28 | + h->base = addr; | 28 | + h->base = addr; |
29 | h->aa = atom_and_align_for_opc(s, opc, MO_ATOM_IFALIGN, s_bits == MO_128); | 29 | h->aa = atom_and_align_for_opc(s, opc, MO_ATOM_IFALIGN, s_bits == MO_128); |
30 | a_mask = (1 << h->aa.align) - 1; | 30 | a_mask = (1 << h->aa.align) - 1; |
31 | 31 | ||
32 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 32 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
33 | ldst = new_ldst_label(s); | 33 | ldst = new_ldst_label(s); |
34 | ldst->is_ld = is_ld; | 34 | ldst->is_ld = is_ld; |
35 | ldst->oi = oi; | 35 | ldst->oi = oi; |
36 | - ldst->addrlo_reg = addrlo; | 36 | - ldst->addrlo_reg = addrlo; |
37 | - ldst->addrhi_reg = addrhi; | 37 | - ldst->addrhi_reg = addrhi; |
38 | + ldst->addrlo_reg = addr; | 38 | + ldst->addrlo_reg = addr; |
39 | 39 | ||
40 | if (TCG_TARGET_REG_BITS == 64) { | 40 | if (TCG_TARGET_REG_BITS == 64) { |
41 | ttype = s->addr_type; | 41 | ttype = s->addr_type; |
42 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 42 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
43 | } | 43 | } |
44 | } | 44 | } |
45 | 45 | ||
46 | - tcg_out_mov(s, tlbtype, TCG_REG_L0, addrlo); | 46 | - tcg_out_mov(s, tlbtype, TCG_REG_L0, addrlo); |
47 | + tcg_out_mov(s, tlbtype, TCG_REG_L0, addr); | 47 | + tcg_out_mov(s, tlbtype, TCG_REG_L0, addr); |
48 | tcg_out_shifti(s, SHIFT_SHR + tlbrexw, TCG_REG_L0, | 48 | tcg_out_shifti(s, SHIFT_SHR + tlbrexw, TCG_REG_L0, |
49 | s->page_bits - CPU_TLB_ENTRY_BITS); | 49 | s->page_bits - CPU_TLB_ENTRY_BITS); |
50 | 50 | ||
51 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 51 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
52 | * check that we don't cross pages for the complete access. | 52 | * check that we don't cross pages for the complete access. |
53 | */ | 53 | */ |
54 | if (a_mask >= s_mask) { | 54 | if (a_mask >= s_mask) { |
55 | - tcg_out_mov(s, ttype, TCG_REG_L1, addrlo); | 55 | - tcg_out_mov(s, ttype, TCG_REG_L1, addrlo); |
56 | + tcg_out_mov(s, ttype, TCG_REG_L1, addr); | 56 | + tcg_out_mov(s, ttype, TCG_REG_L1, addr); |
57 | } else { | 57 | } else { |
58 | tcg_out_modrm_offset(s, OPC_LEA + trexw, TCG_REG_L1, | 58 | tcg_out_modrm_offset(s, OPC_LEA + trexw, TCG_REG_L1, |
59 | - addrlo, s_mask - a_mask); | 59 | - addrlo, s_mask - a_mask); |
60 | + addr, s_mask - a_mask); | 60 | + addr, s_mask - a_mask); |
61 | } | 61 | } |
62 | tlb_mask = s->page_mask | a_mask; | 62 | tlb_mask = s->page_mask | a_mask; |
63 | tgen_arithi(s, ARITH_AND + trexw, TCG_REG_L1, tlb_mask, 0); | 63 | tgen_arithi(s, ARITH_AND + trexw, TCG_REG_L1, tlb_mask, 0); |
64 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 64 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
65 | ldst->label_ptr[0] = s->code_ptr; | 65 | ldst->label_ptr[0] = s->code_ptr; |
66 | s->code_ptr += 4; | 66 | s->code_ptr += 4; |
67 | 67 | ||
68 | - if (TCG_TARGET_REG_BITS == 32 && s->addr_type == TCG_TYPE_I64) { | 68 | - if (TCG_TARGET_REG_BITS == 32 && s->addr_type == TCG_TYPE_I64) { |
69 | - /* cmp 4(TCG_REG_L0), addrhi */ | 69 | - /* cmp 4(TCG_REG_L0), addrhi */ |
70 | - tcg_out_modrm_offset(s, OPC_CMP_GvEv, addrhi, | 70 | - tcg_out_modrm_offset(s, OPC_CMP_GvEv, addrhi, |
71 | - TCG_REG_L0, cmp_ofs + 4); | 71 | - TCG_REG_L0, cmp_ofs + 4); |
72 | - | 72 | - |
73 | - /* jne slow_path */ | 73 | - /* jne slow_path */ |
74 | - tcg_out_opc(s, OPC_JCC_long + JCC_JNE, 0, 0, 0); | 74 | - tcg_out_opc(s, OPC_JCC_long + JCC_JNE, 0, 0, 0); |
75 | - ldst->label_ptr[1] = s->code_ptr; | 75 | - ldst->label_ptr[1] = s->code_ptr; |
76 | - s->code_ptr += 4; | 76 | - s->code_ptr += 4; |
77 | - } | 77 | - } |
78 | - | 78 | - |
79 | /* TLB Hit. */ | 79 | /* TLB Hit. */ |
80 | tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_L0, TCG_REG_L0, | 80 | tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_L0, TCG_REG_L0, |
81 | offsetof(CPUTLBEntry, addend)); | 81 | offsetof(CPUTLBEntry, addend)); |
82 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 82 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
83 | ldst = new_ldst_label(s); | 83 | ldst = new_ldst_label(s); |
84 | ldst->is_ld = is_ld; | 84 | ldst->is_ld = is_ld; |
85 | ldst->oi = oi; | 85 | ldst->oi = oi; |
86 | - ldst->addrlo_reg = addrlo; | 86 | - ldst->addrlo_reg = addrlo; |
87 | - ldst->addrhi_reg = addrhi; | 87 | - ldst->addrhi_reg = addrhi; |
88 | + ldst->addrlo_reg = addr; | 88 | + ldst->addrlo_reg = addr; |
89 | 89 | ||
90 | /* jne slow_path */ | 90 | /* jne slow_path */ |
91 | - jcc = tcg_out_cmp(s, TCG_COND_TSTNE, addrlo, a_mask, true, false); | 91 | - jcc = tcg_out_cmp(s, TCG_COND_TSTNE, addrlo, a_mask, true, false); |
92 | + jcc = tcg_out_cmp(s, TCG_COND_TSTNE, addr, a_mask, true, false); | 92 | + jcc = tcg_out_cmp(s, TCG_COND_TSTNE, addr, a_mask, true, false); |
93 | tcg_out_opc(s, OPC_JCC_long + jcc, 0, 0, 0); | 93 | tcg_out_opc(s, OPC_JCC_long + jcc, 0, 0, 0); |
94 | ldst->label_ptr[0] = s->code_ptr; | 94 | ldst->label_ptr[0] = s->code_ptr; |
95 | s->code_ptr += 4; | 95 | s->code_ptr += 4; |
96 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_qemu_ld_direct(TCGContext *s, TCGReg datalo, TCGReg datahi, | 96 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_qemu_ld_direct(TCGContext *s, TCGReg datalo, TCGReg datahi, |
97 | } | 97 | } |
98 | 98 | ||
99 | static void tcg_out_qemu_ld(TCGContext *s, TCGReg datalo, TCGReg datahi, | 99 | static void tcg_out_qemu_ld(TCGContext *s, TCGReg datalo, TCGReg datahi, |
100 | - TCGReg addrlo, TCGReg addrhi, | 100 | - TCGReg addrlo, TCGReg addrhi, |
101 | - MemOpIdx oi, TCGType data_type) | 101 | - MemOpIdx oi, TCGType data_type) |
102 | + TCGReg addr, MemOpIdx oi, TCGType data_type) | 102 | + TCGReg addr, MemOpIdx oi, TCGType data_type) |
103 | { | 103 | { |
104 | TCGLabelQemuLdst *ldst; | 104 | TCGLabelQemuLdst *ldst; |
105 | HostAddress h; | 105 | HostAddress h; |
106 | 106 | ||
107 | - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, true); | 107 | - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, true); |
108 | + ldst = prepare_host_addr(s, &h, addr, oi, true); | 108 | + ldst = prepare_host_addr(s, &h, addr, oi, true); |
109 | tcg_out_qemu_ld_direct(s, datalo, datahi, h, data_type, get_memop(oi)); | 109 | tcg_out_qemu_ld_direct(s, datalo, datahi, h, data_type, get_memop(oi)); |
110 | 110 | ||
111 | if (ldst) { | 111 | if (ldst) { |
112 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_qemu_st_direct(TCGContext *s, TCGReg datalo, TCGReg datahi, | 112 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_qemu_st_direct(TCGContext *s, TCGReg datalo, TCGReg datahi, |
113 | } | 113 | } |
114 | 114 | ||
115 | static void tcg_out_qemu_st(TCGContext *s, TCGReg datalo, TCGReg datahi, | 115 | static void tcg_out_qemu_st(TCGContext *s, TCGReg datalo, TCGReg datahi, |
116 | - TCGReg addrlo, TCGReg addrhi, | 116 | - TCGReg addrlo, TCGReg addrhi, |
117 | - MemOpIdx oi, TCGType data_type) | 117 | - MemOpIdx oi, TCGType data_type) |
118 | + TCGReg addr, MemOpIdx oi, TCGType data_type) | 118 | + TCGReg addr, MemOpIdx oi, TCGType data_type) |
119 | { | 119 | { |
120 | TCGLabelQemuLdst *ldst; | 120 | TCGLabelQemuLdst *ldst; |
121 | HostAddress h; | 121 | HostAddress h; |
122 | 122 | ||
123 | - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, false); | 123 | - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, false); |
124 | + ldst = prepare_host_addr(s, &h, addr, oi, false); | 124 | + ldst = prepare_host_addr(s, &h, addr, oi, false); |
125 | tcg_out_qemu_st_direct(s, datalo, datahi, h, get_memop(oi)); | 125 | tcg_out_qemu_st_direct(s, datalo, datahi, h, get_memop(oi)); |
126 | 126 | ||
127 | if (ldst) { | 127 | if (ldst) { |
128 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, | 128 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, |
129 | break; | 129 | break; |
130 | 130 | ||
131 | case INDEX_op_qemu_ld_i32: | 131 | case INDEX_op_qemu_ld_i32: |
132 | - tcg_out_qemu_ld(s, a0, -1, a1, -1, a2, TCG_TYPE_I32); | 132 | - tcg_out_qemu_ld(s, a0, -1, a1, -1, a2, TCG_TYPE_I32); |
133 | + tcg_out_qemu_ld(s, a0, -1, a1, a2, TCG_TYPE_I32); | 133 | + tcg_out_qemu_ld(s, a0, -1, a1, a2, TCG_TYPE_I32); |
134 | break; | 134 | break; |
135 | case INDEX_op_qemu_ld_i64: | 135 | case INDEX_op_qemu_ld_i64: |
136 | if (TCG_TARGET_REG_BITS == 64) { | 136 | if (TCG_TARGET_REG_BITS == 64) { |
137 | - tcg_out_qemu_ld(s, a0, -1, a1, -1, a2, TCG_TYPE_I64); | 137 | - tcg_out_qemu_ld(s, a0, -1, a1, -1, a2, TCG_TYPE_I64); |
138 | + tcg_out_qemu_ld(s, a0, -1, a1, a2, TCG_TYPE_I64); | 138 | + tcg_out_qemu_ld(s, a0, -1, a1, a2, TCG_TYPE_I64); |
139 | } else { | 139 | } else { |
140 | - tcg_out_qemu_ld(s, a0, a1, a2, -1, args[3], TCG_TYPE_I64); | 140 | - tcg_out_qemu_ld(s, a0, a1, a2, -1, args[3], TCG_TYPE_I64); |
141 | + tcg_out_qemu_ld(s, a0, a1, a2, args[3], TCG_TYPE_I64); | 141 | + tcg_out_qemu_ld(s, a0, a1, a2, args[3], TCG_TYPE_I64); |
142 | } | 142 | } |
143 | break; | 143 | break; |
144 | case INDEX_op_qemu_ld_i128: | 144 | case INDEX_op_qemu_ld_i128: |
145 | tcg_debug_assert(TCG_TARGET_REG_BITS == 64); | 145 | tcg_debug_assert(TCG_TARGET_REG_BITS == 64); |
146 | - tcg_out_qemu_ld(s, a0, a1, a2, -1, args[3], TCG_TYPE_I128); | 146 | - tcg_out_qemu_ld(s, a0, a1, a2, -1, args[3], TCG_TYPE_I128); |
147 | + tcg_out_qemu_ld(s, a0, a1, a2, args[3], TCG_TYPE_I128); | 147 | + tcg_out_qemu_ld(s, a0, a1, a2, args[3], TCG_TYPE_I128); |
148 | break; | 148 | break; |
149 | 149 | ||
150 | case INDEX_op_qemu_st_i32: | 150 | case INDEX_op_qemu_st_i32: |
151 | case INDEX_op_qemu_st8_i32: | 151 | case INDEX_op_qemu_st8_i32: |
152 | - tcg_out_qemu_st(s, a0, -1, a1, -1, a2, TCG_TYPE_I32); | 152 | - tcg_out_qemu_st(s, a0, -1, a1, -1, a2, TCG_TYPE_I32); |
153 | + tcg_out_qemu_st(s, a0, -1, a1, a2, TCG_TYPE_I32); | 153 | + tcg_out_qemu_st(s, a0, -1, a1, a2, TCG_TYPE_I32); |
154 | break; | 154 | break; |
155 | case INDEX_op_qemu_st_i64: | 155 | case INDEX_op_qemu_st_i64: |
156 | if (TCG_TARGET_REG_BITS == 64) { | 156 | if (TCG_TARGET_REG_BITS == 64) { |
157 | - tcg_out_qemu_st(s, a0, -1, a1, -1, a2, TCG_TYPE_I64); | 157 | - tcg_out_qemu_st(s, a0, -1, a1, -1, a2, TCG_TYPE_I64); |
158 | + tcg_out_qemu_st(s, a0, -1, a1, a2, TCG_TYPE_I64); | 158 | + tcg_out_qemu_st(s, a0, -1, a1, a2, TCG_TYPE_I64); |
159 | } else { | 159 | } else { |
160 | - tcg_out_qemu_st(s, a0, a1, a2, -1, args[3], TCG_TYPE_I64); | 160 | - tcg_out_qemu_st(s, a0, a1, a2, -1, args[3], TCG_TYPE_I64); |
161 | + tcg_out_qemu_st(s, a0, a1, a2, args[3], TCG_TYPE_I64); | 161 | + tcg_out_qemu_st(s, a0, a1, a2, args[3], TCG_TYPE_I64); |
162 | } | 162 | } |
163 | break; | 163 | break; |
164 | case INDEX_op_qemu_st_i128: | 164 | case INDEX_op_qemu_st_i128: |
165 | tcg_debug_assert(TCG_TARGET_REG_BITS == 64); | 165 | tcg_debug_assert(TCG_TARGET_REG_BITS == 64); |
166 | - tcg_out_qemu_st(s, a0, a1, a2, -1, args[3], TCG_TYPE_I128); | 166 | - tcg_out_qemu_st(s, a0, a1, a2, -1, args[3], TCG_TYPE_I128); |
167 | + tcg_out_qemu_st(s, a0, a1, a2, args[3], TCG_TYPE_I128); | 167 | + tcg_out_qemu_st(s, a0, a1, a2, args[3], TCG_TYPE_I128); |
168 | break; | 168 | break; |
169 | 169 | ||
170 | OP_32_64(mulu2): | 170 | OP_32_64(mulu2): |
171 | -- | 171 | -- |
172 | 2.43.0 | 172 | 2.43.0 |
173 | 173 | ||
174 | 174 | diff view generated by jsdifflib |
1 | The guest address will now always fit in one register. | 1 | The guest address will now always fit in one register. |
---|---|---|---|
2 | 2 | ||
3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | 3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
5 | --- | 5 | --- |
6 | tcg/mips/tcg-target.c.inc | 62 ++++++++++++++------------------------- | 6 | tcg/mips/tcg-target.c.inc | 62 ++++++++++++++------------------------- |
7 | 1 file changed, 22 insertions(+), 40 deletions(-) | 7 | 1 file changed, 22 insertions(+), 40 deletions(-) |
8 | 8 | ||
9 | diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc | 9 | diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc |
10 | index XXXXXXX..XXXXXXX 100644 | 10 | index XXXXXXX..XXXXXXX 100644 |
11 | --- a/tcg/mips/tcg-target.c.inc | 11 | --- a/tcg/mips/tcg-target.c.inc |
12 | +++ b/tcg/mips/tcg-target.c.inc | 12 | +++ b/tcg/mips/tcg-target.c.inc |
13 | @@ -XXX,XX +XXX,XX @@ bool tcg_target_has_memory_bswap(MemOp memop) | 13 | @@ -XXX,XX +XXX,XX @@ bool tcg_target_has_memory_bswap(MemOp memop) |
14 | * is required and fill in @h with the host address for the fast path. | 14 | * is required and fill in @h with the host address for the fast path. |
15 | */ | 15 | */ |
16 | static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 16 | static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
17 | - TCGReg addrlo, TCGReg addrhi, | 17 | - TCGReg addrlo, TCGReg addrhi, |
18 | - MemOpIdx oi, bool is_ld) | 18 | - MemOpIdx oi, bool is_ld) |
19 | + TCGReg addr, MemOpIdx oi, bool is_ld) | 19 | + TCGReg addr, MemOpIdx oi, bool is_ld) |
20 | { | 20 | { |
21 | TCGType addr_type = s->addr_type; | 21 | TCGType addr_type = s->addr_type; |
22 | TCGLabelQemuLdst *ldst = NULL; | 22 | TCGLabelQemuLdst *ldst = NULL; |
23 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 23 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
24 | ldst = new_ldst_label(s); | 24 | ldst = new_ldst_label(s); |
25 | ldst->is_ld = is_ld; | 25 | ldst->is_ld = is_ld; |
26 | ldst->oi = oi; | 26 | ldst->oi = oi; |
27 | - ldst->addrlo_reg = addrlo; | 27 | - ldst->addrlo_reg = addrlo; |
28 | - ldst->addrhi_reg = addrhi; | 28 | - ldst->addrhi_reg = addrhi; |
29 | + ldst->addrlo_reg = addr; | 29 | + ldst->addrlo_reg = addr; |
30 | 30 | ||
31 | /* Load tlb_mask[mmu_idx] and tlb_table[mmu_idx]. */ | 31 | /* Load tlb_mask[mmu_idx] and tlb_table[mmu_idx]. */ |
32 | tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP0, TCG_AREG0, mask_off); | 32 | tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP0, TCG_AREG0, mask_off); |
33 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 33 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
34 | 34 | ||
35 | /* Extract the TLB index from the address into TMP3. */ | 35 | /* Extract the TLB index from the address into TMP3. */ |
36 | if (TCG_TARGET_REG_BITS == 32 || addr_type == TCG_TYPE_I32) { | 36 | if (TCG_TARGET_REG_BITS == 32 || addr_type == TCG_TYPE_I32) { |
37 | - tcg_out_opc_sa(s, OPC_SRL, TCG_TMP3, addrlo, | 37 | - tcg_out_opc_sa(s, OPC_SRL, TCG_TMP3, addrlo, |
38 | + tcg_out_opc_sa(s, OPC_SRL, TCG_TMP3, addr, | 38 | + tcg_out_opc_sa(s, OPC_SRL, TCG_TMP3, addr, |
39 | s->page_bits - CPU_TLB_ENTRY_BITS); | 39 | s->page_bits - CPU_TLB_ENTRY_BITS); |
40 | } else { | 40 | } else { |
41 | - tcg_out_dsrl(s, TCG_TMP3, addrlo, | 41 | - tcg_out_dsrl(s, TCG_TMP3, addrlo, |
42 | - s->page_bits - CPU_TLB_ENTRY_BITS); | 42 | - s->page_bits - CPU_TLB_ENTRY_BITS); |
43 | + tcg_out_dsrl(s, TCG_TMP3, addr, s->page_bits - CPU_TLB_ENTRY_BITS); | 43 | + tcg_out_dsrl(s, TCG_TMP3, addr, s->page_bits - CPU_TLB_ENTRY_BITS); |
44 | } | 44 | } |
45 | tcg_out_opc_reg(s, OPC_AND, TCG_TMP3, TCG_TMP3, TCG_TMP0); | 45 | tcg_out_opc_reg(s, OPC_AND, TCG_TMP3, TCG_TMP3, TCG_TMP0); |
46 | 46 | ||
47 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 47 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
48 | tcg_out_opc_imm(s, (TCG_TARGET_REG_BITS == 32 | 48 | tcg_out_opc_imm(s, (TCG_TARGET_REG_BITS == 32 |
49 | || addr_type == TCG_TYPE_I32 | 49 | || addr_type == TCG_TYPE_I32 |
50 | ? OPC_ADDIU : OPC_DADDIU), | 50 | ? OPC_ADDIU : OPC_DADDIU), |
51 | - TCG_TMP2, addrlo, s_mask - a_mask); | 51 | - TCG_TMP2, addrlo, s_mask - a_mask); |
52 | + TCG_TMP2, addr, s_mask - a_mask); | 52 | + TCG_TMP2, addr, s_mask - a_mask); |
53 | tcg_out_opc_reg(s, OPC_AND, TCG_TMP1, TCG_TMP1, TCG_TMP2); | 53 | tcg_out_opc_reg(s, OPC_AND, TCG_TMP1, TCG_TMP1, TCG_TMP2); |
54 | } else { | 54 | } else { |
55 | - tcg_out_opc_reg(s, OPC_AND, TCG_TMP1, TCG_TMP1, addrlo); | 55 | - tcg_out_opc_reg(s, OPC_AND, TCG_TMP1, TCG_TMP1, addrlo); |
56 | + tcg_out_opc_reg(s, OPC_AND, TCG_TMP1, TCG_TMP1, addr); | 56 | + tcg_out_opc_reg(s, OPC_AND, TCG_TMP1, TCG_TMP1, addr); |
57 | } | 57 | } |
58 | 58 | ||
59 | /* Zero extend a 32-bit guest address for a 64-bit host. */ | 59 | /* Zero extend a 32-bit guest address for a 64-bit host. */ |
60 | if (TCG_TARGET_REG_BITS == 64 && addr_type == TCG_TYPE_I32) { | 60 | if (TCG_TARGET_REG_BITS == 64 && addr_type == TCG_TYPE_I32) { |
61 | - tcg_out_ext32u(s, TCG_TMP2, addrlo); | 61 | - tcg_out_ext32u(s, TCG_TMP2, addrlo); |
62 | - addrlo = TCG_TMP2; | 62 | - addrlo = TCG_TMP2; |
63 | + tcg_out_ext32u(s, TCG_TMP2, addr); | 63 | + tcg_out_ext32u(s, TCG_TMP2, addr); |
64 | + addr = TCG_TMP2; | 64 | + addr = TCG_TMP2; |
65 | } | 65 | } |
66 | 66 | ||
67 | ldst->label_ptr[0] = s->code_ptr; | 67 | ldst->label_ptr[0] = s->code_ptr; |
68 | tcg_out_opc_br(s, OPC_BNE, TCG_TMP1, TCG_TMP0); | 68 | tcg_out_opc_br(s, OPC_BNE, TCG_TMP1, TCG_TMP0); |
69 | 69 | ||
70 | - /* Load and test the high half tlb comparator. */ | 70 | - /* Load and test the high half tlb comparator. */ |
71 | - if (TCG_TARGET_REG_BITS == 32 && addr_type != TCG_TYPE_I32) { | 71 | - if (TCG_TARGET_REG_BITS == 32 && addr_type != TCG_TYPE_I32) { |
72 | - /* delay slot */ | 72 | - /* delay slot */ |
73 | - tcg_out_ldst(s, OPC_LW, TCG_TMP0, TCG_TMP3, cmp_off + HI_OFF); | 73 | - tcg_out_ldst(s, OPC_LW, TCG_TMP0, TCG_TMP3, cmp_off + HI_OFF); |
74 | - | 74 | - |
75 | - /* Load the tlb addend for the fast path. */ | 75 | - /* Load the tlb addend for the fast path. */ |
76 | - tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP3, TCG_TMP3, add_off); | 76 | - tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP3, TCG_TMP3, add_off); |
77 | - | 77 | - |
78 | - ldst->label_ptr[1] = s->code_ptr; | 78 | - ldst->label_ptr[1] = s->code_ptr; |
79 | - tcg_out_opc_br(s, OPC_BNE, addrhi, TCG_TMP0); | 79 | - tcg_out_opc_br(s, OPC_BNE, addrhi, TCG_TMP0); |
80 | - } | 80 | - } |
81 | - | 81 | - |
82 | /* delay slot */ | 82 | /* delay slot */ |
83 | base = TCG_TMP3; | 83 | base = TCG_TMP3; |
84 | - tcg_out_opc_reg(s, ALIAS_PADD, base, TCG_TMP3, addrlo); | 84 | - tcg_out_opc_reg(s, ALIAS_PADD, base, TCG_TMP3, addrlo); |
85 | + tcg_out_opc_reg(s, ALIAS_PADD, base, TCG_TMP3, addr); | 85 | + tcg_out_opc_reg(s, ALIAS_PADD, base, TCG_TMP3, addr); |
86 | } else { | 86 | } else { |
87 | if (a_mask && (use_mips32r6_instructions || a_bits != s_bits)) { | 87 | if (a_mask && (use_mips32r6_instructions || a_bits != s_bits)) { |
88 | ldst = new_ldst_label(s); | 88 | ldst = new_ldst_label(s); |
89 | 89 | ||
90 | ldst->is_ld = is_ld; | 90 | ldst->is_ld = is_ld; |
91 | ldst->oi = oi; | 91 | ldst->oi = oi; |
92 | - ldst->addrlo_reg = addrlo; | 92 | - ldst->addrlo_reg = addrlo; |
93 | - ldst->addrhi_reg = addrhi; | 93 | - ldst->addrhi_reg = addrhi; |
94 | + ldst->addrlo_reg = addr; | 94 | + ldst->addrlo_reg = addr; |
95 | 95 | ||
96 | /* We are expecting a_bits to max out at 7, much lower than ANDI. */ | 96 | /* We are expecting a_bits to max out at 7, much lower than ANDI. */ |
97 | tcg_debug_assert(a_bits < 16); | 97 | tcg_debug_assert(a_bits < 16); |
98 | - tcg_out_opc_imm(s, OPC_ANDI, TCG_TMP0, addrlo, a_mask); | 98 | - tcg_out_opc_imm(s, OPC_ANDI, TCG_TMP0, addrlo, a_mask); |
99 | + tcg_out_opc_imm(s, OPC_ANDI, TCG_TMP0, addr, a_mask); | 99 | + tcg_out_opc_imm(s, OPC_ANDI, TCG_TMP0, addr, a_mask); |
100 | 100 | ||
101 | ldst->label_ptr[0] = s->code_ptr; | 101 | ldst->label_ptr[0] = s->code_ptr; |
102 | if (use_mips32r6_instructions) { | 102 | if (use_mips32r6_instructions) { |
103 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 103 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
107 | - base = addrlo; | 107 | - base = addrlo; |
108 | + base = addr; | 108 | + base = addr; |
109 | if (TCG_TARGET_REG_BITS == 64 && addr_type == TCG_TYPE_I32) { | 109 | if (TCG_TARGET_REG_BITS == 64 && addr_type == TCG_TYPE_I32) { |
110 | tcg_out_ext32u(s, TCG_REG_A0, base); | 110 | tcg_out_ext32u(s, TCG_REG_A0, base); |
111 | base = TCG_REG_A0; | 111 | base = TCG_REG_A0; |
112 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_qemu_ld_unalign(TCGContext *s, TCGReg lo, TCGReg hi, | 112 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_qemu_ld_unalign(TCGContext *s, TCGReg lo, TCGReg hi, |
113 | } | 113 | } |
114 | 114 | ||
115 | static void tcg_out_qemu_ld(TCGContext *s, TCGReg datalo, TCGReg datahi, | 115 | static void tcg_out_qemu_ld(TCGContext *s, TCGReg datalo, TCGReg datahi, |
116 | - TCGReg addrlo, TCGReg addrhi, | 116 | - TCGReg addrlo, TCGReg addrhi, |
117 | - MemOpIdx oi, TCGType data_type) | 117 | - MemOpIdx oi, TCGType data_type) |
118 | + TCGReg addr, MemOpIdx oi, TCGType data_type) | 118 | + TCGReg addr, MemOpIdx oi, TCGType data_type) |
119 | { | 119 | { |
120 | MemOp opc = get_memop(oi); | 120 | MemOp opc = get_memop(oi); |
121 | TCGLabelQemuLdst *ldst; | 121 | TCGLabelQemuLdst *ldst; |
122 | HostAddress h; | 122 | HostAddress h; |
123 | 123 | ||
124 | - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, true); | 124 | - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, true); |
125 | + ldst = prepare_host_addr(s, &h, addr, oi, true); | 125 | + ldst = prepare_host_addr(s, &h, addr, oi, true); |
126 | 126 | ||
127 | if (use_mips32r6_instructions || h.aa.align >= (opc & MO_SIZE)) { | 127 | if (use_mips32r6_instructions || h.aa.align >= (opc & MO_SIZE)) { |
128 | tcg_out_qemu_ld_direct(s, datalo, datahi, h.base, opc, data_type); | 128 | tcg_out_qemu_ld_direct(s, datalo, datahi, h.base, opc, data_type); |
129 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_qemu_st_unalign(TCGContext *s, TCGReg lo, TCGReg hi, | 129 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_qemu_st_unalign(TCGContext *s, TCGReg lo, TCGReg hi, |
130 | } | 130 | } |
131 | 131 | ||
132 | static void tcg_out_qemu_st(TCGContext *s, TCGReg datalo, TCGReg datahi, | 132 | static void tcg_out_qemu_st(TCGContext *s, TCGReg datalo, TCGReg datahi, |
133 | - TCGReg addrlo, TCGReg addrhi, | 133 | - TCGReg addrlo, TCGReg addrhi, |
134 | - MemOpIdx oi, TCGType data_type) | 134 | - MemOpIdx oi, TCGType data_type) |
135 | + TCGReg addr, MemOpIdx oi, TCGType data_type) | 135 | + TCGReg addr, MemOpIdx oi, TCGType data_type) |
136 | { | 136 | { |
137 | MemOp opc = get_memop(oi); | 137 | MemOp opc = get_memop(oi); |
138 | TCGLabelQemuLdst *ldst; | 138 | TCGLabelQemuLdst *ldst; |
139 | HostAddress h; | 139 | HostAddress h; |
140 | 140 | ||
141 | - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, false); | 141 | - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, false); |
142 | + ldst = prepare_host_addr(s, &h, addr, oi, false); | 142 | + ldst = prepare_host_addr(s, &h, addr, oi, false); |
143 | 143 | ||
144 | if (use_mips32r6_instructions || h.aa.align >= (opc & MO_SIZE)) { | 144 | if (use_mips32r6_instructions || h.aa.align >= (opc & MO_SIZE)) { |
145 | tcg_out_qemu_st_direct(s, datalo, datahi, h.base, opc); | 145 | tcg_out_qemu_st_direct(s, datalo, datahi, h.base, opc); |
146 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, | 146 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, |
147 | break; | 147 | break; |
148 | 148 | ||
149 | case INDEX_op_qemu_ld_i32: | 149 | case INDEX_op_qemu_ld_i32: |
150 | - tcg_out_qemu_ld(s, a0, 0, a1, 0, a2, TCG_TYPE_I32); | 150 | - tcg_out_qemu_ld(s, a0, 0, a1, 0, a2, TCG_TYPE_I32); |
151 | + tcg_out_qemu_ld(s, a0, 0, a1, a2, TCG_TYPE_I32); | 151 | + tcg_out_qemu_ld(s, a0, 0, a1, a2, TCG_TYPE_I32); |
152 | break; | 152 | break; |
153 | case INDEX_op_qemu_ld_i64: | 153 | case INDEX_op_qemu_ld_i64: |
154 | if (TCG_TARGET_REG_BITS == 64) { | 154 | if (TCG_TARGET_REG_BITS == 64) { |
155 | - tcg_out_qemu_ld(s, a0, 0, a1, 0, a2, TCG_TYPE_I64); | 155 | - tcg_out_qemu_ld(s, a0, 0, a1, 0, a2, TCG_TYPE_I64); |
156 | + tcg_out_qemu_ld(s, a0, 0, a1, a2, TCG_TYPE_I64); | 156 | + tcg_out_qemu_ld(s, a0, 0, a1, a2, TCG_TYPE_I64); |
157 | } else { | 157 | } else { |
158 | - tcg_out_qemu_ld(s, a0, a1, a2, 0, args[3], TCG_TYPE_I64); | 158 | - tcg_out_qemu_ld(s, a0, a1, a2, 0, args[3], TCG_TYPE_I64); |
159 | + tcg_out_qemu_ld(s, a0, a1, a2, args[3], TCG_TYPE_I64); | 159 | + tcg_out_qemu_ld(s, a0, a1, a2, args[3], TCG_TYPE_I64); |
160 | } | 160 | } |
161 | break; | 161 | break; |
162 | 162 | ||
163 | case INDEX_op_qemu_st_i32: | 163 | case INDEX_op_qemu_st_i32: |
164 | - tcg_out_qemu_st(s, a0, 0, a1, 0, a2, TCG_TYPE_I32); | 164 | - tcg_out_qemu_st(s, a0, 0, a1, 0, a2, TCG_TYPE_I32); |
165 | + tcg_out_qemu_st(s, a0, 0, a1, a2, TCG_TYPE_I32); | 165 | + tcg_out_qemu_st(s, a0, 0, a1, a2, TCG_TYPE_I32); |
166 | break; | 166 | break; |
167 | case INDEX_op_qemu_st_i64: | 167 | case INDEX_op_qemu_st_i64: |
168 | if (TCG_TARGET_REG_BITS == 64) { | 168 | if (TCG_TARGET_REG_BITS == 64) { |
169 | - tcg_out_qemu_st(s, a0, 0, a1, 0, a2, TCG_TYPE_I64); | 169 | - tcg_out_qemu_st(s, a0, 0, a1, 0, a2, TCG_TYPE_I64); |
170 | + tcg_out_qemu_st(s, a0, 0, a1, a2, TCG_TYPE_I64); | 170 | + tcg_out_qemu_st(s, a0, 0, a1, a2, TCG_TYPE_I64); |
171 | } else { | 171 | } else { |
172 | - tcg_out_qemu_st(s, a0, a1, a2, 0, args[3], TCG_TYPE_I64); | 172 | - tcg_out_qemu_st(s, a0, a1, a2, 0, args[3], TCG_TYPE_I64); |
173 | + tcg_out_qemu_st(s, a0, a1, a2, args[3], TCG_TYPE_I64); | 173 | + tcg_out_qemu_st(s, a0, a1, a2, args[3], TCG_TYPE_I64); |
174 | } | 174 | } |
175 | break; | 175 | break; |
176 | 176 | ||
177 | -- | 177 | -- |
178 | 2.43.0 | 178 | 2.43.0 |
179 | 179 | ||
180 | 180 | diff view generated by jsdifflib |
1 | The guest address will now always fit in one register. | 1 | The guest address will now always fit in one register. |
---|---|---|---|
2 | 2 | ||
3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | 3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
5 | --- | 5 | --- |
6 | tcg/ppc/tcg-target.c.inc | 75 ++++++++++++---------------------------- | 6 | tcg/ppc/tcg-target.c.inc | 75 ++++++++++++---------------------------- |
7 | 1 file changed, 23 insertions(+), 52 deletions(-) | 7 | 1 file changed, 23 insertions(+), 52 deletions(-) |
8 | 8 | ||
9 | diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc | 9 | diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc |
10 | index XXXXXXX..XXXXXXX 100644 | 10 | index XXXXXXX..XXXXXXX 100644 |
11 | --- a/tcg/ppc/tcg-target.c.inc | 11 | --- a/tcg/ppc/tcg-target.c.inc |
12 | +++ b/tcg/ppc/tcg-target.c.inc | 12 | +++ b/tcg/ppc/tcg-target.c.inc |
13 | @@ -XXX,XX +XXX,XX @@ bool tcg_target_has_memory_bswap(MemOp memop) | 13 | @@ -XXX,XX +XXX,XX @@ bool tcg_target_has_memory_bswap(MemOp memop) |
14 | * is required and fill in @h with the host address for the fast path. | 14 | * is required and fill in @h with the host address for the fast path. |
15 | */ | 15 | */ |
16 | static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 16 | static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
17 | - TCGReg addrlo, TCGReg addrhi, | 17 | - TCGReg addrlo, TCGReg addrhi, |
18 | - MemOpIdx oi, bool is_ld) | 18 | - MemOpIdx oi, bool is_ld) |
19 | + TCGReg addr, MemOpIdx oi, bool is_ld) | 19 | + TCGReg addr, MemOpIdx oi, bool is_ld) |
20 | { | 20 | { |
21 | TCGType addr_type = s->addr_type; | 21 | TCGType addr_type = s->addr_type; |
22 | TCGLabelQemuLdst *ldst = NULL; | 22 | TCGLabelQemuLdst *ldst = NULL; |
23 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 23 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
24 | ldst = new_ldst_label(s); | 24 | ldst = new_ldst_label(s); |
25 | ldst->is_ld = is_ld; | 25 | ldst->is_ld = is_ld; |
26 | ldst->oi = oi; | 26 | ldst->oi = oi; |
27 | - ldst->addrlo_reg = addrlo; | 27 | - ldst->addrlo_reg = addrlo; |
28 | - ldst->addrhi_reg = addrhi; | 28 | - ldst->addrhi_reg = addrhi; |
29 | + ldst->addrlo_reg = addr; | 29 | + ldst->addrlo_reg = addr; |
30 | 30 | ||
31 | /* Load tlb_mask[mmu_idx] and tlb_table[mmu_idx]. */ | 31 | /* Load tlb_mask[mmu_idx] and tlb_table[mmu_idx]. */ |
32 | tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_AREG0, mask_off); | 32 | tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_AREG0, mask_off); |
33 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 33 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
34 | 34 | ||
35 | /* Extract the page index, shifted into place for tlb index. */ | 35 | /* Extract the page index, shifted into place for tlb index. */ |
36 | if (TCG_TARGET_REG_BITS == 32) { | 36 | if (TCG_TARGET_REG_BITS == 32) { |
37 | - tcg_out_shri32(s, TCG_REG_R0, addrlo, | 37 | - tcg_out_shri32(s, TCG_REG_R0, addrlo, |
38 | + tcg_out_shri32(s, TCG_REG_R0, addr, | 38 | + tcg_out_shri32(s, TCG_REG_R0, addr, |
39 | s->page_bits - CPU_TLB_ENTRY_BITS); | 39 | s->page_bits - CPU_TLB_ENTRY_BITS); |
40 | } else { | 40 | } else { |
41 | - tcg_out_shri64(s, TCG_REG_R0, addrlo, | 41 | - tcg_out_shri64(s, TCG_REG_R0, addrlo, |
42 | + tcg_out_shri64(s, TCG_REG_R0, addr, | 42 | + tcg_out_shri64(s, TCG_REG_R0, addr, |
43 | s->page_bits - CPU_TLB_ENTRY_BITS); | 43 | s->page_bits - CPU_TLB_ENTRY_BITS); |
44 | } | 44 | } |
45 | tcg_out32(s, AND | SAB(TCG_REG_TMP1, TCG_REG_TMP1, TCG_REG_R0)); | 45 | tcg_out32(s, AND | SAB(TCG_REG_TMP1, TCG_REG_TMP1, TCG_REG_R0)); |
46 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 46 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
47 | if (a_bits < s_bits) { | 47 | if (a_bits < s_bits) { |
48 | a_bits = s_bits; | 48 | a_bits = s_bits; |
49 | } | 49 | } |
50 | - tcg_out_rlw(s, RLWINM, TCG_REG_R0, addrlo, 0, | 50 | - tcg_out_rlw(s, RLWINM, TCG_REG_R0, addrlo, 0, |
51 | + tcg_out_rlw(s, RLWINM, TCG_REG_R0, addr, 0, | 51 | + tcg_out_rlw(s, RLWINM, TCG_REG_R0, addr, 0, |
52 | (32 - a_bits) & 31, 31 - s->page_bits); | 52 | (32 - a_bits) & 31, 31 - s->page_bits); |
53 | } else { | 53 | } else { |
54 | - TCGReg t = addrlo; | 54 | - TCGReg t = addrlo; |
55 | + TCGReg t = addr; | 55 | + TCGReg t = addr; |
56 | 56 | ||
57 | /* | 57 | /* |
58 | * If the access is unaligned, we need to make sure we fail if we | 58 | * If the access is unaligned, we need to make sure we fail if we |
59 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 59 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
60 | } | 60 | } |
61 | } | 61 | } |
62 | 62 | ||
63 | - if (TCG_TARGET_REG_BITS == 32 && addr_type != TCG_TYPE_I32) { | 63 | - if (TCG_TARGET_REG_BITS == 32 && addr_type != TCG_TYPE_I32) { |
64 | - /* Low part comparison into cr7. */ | 64 | - /* Low part comparison into cr7. */ |
65 | - tcg_out_cmp(s, TCG_COND_EQ, TCG_REG_R0, TCG_REG_TMP2, | 65 | - tcg_out_cmp(s, TCG_COND_EQ, TCG_REG_R0, TCG_REG_TMP2, |
66 | - 0, 7, TCG_TYPE_I32); | 66 | - 0, 7, TCG_TYPE_I32); |
67 | - | 67 | - |
68 | - /* Load the high part TLB comparator into TMP2. */ | 68 | - /* Load the high part TLB comparator into TMP2. */ |
69 | - tcg_out_ld(s, TCG_TYPE_I32, TCG_REG_TMP2, TCG_REG_TMP1, | 69 | - tcg_out_ld(s, TCG_TYPE_I32, TCG_REG_TMP2, TCG_REG_TMP1, |
70 | - cmp_off + 4 * !HOST_BIG_ENDIAN); | 70 | - cmp_off + 4 * !HOST_BIG_ENDIAN); |
71 | - | 71 | - |
72 | - /* Load addend, deferred for this case. */ | 72 | - /* Load addend, deferred for this case. */ |
73 | - tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_REG_TMP1, | 73 | - tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_REG_TMP1, |
74 | - offsetof(CPUTLBEntry, addend)); | 74 | - offsetof(CPUTLBEntry, addend)); |
75 | - | 75 | - |
76 | - /* High part comparison into cr6. */ | 76 | - /* High part comparison into cr6. */ |
77 | - tcg_out_cmp(s, TCG_COND_EQ, addrhi, TCG_REG_TMP2, | 77 | - tcg_out_cmp(s, TCG_COND_EQ, addrhi, TCG_REG_TMP2, |
78 | - 0, 6, TCG_TYPE_I32); | 78 | - 0, 6, TCG_TYPE_I32); |
79 | - | 79 | - |
80 | - /* Combine comparisons into cr0. */ | 80 | - /* Combine comparisons into cr0. */ |
81 | - tcg_out32(s, CRAND | BT(0, CR_EQ) | BA(6, CR_EQ) | BB(7, CR_EQ)); | 81 | - tcg_out32(s, CRAND | BT(0, CR_EQ) | BA(6, CR_EQ) | BB(7, CR_EQ)); |
82 | - } else { | 82 | - } else { |
83 | - /* Full comparison into cr0. */ | 83 | - /* Full comparison into cr0. */ |
84 | - tcg_out_cmp(s, TCG_COND_EQ, TCG_REG_R0, TCG_REG_TMP2, | 84 | - tcg_out_cmp(s, TCG_COND_EQ, TCG_REG_R0, TCG_REG_TMP2, |
85 | - 0, 0, addr_type); | 85 | - 0, 0, addr_type); |
86 | - } | 86 | - } |
87 | + /* Full comparison into cr0. */ | 87 | + /* Full comparison into cr0. */ |
88 | + tcg_out_cmp(s, TCG_COND_EQ, TCG_REG_R0, TCG_REG_TMP2, 0, 0, addr_type); | 88 | + tcg_out_cmp(s, TCG_COND_EQ, TCG_REG_R0, TCG_REG_TMP2, 0, 0, addr_type); |
89 | 89 | ||
90 | /* Load a pointer into the current opcode w/conditional branch-link. */ | 90 | /* Load a pointer into the current opcode w/conditional branch-link. */ |
91 | ldst->label_ptr[0] = s->code_ptr; | 91 | ldst->label_ptr[0] = s->code_ptr; |
92 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 92 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
93 | ldst = new_ldst_label(s); | 93 | ldst = new_ldst_label(s); |
94 | ldst->is_ld = is_ld; | 94 | ldst->is_ld = is_ld; |
95 | ldst->oi = oi; | 95 | ldst->oi = oi; |
96 | - ldst->addrlo_reg = addrlo; | 96 | - ldst->addrlo_reg = addrlo; |
97 | - ldst->addrhi_reg = addrhi; | 97 | - ldst->addrhi_reg = addrhi; |
98 | + ldst->addrlo_reg = addr; | 98 | + ldst->addrlo_reg = addr; |
99 | 99 | ||
100 | /* We are expecting a_bits to max out at 7, much lower than ANDI. */ | 100 | /* We are expecting a_bits to max out at 7, much lower than ANDI. */ |
101 | tcg_debug_assert(a_bits < 16); | 101 | tcg_debug_assert(a_bits < 16); |
102 | - tcg_out32(s, ANDI | SAI(addrlo, TCG_REG_R0, (1 << a_bits) - 1)); | 102 | - tcg_out32(s, ANDI | SAI(addrlo, TCG_REG_R0, (1 << a_bits) - 1)); |
103 | + tcg_out32(s, ANDI | SAI(addr, TCG_REG_R0, (1 << a_bits) - 1)); | 103 | + tcg_out32(s, ANDI | SAI(addr, TCG_REG_R0, (1 << a_bits) - 1)); |
104 | 104 | ||
105 | ldst->label_ptr[0] = s->code_ptr; | 105 | ldst->label_ptr[0] = s->code_ptr; |
106 | tcg_out32(s, BC | BI(0, CR_EQ) | BO_COND_FALSE | LK); | 106 | tcg_out32(s, BC | BI(0, CR_EQ) | BO_COND_FALSE | LK); |
107 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 107 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
108 | 108 | ||
109 | if (TCG_TARGET_REG_BITS == 64 && addr_type == TCG_TYPE_I32) { | 109 | if (TCG_TARGET_REG_BITS == 64 && addr_type == TCG_TYPE_I32) { |
110 | /* Zero-extend the guest address for use in the host address. */ | 110 | /* Zero-extend the guest address for use in the host address. */ |
111 | - tcg_out_ext32u(s, TCG_REG_TMP2, addrlo); | 111 | - tcg_out_ext32u(s, TCG_REG_TMP2, addrlo); |
112 | + tcg_out_ext32u(s, TCG_REG_TMP2, addr); | 112 | + tcg_out_ext32u(s, TCG_REG_TMP2, addr); |
113 | h->index = TCG_REG_TMP2; | 113 | h->index = TCG_REG_TMP2; |
114 | } else { | 114 | } else { |
115 | - h->index = addrlo; | 115 | - h->index = addrlo; |
116 | + h->index = addr; | 116 | + h->index = addr; |
117 | } | 117 | } |
118 | 118 | ||
119 | return ldst; | 119 | return ldst; |
120 | } | 120 | } |
121 | 121 | ||
122 | static void tcg_out_qemu_ld(TCGContext *s, TCGReg datalo, TCGReg datahi, | 122 | static void tcg_out_qemu_ld(TCGContext *s, TCGReg datalo, TCGReg datahi, |
123 | - TCGReg addrlo, TCGReg addrhi, | 123 | - TCGReg addrlo, TCGReg addrhi, |
124 | - MemOpIdx oi, TCGType data_type) | 124 | - MemOpIdx oi, TCGType data_type) |
125 | + TCGReg addr, MemOpIdx oi, TCGType data_type) | 125 | + TCGReg addr, MemOpIdx oi, TCGType data_type) |
126 | { | 126 | { |
127 | MemOp opc = get_memop(oi); | 127 | MemOp opc = get_memop(oi); |
128 | TCGLabelQemuLdst *ldst; | 128 | TCGLabelQemuLdst *ldst; |
129 | HostAddress h; | 129 | HostAddress h; |
130 | 130 | ||
131 | - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, true); | 131 | - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, true); |
132 | + ldst = prepare_host_addr(s, &h, addr, oi, true); | 132 | + ldst = prepare_host_addr(s, &h, addr, oi, true); |
133 | 133 | ||
134 | if (TCG_TARGET_REG_BITS == 32 && (opc & MO_SIZE) == MO_64) { | 134 | if (TCG_TARGET_REG_BITS == 32 && (opc & MO_SIZE) == MO_64) { |
135 | if (opc & MO_BSWAP) { | 135 | if (opc & MO_BSWAP) { |
136 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_qemu_ld(TCGContext *s, TCGReg datalo, TCGReg datahi, | 136 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_qemu_ld(TCGContext *s, TCGReg datalo, TCGReg datahi, |
137 | } | 137 | } |
138 | 138 | ||
139 | static void tcg_out_qemu_st(TCGContext *s, TCGReg datalo, TCGReg datahi, | 139 | static void tcg_out_qemu_st(TCGContext *s, TCGReg datalo, TCGReg datahi, |
140 | - TCGReg addrlo, TCGReg addrhi, | 140 | - TCGReg addrlo, TCGReg addrhi, |
141 | - MemOpIdx oi, TCGType data_type) | 141 | - MemOpIdx oi, TCGType data_type) |
142 | + TCGReg addr, MemOpIdx oi, TCGType data_type) | 142 | + TCGReg addr, MemOpIdx oi, TCGType data_type) |
143 | { | 143 | { |
144 | MemOp opc = get_memop(oi); | 144 | MemOp opc = get_memop(oi); |
145 | TCGLabelQemuLdst *ldst; | 145 | TCGLabelQemuLdst *ldst; |
146 | HostAddress h; | 146 | HostAddress h; |
147 | 147 | ||
148 | - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, false); | 148 | - ldst = prepare_host_addr(s, &h, addrlo, addrhi, oi, false); |
149 | + ldst = prepare_host_addr(s, &h, addr, oi, false); | 149 | + ldst = prepare_host_addr(s, &h, addr, oi, false); |
150 | 150 | ||
151 | if (TCG_TARGET_REG_BITS == 32 && (opc & MO_SIZE) == MO_64) { | 151 | if (TCG_TARGET_REG_BITS == 32 && (opc & MO_SIZE) == MO_64) { |
152 | if (opc & MO_BSWAP) { | 152 | if (opc & MO_BSWAP) { |
153 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_qemu_ldst_i128(TCGContext *s, TCGReg datalo, TCGReg datahi, | 153 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_qemu_ldst_i128(TCGContext *s, TCGReg datalo, TCGReg datahi, |
154 | uint32_t insn; | 154 | uint32_t insn; |
155 | TCGReg index; | 155 | TCGReg index; |
156 | 156 | ||
157 | - ldst = prepare_host_addr(s, &h, addr_reg, -1, oi, is_ld); | 157 | - ldst = prepare_host_addr(s, &h, addr_reg, -1, oi, is_ld); |
158 | + ldst = prepare_host_addr(s, &h, addr_reg, oi, is_ld); | 158 | + ldst = prepare_host_addr(s, &h, addr_reg, oi, is_ld); |
159 | 159 | ||
160 | /* Compose the final address, as LQ/STQ have no indexing. */ | 160 | /* Compose the final address, as LQ/STQ have no indexing. */ |
161 | index = h.index; | 161 | index = h.index; |
162 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, | 162 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, |
163 | break; | 163 | break; |
164 | 164 | ||
165 | case INDEX_op_qemu_ld_i32: | 165 | case INDEX_op_qemu_ld_i32: |
166 | - tcg_out_qemu_ld(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I32); | 166 | - tcg_out_qemu_ld(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I32); |
167 | + tcg_out_qemu_ld(s, args[0], -1, args[1], args[2], TCG_TYPE_I32); | 167 | + tcg_out_qemu_ld(s, args[0], -1, args[1], args[2], TCG_TYPE_I32); |
168 | break; | 168 | break; |
169 | case INDEX_op_qemu_ld_i64: | 169 | case INDEX_op_qemu_ld_i64: |
170 | if (TCG_TARGET_REG_BITS == 64) { | 170 | if (TCG_TARGET_REG_BITS == 64) { |
171 | - tcg_out_qemu_ld(s, args[0], -1, args[1], -1, | 171 | - tcg_out_qemu_ld(s, args[0], -1, args[1], -1, |
172 | - args[2], TCG_TYPE_I64); | 172 | - args[2], TCG_TYPE_I64); |
173 | + tcg_out_qemu_ld(s, args[0], -1, args[1], args[2], TCG_TYPE_I64); | 173 | + tcg_out_qemu_ld(s, args[0], -1, args[1], args[2], TCG_TYPE_I64); |
174 | } else { | 174 | } else { |
175 | - tcg_out_qemu_ld(s, args[0], args[1], args[2], -1, | 175 | - tcg_out_qemu_ld(s, args[0], args[1], args[2], -1, |
176 | + tcg_out_qemu_ld(s, args[0], args[1], args[2], | 176 | + tcg_out_qemu_ld(s, args[0], args[1], args[2], |
177 | args[3], TCG_TYPE_I64); | 177 | args[3], TCG_TYPE_I64); |
178 | } | 178 | } |
179 | break; | 179 | break; |
180 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, | 180 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, |
181 | break; | 181 | break; |
182 | 182 | ||
183 | case INDEX_op_qemu_st_i32: | 183 | case INDEX_op_qemu_st_i32: |
184 | - tcg_out_qemu_st(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I32); | 184 | - tcg_out_qemu_st(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I32); |
185 | + tcg_out_qemu_st(s, args[0], -1, args[1], args[2], TCG_TYPE_I32); | 185 | + tcg_out_qemu_st(s, args[0], -1, args[1], args[2], TCG_TYPE_I32); |
186 | break; | 186 | break; |
187 | case INDEX_op_qemu_st_i64: | 187 | case INDEX_op_qemu_st_i64: |
188 | if (TCG_TARGET_REG_BITS == 64) { | 188 | if (TCG_TARGET_REG_BITS == 64) { |
189 | - tcg_out_qemu_st(s, args[0], -1, args[1], -1, | 189 | - tcg_out_qemu_st(s, args[0], -1, args[1], -1, |
190 | - args[2], TCG_TYPE_I64); | 190 | - args[2], TCG_TYPE_I64); |
191 | + tcg_out_qemu_st(s, args[0], -1, args[1], args[2], TCG_TYPE_I64); | 191 | + tcg_out_qemu_st(s, args[0], -1, args[1], args[2], TCG_TYPE_I64); |
192 | } else { | 192 | } else { |
193 | - tcg_out_qemu_st(s, args[0], args[1], args[2], -1, | 193 | - tcg_out_qemu_st(s, args[0], args[1], args[2], -1, |
194 | + tcg_out_qemu_st(s, args[0], args[1], args[2], | 194 | + tcg_out_qemu_st(s, args[0], args[1], args[2], |
195 | args[3], TCG_TYPE_I64); | 195 | args[3], TCG_TYPE_I64); |
196 | } | 196 | } |
197 | break; | 197 | break; |
198 | -- | 198 | -- |
199 | 2.43.0 | 199 | 2.43.0 |
200 | 200 | ||
201 | 201 | diff view generated by jsdifflib |
1 | There is now always only one guest address register. | 1 | There is now always only one guest address register. |
---|---|---|---|
2 | 2 | ||
3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | 3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
5 | --- | 5 | --- |
6 | tcg/tcg.c | 18 +++++++++--------- | 6 | tcg/tcg.c | 18 +++++++++--------- |
7 | tcg/aarch64/tcg-target.c.inc | 4 ++-- | 7 | tcg/aarch64/tcg-target.c.inc | 4 ++-- |
8 | tcg/arm/tcg-target.c.inc | 4 ++-- | 8 | tcg/arm/tcg-target.c.inc | 4 ++-- |
9 | tcg/i386/tcg-target.c.inc | 4 ++-- | 9 | tcg/i386/tcg-target.c.inc | 4 ++-- |
10 | tcg/loongarch64/tcg-target.c.inc | 4 ++-- | 10 | tcg/loongarch64/tcg-target.c.inc | 4 ++-- |
11 | tcg/mips/tcg-target.c.inc | 4 ++-- | 11 | tcg/mips/tcg-target.c.inc | 4 ++-- |
12 | tcg/ppc/tcg-target.c.inc | 4 ++-- | 12 | tcg/ppc/tcg-target.c.inc | 4 ++-- |
13 | tcg/riscv/tcg-target.c.inc | 4 ++-- | 13 | tcg/riscv/tcg-target.c.inc | 4 ++-- |
14 | tcg/s390x/tcg-target.c.inc | 4 ++-- | 14 | tcg/s390x/tcg-target.c.inc | 4 ++-- |
15 | tcg/sparc64/tcg-target.c.inc | 4 ++-- | 15 | tcg/sparc64/tcg-target.c.inc | 4 ++-- |
16 | 10 files changed, 27 insertions(+), 27 deletions(-) | 16 | 10 files changed, 27 insertions(+), 27 deletions(-) |
17 | 17 | ||
18 | diff --git a/tcg/tcg.c b/tcg/tcg.c | 18 | diff --git a/tcg/tcg.c b/tcg/tcg.c |
19 | index XXXXXXX..XXXXXXX 100644 | 19 | index XXXXXXX..XXXXXXX 100644 |
20 | --- a/tcg/tcg.c | 20 | --- a/tcg/tcg.c |
21 | +++ b/tcg/tcg.c | 21 | +++ b/tcg/tcg.c |
22 | @@ -XXX,XX +XXX,XX @@ struct TCGLabelQemuLdst { | 22 | @@ -XXX,XX +XXX,XX @@ struct TCGLabelQemuLdst { |
23 | bool is_ld; /* qemu_ld: true, qemu_st: false */ | 23 | bool is_ld; /* qemu_ld: true, qemu_st: false */ |
24 | MemOpIdx oi; | 24 | MemOpIdx oi; |
25 | TCGType type; /* result type of a load */ | 25 | TCGType type; /* result type of a load */ |
26 | - TCGReg addrlo_reg; /* reg index for low word of guest virtual addr */ | 26 | - TCGReg addrlo_reg; /* reg index for low word of guest virtual addr */ |
27 | - TCGReg addrhi_reg; /* reg index for high word of guest virtual addr */ | 27 | - TCGReg addrhi_reg; /* reg index for high word of guest virtual addr */ |
28 | + TCGReg addr_reg; /* reg index for guest virtual addr */ | 28 | + TCGReg addr_reg; /* reg index for guest virtual addr */ |
29 | TCGReg datalo_reg; /* reg index for low word to be loaded or stored */ | 29 | TCGReg datalo_reg; /* reg index for low word to be loaded or stored */ |
30 | TCGReg datahi_reg; /* reg index for high word to be loaded or stored */ | 30 | TCGReg datahi_reg; /* reg index for high word to be loaded or stored */ |
31 | const tcg_insn_unit *raddr; /* addr of the next IR of qemu_ld/st IR */ | 31 | const tcg_insn_unit *raddr; /* addr of the next IR of qemu_ld/st IR */ |
32 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_ld_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst, | 32 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_ld_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst, |
33 | */ | 33 | */ |
34 | tcg_out_helper_add_mov(mov, loc + HOST_BIG_ENDIAN, | 34 | tcg_out_helper_add_mov(mov, loc + HOST_BIG_ENDIAN, |
35 | TCG_TYPE_I32, TCG_TYPE_I32, | 35 | TCG_TYPE_I32, TCG_TYPE_I32, |
36 | - ldst->addrlo_reg, -1); | 36 | - ldst->addrlo_reg, -1); |
37 | + ldst->addr_reg, -1); | 37 | + ldst->addr_reg, -1); |
38 | tcg_out_helper_load_slots(s, 1, mov, parm); | 38 | tcg_out_helper_load_slots(s, 1, mov, parm); |
39 | 39 | ||
40 | tcg_out_helper_load_imm(s, loc[!HOST_BIG_ENDIAN].arg_slot, | 40 | tcg_out_helper_load_imm(s, loc[!HOST_BIG_ENDIAN].arg_slot, |
41 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_ld_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst, | 41 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_ld_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst, |
42 | next_arg += 2; | 42 | next_arg += 2; |
43 | } else { | 43 | } else { |
44 | nmov = tcg_out_helper_add_mov(mov, loc, TCG_TYPE_I64, s->addr_type, | 44 | nmov = tcg_out_helper_add_mov(mov, loc, TCG_TYPE_I64, s->addr_type, |
45 | - ldst->addrlo_reg, ldst->addrhi_reg); | 45 | - ldst->addrlo_reg, ldst->addrhi_reg); |
46 | + ldst->addr_reg, -1); | 46 | + ldst->addr_reg, -1); |
47 | tcg_out_helper_load_slots(s, nmov, mov, parm); | 47 | tcg_out_helper_load_slots(s, nmov, mov, parm); |
48 | next_arg += nmov; | 48 | next_arg += nmov; |
49 | } | 49 | } |
50 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_st_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst, | 50 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_st_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst, |
51 | 51 | ||
52 | /* Handle addr argument. */ | 52 | /* Handle addr argument. */ |
53 | loc = &info->in[next_arg]; | 53 | loc = &info->in[next_arg]; |
54 | - if (TCG_TARGET_REG_BITS == 32 && s->addr_type == TCG_TYPE_I32) { | 54 | - if (TCG_TARGET_REG_BITS == 32 && s->addr_type == TCG_TYPE_I32) { |
55 | + tcg_debug_assert(s->addr_type <= TCG_TYPE_REG); | 55 | + tcg_debug_assert(s->addr_type <= TCG_TYPE_REG); |
56 | + if (TCG_TARGET_REG_BITS == 32) { | 56 | + if (TCG_TARGET_REG_BITS == 32) { |
57 | /* | 57 | /* |
58 | - * 32-bit host with 32-bit guest: zero-extend the guest address | 58 | - * 32-bit host with 32-bit guest: zero-extend the guest address |
59 | + * 32-bit host (and thus 32-bit guest): zero-extend the guest address | 59 | + * 32-bit host (and thus 32-bit guest): zero-extend the guest address |
60 | * to 64-bits for the helper by storing the low part. Later, | 60 | * to 64-bits for the helper by storing the low part. Later, |
61 | * after we have processed the register inputs, we will load a | 61 | * after we have processed the register inputs, we will load a |
62 | * zero for the high part. | 62 | * zero for the high part. |
63 | */ | 63 | */ |
64 | tcg_out_helper_add_mov(mov, loc + HOST_BIG_ENDIAN, | 64 | tcg_out_helper_add_mov(mov, loc + HOST_BIG_ENDIAN, |
65 | TCG_TYPE_I32, TCG_TYPE_I32, | 65 | TCG_TYPE_I32, TCG_TYPE_I32, |
66 | - ldst->addrlo_reg, -1); | 66 | - ldst->addrlo_reg, -1); |
67 | + ldst->addr_reg, -1); | 67 | + ldst->addr_reg, -1); |
68 | next_arg += 2; | 68 | next_arg += 2; |
69 | nmov += 1; | 69 | nmov += 1; |
70 | } else { | 70 | } else { |
71 | n = tcg_out_helper_add_mov(mov, loc, TCG_TYPE_I64, s->addr_type, | 71 | n = tcg_out_helper_add_mov(mov, loc, TCG_TYPE_I64, s->addr_type, |
72 | - ldst->addrlo_reg, ldst->addrhi_reg); | 72 | - ldst->addrlo_reg, ldst->addrhi_reg); |
73 | + ldst->addr_reg, -1); | 73 | + ldst->addr_reg, -1); |
74 | next_arg += n; | 74 | next_arg += n; |
75 | nmov += n; | 75 | nmov += n; |
76 | } | 76 | } |
77 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_st_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst, | 77 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_st_helper_args(TCGContext *s, const TCGLabelQemuLdst *ldst, |
78 | g_assert_not_reached(); | 78 | g_assert_not_reached(); |
79 | } | 79 | } |
80 | 80 | ||
81 | - if (TCG_TARGET_REG_BITS == 32 && s->addr_type == TCG_TYPE_I32) { | 81 | - if (TCG_TARGET_REG_BITS == 32 && s->addr_type == TCG_TYPE_I32) { |
82 | + if (TCG_TARGET_REG_BITS == 32) { | 82 | + if (TCG_TARGET_REG_BITS == 32) { |
83 | /* Zero extend the address by loading a zero for the high part. */ | 83 | /* Zero extend the address by loading a zero for the high part. */ |
84 | loc = &info->in[1 + !HOST_BIG_ENDIAN]; | 84 | loc = &info->in[1 + !HOST_BIG_ENDIAN]; |
85 | tcg_out_helper_load_imm(s, loc->arg_slot, TCG_TYPE_I32, 0, parm); | 85 | tcg_out_helper_load_imm(s, loc->arg_slot, TCG_TYPE_I32, 0, parm); |
86 | diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc | 86 | diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc |
87 | index XXXXXXX..XXXXXXX 100644 | 87 | index XXXXXXX..XXXXXXX 100644 |
88 | --- a/tcg/aarch64/tcg-target.c.inc | 88 | --- a/tcg/aarch64/tcg-target.c.inc |
89 | +++ b/tcg/aarch64/tcg-target.c.inc | 89 | +++ b/tcg/aarch64/tcg-target.c.inc |
90 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 90 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
91 | ldst = new_ldst_label(s); | 91 | ldst = new_ldst_label(s); |
92 | ldst->is_ld = is_ld; | 92 | ldst->is_ld = is_ld; |
93 | ldst->oi = oi; | 93 | ldst->oi = oi; |
94 | - ldst->addrlo_reg = addr_reg; | 94 | - ldst->addrlo_reg = addr_reg; |
95 | + ldst->addr_reg = addr_reg; | 95 | + ldst->addr_reg = addr_reg; |
96 | 96 | ||
97 | mask_type = (s->page_bits + s->tlb_dyn_max_bits > 32 | 97 | mask_type = (s->page_bits + s->tlb_dyn_max_bits > 32 |
98 | ? TCG_TYPE_I64 : TCG_TYPE_I32); | 98 | ? TCG_TYPE_I64 : TCG_TYPE_I32); |
99 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 99 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
100 | 100 | ||
101 | ldst->is_ld = is_ld; | 101 | ldst->is_ld = is_ld; |
102 | ldst->oi = oi; | 102 | ldst->oi = oi; |
103 | - ldst->addrlo_reg = addr_reg; | 103 | - ldst->addrlo_reg = addr_reg; |
104 | + ldst->addr_reg = addr_reg; | 104 | + ldst->addr_reg = addr_reg; |
105 | 105 | ||
106 | /* tst addr, #mask */ | 106 | /* tst addr, #mask */ |
107 | tcg_out_logicali(s, I3404_ANDSI, 0, TCG_REG_XZR, addr_reg, a_mask); | 107 | tcg_out_logicali(s, I3404_ANDSI, 0, TCG_REG_XZR, addr_reg, a_mask); |
108 | diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc | 108 | diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc |
109 | index XXXXXXX..XXXXXXX 100644 | 109 | index XXXXXXX..XXXXXXX 100644 |
110 | --- a/tcg/arm/tcg-target.c.inc | 110 | --- a/tcg/arm/tcg-target.c.inc |
111 | +++ b/tcg/arm/tcg-target.c.inc | 111 | +++ b/tcg/arm/tcg-target.c.inc |
112 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 112 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
113 | ldst = new_ldst_label(s); | 113 | ldst = new_ldst_label(s); |
114 | ldst->is_ld = is_ld; | 114 | ldst->is_ld = is_ld; |
115 | ldst->oi = oi; | 115 | ldst->oi = oi; |
116 | - ldst->addrlo_reg = addr; | 116 | - ldst->addrlo_reg = addr; |
117 | + ldst->addr_reg = addr; | 117 | + ldst->addr_reg = addr; |
118 | 118 | ||
119 | /* Load cpu->neg.tlb.f[mmu_idx].{mask,table} into {r0,r1}. */ | 119 | /* Load cpu->neg.tlb.f[mmu_idx].{mask,table} into {r0,r1}. */ |
120 | QEMU_BUILD_BUG_ON(offsetof(CPUTLBDescFast, mask) != 0); | 120 | QEMU_BUILD_BUG_ON(offsetof(CPUTLBDescFast, mask) != 0); |
121 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 121 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
122 | ldst = new_ldst_label(s); | 122 | ldst = new_ldst_label(s); |
123 | ldst->is_ld = is_ld; | 123 | ldst->is_ld = is_ld; |
124 | ldst->oi = oi; | 124 | ldst->oi = oi; |
125 | - ldst->addrlo_reg = addr; | 125 | - ldst->addrlo_reg = addr; |
126 | + ldst->addr_reg = addr; | 126 | + ldst->addr_reg = addr; |
127 | 127 | ||
128 | /* We are expecting alignment to max out at 7 */ | 128 | /* We are expecting alignment to max out at 7 */ |
129 | tcg_debug_assert(a_mask <= 0xff); | 129 | tcg_debug_assert(a_mask <= 0xff); |
130 | diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc | 130 | diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc |
131 | index XXXXXXX..XXXXXXX 100644 | 131 | index XXXXXXX..XXXXXXX 100644 |
132 | --- a/tcg/i386/tcg-target.c.inc | 132 | --- a/tcg/i386/tcg-target.c.inc |
133 | +++ b/tcg/i386/tcg-target.c.inc | 133 | +++ b/tcg/i386/tcg-target.c.inc |
134 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 134 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
135 | ldst = new_ldst_label(s); | 135 | ldst = new_ldst_label(s); |
136 | ldst->is_ld = is_ld; | 136 | ldst->is_ld = is_ld; |
137 | ldst->oi = oi; | 137 | ldst->oi = oi; |
138 | - ldst->addrlo_reg = addr; | 138 | - ldst->addrlo_reg = addr; |
139 | + ldst->addr_reg = addr; | 139 | + ldst->addr_reg = addr; |
140 | 140 | ||
141 | if (TCG_TARGET_REG_BITS == 64) { | 141 | if (TCG_TARGET_REG_BITS == 64) { |
142 | ttype = s->addr_type; | 142 | ttype = s->addr_type; |
143 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 143 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
144 | ldst = new_ldst_label(s); | 144 | ldst = new_ldst_label(s); |
145 | ldst->is_ld = is_ld; | 145 | ldst->is_ld = is_ld; |
146 | ldst->oi = oi; | 146 | ldst->oi = oi; |
147 | - ldst->addrlo_reg = addr; | 147 | - ldst->addrlo_reg = addr; |
148 | + ldst->addr_reg = addr; | 148 | + ldst->addr_reg = addr; |
149 | 149 | ||
150 | /* jne slow_path */ | 150 | /* jne slow_path */ |
151 | jcc = tcg_out_cmp(s, TCG_COND_TSTNE, addr, a_mask, true, false); | 151 | jcc = tcg_out_cmp(s, TCG_COND_TSTNE, addr, a_mask, true, false); |
152 | diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc | 152 | diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc |
153 | index XXXXXXX..XXXXXXX 100644 | 153 | index XXXXXXX..XXXXXXX 100644 |
154 | --- a/tcg/loongarch64/tcg-target.c.inc | 154 | --- a/tcg/loongarch64/tcg-target.c.inc |
155 | +++ b/tcg/loongarch64/tcg-target.c.inc | 155 | +++ b/tcg/loongarch64/tcg-target.c.inc |
156 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 156 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
157 | ldst = new_ldst_label(s); | 157 | ldst = new_ldst_label(s); |
158 | ldst->is_ld = is_ld; | 158 | ldst->is_ld = is_ld; |
159 | ldst->oi = oi; | 159 | ldst->oi = oi; |
160 | - ldst->addrlo_reg = addr_reg; | 160 | - ldst->addrlo_reg = addr_reg; |
161 | + ldst->addr_reg = addr_reg; | 161 | + ldst->addr_reg = addr_reg; |
162 | 162 | ||
163 | tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP0, TCG_AREG0, mask_ofs); | 163 | tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP0, TCG_AREG0, mask_ofs); |
164 | tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_AREG0, table_ofs); | 164 | tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_AREG0, table_ofs); |
165 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 165 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
166 | 166 | ||
167 | ldst->is_ld = is_ld; | 167 | ldst->is_ld = is_ld; |
168 | ldst->oi = oi; | 168 | ldst->oi = oi; |
169 | - ldst->addrlo_reg = addr_reg; | 169 | - ldst->addrlo_reg = addr_reg; |
170 | + ldst->addr_reg = addr_reg; | 170 | + ldst->addr_reg = addr_reg; |
171 | 171 | ||
172 | /* | 172 | /* |
173 | * Without micro-architecture details, we don't know which of | 173 | * Without micro-architecture details, we don't know which of |
174 | diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc | 174 | diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc |
175 | index XXXXXXX..XXXXXXX 100644 | 175 | index XXXXXXX..XXXXXXX 100644 |
176 | --- a/tcg/mips/tcg-target.c.inc | 176 | --- a/tcg/mips/tcg-target.c.inc |
177 | +++ b/tcg/mips/tcg-target.c.inc | 177 | +++ b/tcg/mips/tcg-target.c.inc |
178 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 178 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
179 | ldst = new_ldst_label(s); | 179 | ldst = new_ldst_label(s); |
180 | ldst->is_ld = is_ld; | 180 | ldst->is_ld = is_ld; |
181 | ldst->oi = oi; | 181 | ldst->oi = oi; |
182 | - ldst->addrlo_reg = addr; | 182 | - ldst->addrlo_reg = addr; |
183 | + ldst->addr_reg = addr; | 183 | + ldst->addr_reg = addr; |
184 | 184 | ||
185 | /* Load tlb_mask[mmu_idx] and tlb_table[mmu_idx]. */ | 185 | /* Load tlb_mask[mmu_idx] and tlb_table[mmu_idx]. */ |
186 | tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP0, TCG_AREG0, mask_off); | 186 | tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP0, TCG_AREG0, mask_off); |
187 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 187 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
188 | 188 | ||
189 | ldst->is_ld = is_ld; | 189 | ldst->is_ld = is_ld; |
190 | ldst->oi = oi; | 190 | ldst->oi = oi; |
191 | - ldst->addrlo_reg = addr; | 191 | - ldst->addrlo_reg = addr; |
192 | + ldst->addr_reg = addr; | 192 | + ldst->addr_reg = addr; |
193 | 193 | ||
194 | /* We are expecting a_bits to max out at 7, much lower than ANDI. */ | 194 | /* We are expecting a_bits to max out at 7, much lower than ANDI. */ |
195 | tcg_debug_assert(a_bits < 16); | 195 | tcg_debug_assert(a_bits < 16); |
196 | diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc | 196 | diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc |
197 | index XXXXXXX..XXXXXXX 100644 | 197 | index XXXXXXX..XXXXXXX 100644 |
198 | --- a/tcg/ppc/tcg-target.c.inc | 198 | --- a/tcg/ppc/tcg-target.c.inc |
199 | +++ b/tcg/ppc/tcg-target.c.inc | 199 | +++ b/tcg/ppc/tcg-target.c.inc |
200 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 200 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
201 | ldst = new_ldst_label(s); | 201 | ldst = new_ldst_label(s); |
202 | ldst->is_ld = is_ld; | 202 | ldst->is_ld = is_ld; |
203 | ldst->oi = oi; | 203 | ldst->oi = oi; |
204 | - ldst->addrlo_reg = addr; | 204 | - ldst->addrlo_reg = addr; |
205 | + ldst->addr_reg = addr; | 205 | + ldst->addr_reg = addr; |
206 | 206 | ||
207 | /* Load tlb_mask[mmu_idx] and tlb_table[mmu_idx]. */ | 207 | /* Load tlb_mask[mmu_idx] and tlb_table[mmu_idx]. */ |
208 | tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_AREG0, mask_off); | 208 | tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, TCG_AREG0, mask_off); |
209 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 209 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
210 | ldst = new_ldst_label(s); | 210 | ldst = new_ldst_label(s); |
211 | ldst->is_ld = is_ld; | 211 | ldst->is_ld = is_ld; |
212 | ldst->oi = oi; | 212 | ldst->oi = oi; |
213 | - ldst->addrlo_reg = addr; | 213 | - ldst->addrlo_reg = addr; |
214 | + ldst->addr_reg = addr; | 214 | + ldst->addr_reg = addr; |
215 | 215 | ||
216 | /* We are expecting a_bits to max out at 7, much lower than ANDI. */ | 216 | /* We are expecting a_bits to max out at 7, much lower than ANDI. */ |
217 | tcg_debug_assert(a_bits < 16); | 217 | tcg_debug_assert(a_bits < 16); |
218 | diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc | 218 | diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc |
219 | index XXXXXXX..XXXXXXX 100644 | 219 | index XXXXXXX..XXXXXXX 100644 |
220 | --- a/tcg/riscv/tcg-target.c.inc | 220 | --- a/tcg/riscv/tcg-target.c.inc |
221 | +++ b/tcg/riscv/tcg-target.c.inc | 221 | +++ b/tcg/riscv/tcg-target.c.inc |
222 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, TCGReg *pbase, | 222 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, TCGReg *pbase, |
223 | ldst = new_ldst_label(s); | 223 | ldst = new_ldst_label(s); |
224 | ldst->is_ld = is_ld; | 224 | ldst->is_ld = is_ld; |
225 | ldst->oi = oi; | 225 | ldst->oi = oi; |
226 | - ldst->addrlo_reg = addr_reg; | 226 | - ldst->addrlo_reg = addr_reg; |
227 | + ldst->addr_reg = addr_reg; | 227 | + ldst->addr_reg = addr_reg; |
228 | 228 | ||
229 | init_setting_vtype(s); | 229 | init_setting_vtype(s); |
230 | 230 | ||
231 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, TCGReg *pbase, | 231 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, TCGReg *pbase, |
232 | ldst = new_ldst_label(s); | 232 | ldst = new_ldst_label(s); |
233 | ldst->is_ld = is_ld; | 233 | ldst->is_ld = is_ld; |
234 | ldst->oi = oi; | 234 | ldst->oi = oi; |
235 | - ldst->addrlo_reg = addr_reg; | 235 | - ldst->addrlo_reg = addr_reg; |
236 | + ldst->addr_reg = addr_reg; | 236 | + ldst->addr_reg = addr_reg; |
237 | 237 | ||
238 | init_setting_vtype(s); | 238 | init_setting_vtype(s); |
239 | 239 | ||
240 | diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc | 240 | diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc |
241 | index XXXXXXX..XXXXXXX 100644 | 241 | index XXXXXXX..XXXXXXX 100644 |
242 | --- a/tcg/s390x/tcg-target.c.inc | 242 | --- a/tcg/s390x/tcg-target.c.inc |
243 | +++ b/tcg/s390x/tcg-target.c.inc | 243 | +++ b/tcg/s390x/tcg-target.c.inc |
244 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 244 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
245 | ldst = new_ldst_label(s); | 245 | ldst = new_ldst_label(s); |
246 | ldst->is_ld = is_ld; | 246 | ldst->is_ld = is_ld; |
247 | ldst->oi = oi; | 247 | ldst->oi = oi; |
248 | - ldst->addrlo_reg = addr_reg; | 248 | - ldst->addrlo_reg = addr_reg; |
249 | + ldst->addr_reg = addr_reg; | 249 | + ldst->addr_reg = addr_reg; |
250 | 250 | ||
251 | tcg_out_sh64(s, RSY_SRLG, TCG_TMP0, addr_reg, TCG_REG_NONE, | 251 | tcg_out_sh64(s, RSY_SRLG, TCG_TMP0, addr_reg, TCG_REG_NONE, |
252 | s->page_bits - CPU_TLB_ENTRY_BITS); | 252 | s->page_bits - CPU_TLB_ENTRY_BITS); |
253 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 253 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
254 | ldst = new_ldst_label(s); | 254 | ldst = new_ldst_label(s); |
255 | ldst->is_ld = is_ld; | 255 | ldst->is_ld = is_ld; |
256 | ldst->oi = oi; | 256 | ldst->oi = oi; |
257 | - ldst->addrlo_reg = addr_reg; | 257 | - ldst->addrlo_reg = addr_reg; |
258 | + ldst->addr_reg = addr_reg; | 258 | + ldst->addr_reg = addr_reg; |
259 | 259 | ||
260 | tcg_debug_assert(a_mask <= 0xffff); | 260 | tcg_debug_assert(a_mask <= 0xffff); |
261 | tcg_out_insn(s, RI, TMLL, addr_reg, a_mask); | 261 | tcg_out_insn(s, RI, TMLL, addr_reg, a_mask); |
262 | diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc | 262 | diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc |
263 | index XXXXXXX..XXXXXXX 100644 | 263 | index XXXXXXX..XXXXXXX 100644 |
264 | --- a/tcg/sparc64/tcg-target.c.inc | 264 | --- a/tcg/sparc64/tcg-target.c.inc |
265 | +++ b/tcg/sparc64/tcg-target.c.inc | 265 | +++ b/tcg/sparc64/tcg-target.c.inc |
266 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 266 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
267 | ldst = new_ldst_label(s); | 267 | ldst = new_ldst_label(s); |
268 | ldst->is_ld = is_ld; | 268 | ldst->is_ld = is_ld; |
269 | ldst->oi = oi; | 269 | ldst->oi = oi; |
270 | - ldst->addrlo_reg = addr_reg; | 270 | - ldst->addrlo_reg = addr_reg; |
271 | + ldst->addr_reg = addr_reg; | 271 | + ldst->addr_reg = addr_reg; |
272 | ldst->label_ptr[0] = s->code_ptr; | 272 | ldst->label_ptr[0] = s->code_ptr; |
273 | 273 | ||
274 | /* bne,pn %[xi]cc, label0 */ | 274 | /* bne,pn %[xi]cc, label0 */ |
275 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 275 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
276 | ldst = new_ldst_label(s); | 276 | ldst = new_ldst_label(s); |
277 | ldst->is_ld = is_ld; | 277 | ldst->is_ld = is_ld; |
278 | ldst->oi = oi; | 278 | ldst->oi = oi; |
279 | - ldst->addrlo_reg = addr_reg; | 279 | - ldst->addrlo_reg = addr_reg; |
280 | + ldst->addr_reg = addr_reg; | 280 | + ldst->addr_reg = addr_reg; |
281 | ldst->label_ptr[0] = s->code_ptr; | 281 | ldst->label_ptr[0] = s->code_ptr; |
282 | 282 | ||
283 | /* bne,pn %icc, label0 */ | 283 | /* bne,pn %icc, label0 */ |
284 | -- | 284 | -- |
285 | 2.43.0 | 285 | 2.43.0 |
286 | 286 | ||
287 | 287 | diff view generated by jsdifflib |
1 | The declaration uses uint64_t for addr. | 1 | The declaration uses uint64_t for addr. |
---|---|---|---|
2 | 2 | ||
3 | Fixes: 595cd9ce2ec ("plugins: add plugin API to read guest memory") | 3 | Fixes: 595cd9ce2ec ("plugins: add plugin API to read guest memory") |
4 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | 4 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
6 | --- | 6 | --- |
7 | plugins/api.c | 2 +- | 7 | plugins/api.c | 2 +- |
8 | 1 file changed, 1 insertion(+), 1 deletion(-) | 8 | 1 file changed, 1 insertion(+), 1 deletion(-) |
9 | 9 | ||
10 | diff --git a/plugins/api.c b/plugins/api.c | 10 | diff --git a/plugins/api.c b/plugins/api.c |
11 | index XXXXXXX..XXXXXXX 100644 | 11 | index XXXXXXX..XXXXXXX 100644 |
12 | --- a/plugins/api.c | 12 | --- a/plugins/api.c |
13 | +++ b/plugins/api.c | 13 | +++ b/plugins/api.c |
14 | @@ -XXX,XX +XXX,XX @@ GArray *qemu_plugin_get_registers(void) | 14 | @@ -XXX,XX +XXX,XX @@ GArray *qemu_plugin_get_registers(void) |
15 | return create_register_handles(regs); | 15 | return create_register_handles(regs); |
16 | } | 16 | } |
17 | 17 | ||
18 | -bool qemu_plugin_read_memory_vaddr(vaddr addr, GByteArray *data, size_t len) | 18 | -bool qemu_plugin_read_memory_vaddr(vaddr addr, GByteArray *data, size_t len) |
19 | +bool qemu_plugin_read_memory_vaddr(uint64_t addr, GByteArray *data, size_t len) | 19 | +bool qemu_plugin_read_memory_vaddr(uint64_t addr, GByteArray *data, size_t len) |
20 | { | 20 | { |
21 | g_assert(current_cpu); | 21 | g_assert(current_cpu); |
22 | 22 | ||
23 | -- | 23 | -- |
24 | 2.43.0 | 24 | 2.43.0 |
25 | 25 | ||
26 | 26 | diff view generated by jsdifflib |
1 | The declarations use vaddr for size. | 1 | The declarations use vaddr for size. |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | --- | 4 | --- |
5 | accel/tcg/cputlb.c | 4 ++-- | 5 | accel/tcg/cputlb.c | 4 ++-- |
6 | 1 file changed, 2 insertions(+), 2 deletions(-) | 6 | 1 file changed, 2 insertions(+), 2 deletions(-) |
7 | 7 | ||
8 | diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c | 8 | diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c |
9 | index XXXXXXX..XXXXXXX 100644 | 9 | index XXXXXXX..XXXXXXX 100644 |
10 | --- a/accel/tcg/cputlb.c | 10 | --- a/accel/tcg/cputlb.c |
11 | +++ b/accel/tcg/cputlb.c | 11 | +++ b/accel/tcg/cputlb.c |
12 | @@ -XXX,XX +XXX,XX @@ void tlb_set_page_full(CPUState *cpu, int mmu_idx, | 12 | @@ -XXX,XX +XXX,XX @@ void tlb_set_page_full(CPUState *cpu, int mmu_idx, |
13 | 13 | ||
14 | void tlb_set_page_with_attrs(CPUState *cpu, vaddr addr, | 14 | void tlb_set_page_with_attrs(CPUState *cpu, vaddr addr, |
15 | hwaddr paddr, MemTxAttrs attrs, int prot, | 15 | hwaddr paddr, MemTxAttrs attrs, int prot, |
16 | - int mmu_idx, uint64_t size) | 16 | - int mmu_idx, uint64_t size) |
17 | + int mmu_idx, vaddr size) | 17 | + int mmu_idx, vaddr size) |
18 | { | 18 | { |
19 | CPUTLBEntryFull full = { | 19 | CPUTLBEntryFull full = { |
20 | .phys_addr = paddr, | 20 | .phys_addr = paddr, |
21 | @@ -XXX,XX +XXX,XX @@ void tlb_set_page_with_attrs(CPUState *cpu, vaddr addr, | 21 | @@ -XXX,XX +XXX,XX @@ void tlb_set_page_with_attrs(CPUState *cpu, vaddr addr, |
22 | 22 | ||
23 | void tlb_set_page(CPUState *cpu, vaddr addr, | 23 | void tlb_set_page(CPUState *cpu, vaddr addr, |
24 | hwaddr paddr, int prot, | 24 | hwaddr paddr, int prot, |
25 | - int mmu_idx, uint64_t size) | 25 | - int mmu_idx, uint64_t size) |
26 | + int mmu_idx, vaddr size) | 26 | + int mmu_idx, vaddr size) |
27 | { | 27 | { |
28 | tlb_set_page_with_attrs(cpu, addr, paddr, MEMTXATTRS_UNSPECIFIED, | 28 | tlb_set_page_with_attrs(cpu, addr, paddr, MEMTXATTRS_UNSPECIFIED, |
29 | prot, mmu_idx, size); | 29 | prot, mmu_idx, size); |
30 | -- | 30 | -- |
31 | 2.43.0 | 31 | 2.43.0 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | DisasContextBase.pc_next has type vaddr; use the correct log format. | ||
1 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
4 | --- | ||
5 | target/loongarch/tcg/translate.c | 2 +- | ||
6 | target/loongarch/tcg/insn_trans/trans_atomic.c.inc | 2 +- | ||
7 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
8 | |||
9 | diff --git a/target/loongarch/tcg/translate.c b/target/loongarch/tcg/translate.c | ||
10 | index XXXXXXX..XXXXXXX 100644 | ||
11 | --- a/target/loongarch/tcg/translate.c | ||
12 | +++ b/target/loongarch/tcg/translate.c | ||
13 | @@ -XXX,XX +XXX,XX @@ static void loongarch_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) | ||
14 | |||
15 | if (!decode(ctx, ctx->opcode)) { | ||
16 | qemu_log_mask(LOG_UNIMP, "Error: unknown opcode. " | ||
17 | - TARGET_FMT_lx ": 0x%x\n", | ||
18 | + "0x%" VADDR_PRIx ": 0x%x\n", | ||
19 | ctx->base.pc_next, ctx->opcode); | ||
20 | generate_exception(ctx, EXCCODE_INE); | ||
21 | } | ||
22 | diff --git a/target/loongarch/tcg/insn_trans/trans_atomic.c.inc b/target/loongarch/tcg/insn_trans/trans_atomic.c.inc | ||
23 | index XXXXXXX..XXXXXXX 100644 | ||
24 | --- a/target/loongarch/tcg/insn_trans/trans_atomic.c.inc | ||
25 | +++ b/target/loongarch/tcg/insn_trans/trans_atomic.c.inc | ||
26 | @@ -XXX,XX +XXX,XX @@ static bool gen_am(DisasContext *ctx, arg_rrr *a, | ||
27 | if (a->rd != 0 && (a->rj == a->rd || a->rk == a->rd)) { | ||
28 | qemu_log_mask(LOG_GUEST_ERROR, | ||
29 | "Warning: source register overlaps destination register" | ||
30 | - "in atomic insn at pc=0x" TARGET_FMT_lx "\n", | ||
31 | + "in atomic insn at pc=0x%" VADDR_PRIx "\n", | ||
32 | ctx->base.pc_next - 4); | ||
33 | return false; | ||
34 | } | ||
35 | -- | ||
36 | 2.43.0 | diff view generated by jsdifflib |
1 | Since we no longer support 64-bit guests on 32-bit hosts, | 1 | Since we no longer support 64-bit guests on 32-bit hosts, |
---|---|---|---|
2 | we can use a 32-bit type on a 32-bit host. | 2 | we can use a 32-bit type on a 32-bit host. |
3 | 3 | ||
4 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | 4 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
6 | --- | 6 | --- |
7 | include/exec/vaddr.h | 16 +++++++++------- | 7 | include/exec/vaddr.h | 16 +++++++++------- |
8 | 1 file changed, 9 insertions(+), 7 deletions(-) | 8 | 1 file changed, 9 insertions(+), 7 deletions(-) |
9 | 9 | ||
10 | diff --git a/include/exec/vaddr.h b/include/exec/vaddr.h | 10 | diff --git a/include/exec/vaddr.h b/include/exec/vaddr.h |
11 | index XXXXXXX..XXXXXXX 100644 | 11 | index XXXXXXX..XXXXXXX 100644 |
12 | --- a/include/exec/vaddr.h | 12 | --- a/include/exec/vaddr.h |
13 | +++ b/include/exec/vaddr.h | 13 | +++ b/include/exec/vaddr.h |
14 | @@ -XXX,XX +XXX,XX @@ | 14 | @@ -XXX,XX +XXX,XX @@ |
15 | /** | 15 | /** |
16 | * vaddr: | 16 | * vaddr: |
17 | * Type wide enough to contain any #target_ulong virtual address. | 17 | * Type wide enough to contain any #target_ulong virtual address. |
18 | + * We do not support 64-bit guest on 32-host and detect at configure time. | 18 | + * We do not support 64-bit guest on 32-host and detect at configure time. |
19 | + * Therefore, a host pointer width will always fit a guest pointer. | 19 | + * Therefore, a host pointer width will always fit a guest pointer. |
20 | */ | 20 | */ |
21 | -typedef uint64_t vaddr; | 21 | -typedef uint64_t vaddr; |
22 | -#define VADDR_PRId PRId64 | 22 | -#define VADDR_PRId PRId64 |
23 | -#define VADDR_PRIu PRIu64 | 23 | -#define VADDR_PRIu PRIu64 |
24 | -#define VADDR_PRIo PRIo64 | 24 | -#define VADDR_PRIo PRIo64 |
25 | -#define VADDR_PRIx PRIx64 | 25 | -#define VADDR_PRIx PRIx64 |
26 | -#define VADDR_PRIX PRIX64 | 26 | -#define VADDR_PRIX PRIX64 |
27 | -#define VADDR_MAX UINT64_MAX | 27 | -#define VADDR_MAX UINT64_MAX |
28 | +typedef uintptr_t vaddr; | 28 | +typedef uintptr_t vaddr; |
29 | +#define VADDR_PRId PRIdPTR | 29 | +#define VADDR_PRId PRIdPTR |
30 | +#define VADDR_PRIu PRIuPTR | 30 | +#define VADDR_PRIu PRIuPTR |
31 | +#define VADDR_PRIo PRIoPTR | 31 | +#define VADDR_PRIo PRIoPTR |
32 | +#define VADDR_PRIx PRIxPTR | 32 | +#define VADDR_PRIx PRIxPTR |
33 | +#define VADDR_PRIX PRIXPTR | 33 | +#define VADDR_PRIX PRIXPTR |
34 | +#define VADDR_MAX UINTPTR_MAX | 34 | +#define VADDR_MAX UINTPTR_MAX |
35 | 35 | ||
36 | #endif | 36 | #endif |
37 | -- | 37 | -- |
38 | 2.43.0 | 38 | 2.43.0 |
39 | 39 | ||
40 | 40 | diff view generated by jsdifflib |
1 | Since we no longer support 64-bit guests on 32-bit hosts, | 1 | Since we no longer support 64-bit guests on 32-bit hosts, |
---|---|---|---|
2 | we can use a 32-bit type on a 32-bit host. This shrinks | 2 | we can use a 32-bit type on a 32-bit host. This shrinks |
3 | the size of the structure to 16 bytes on a 32-bit host. | 3 | the size of the structure to 16 bytes on a 32-bit host. |
4 | 4 | ||
5 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | 5 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
7 | --- | 7 | --- |
8 | include/exec/tlb-common.h | 10 +++++----- | 8 | include/exec/tlb-common.h | 10 +++++----- |
9 | accel/tcg/cputlb.c | 21 ++++----------------- | 9 | accel/tcg/cputlb.c | 21 ++++----------------- |
10 | tcg/arm/tcg-target.c.inc | 1 - | 10 | tcg/arm/tcg-target.c.inc | 1 - |
11 | tcg/mips/tcg-target.c.inc | 12 +++++------- | 11 | tcg/mips/tcg-target.c.inc | 12 +++++------- |
12 | tcg/ppc/tcg-target.c.inc | 21 +++++---------------- | 12 | tcg/ppc/tcg-target.c.inc | 21 +++++---------------- |
13 | 5 files changed, 19 insertions(+), 46 deletions(-) | 13 | 5 files changed, 19 insertions(+), 46 deletions(-) |
14 | 14 | ||
15 | diff --git a/include/exec/tlb-common.h b/include/exec/tlb-common.h | 15 | diff --git a/include/exec/tlb-common.h b/include/exec/tlb-common.h |
16 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/include/exec/tlb-common.h | 17 | --- a/include/exec/tlb-common.h |
18 | +++ b/include/exec/tlb-common.h | 18 | +++ b/include/exec/tlb-common.h |
19 | @@ -XXX,XX +XXX,XX @@ | 19 | @@ -XXX,XX +XXX,XX @@ |
20 | #ifndef EXEC_TLB_COMMON_H | 20 | #ifndef EXEC_TLB_COMMON_H |
21 | #define EXEC_TLB_COMMON_H 1 | 21 | #define EXEC_TLB_COMMON_H 1 |
22 | 22 | ||
23 | -#define CPU_TLB_ENTRY_BITS 5 | 23 | -#define CPU_TLB_ENTRY_BITS 5 |
24 | +#define CPU_TLB_ENTRY_BITS (HOST_LONG_BITS == 32 ? 4 : 5) | 24 | +#define CPU_TLB_ENTRY_BITS (HOST_LONG_BITS == 32 ? 4 : 5) |
25 | 25 | ||
26 | /* Minimalized TLB entry for use by TCG fast path. */ | 26 | /* Minimalized TLB entry for use by TCG fast path. */ |
27 | typedef union CPUTLBEntry { | 27 | typedef union CPUTLBEntry { |
28 | struct { | 28 | struct { |
29 | - uint64_t addr_read; | 29 | - uint64_t addr_read; |
30 | - uint64_t addr_write; | 30 | - uint64_t addr_write; |
31 | - uint64_t addr_code; | 31 | - uint64_t addr_code; |
32 | + uintptr_t addr_read; | 32 | + uintptr_t addr_read; |
33 | + uintptr_t addr_write; | 33 | + uintptr_t addr_write; |
34 | + uintptr_t addr_code; | 34 | + uintptr_t addr_code; |
35 | /* | 35 | /* |
36 | * Addend to virtual address to get host address. IO accesses | 36 | * Addend to virtual address to get host address. IO accesses |
37 | * use the corresponding iotlb value. | 37 | * use the corresponding iotlb value. |
38 | @@ -XXX,XX +XXX,XX @@ typedef union CPUTLBEntry { | 38 | @@ -XXX,XX +XXX,XX @@ typedef union CPUTLBEntry { |
39 | * Padding to get a power of two size, as well as index | 39 | * Padding to get a power of two size, as well as index |
40 | * access to addr_{read,write,code}. | 40 | * access to addr_{read,write,code}. |
41 | */ | 41 | */ |
42 | - uint64_t addr_idx[(1 << CPU_TLB_ENTRY_BITS) / sizeof(uint64_t)]; | 42 | - uint64_t addr_idx[(1 << CPU_TLB_ENTRY_BITS) / sizeof(uint64_t)]; |
43 | + uintptr_t addr_idx[(1 << CPU_TLB_ENTRY_BITS) / sizeof(uintptr_t)]; | 43 | + uintptr_t addr_idx[(1 << CPU_TLB_ENTRY_BITS) / sizeof(uintptr_t)]; |
44 | } CPUTLBEntry; | 44 | } CPUTLBEntry; |
45 | 45 | ||
46 | QEMU_BUILD_BUG_ON(sizeof(CPUTLBEntry) != (1 << CPU_TLB_ENTRY_BITS)); | 46 | QEMU_BUILD_BUG_ON(sizeof(CPUTLBEntry) != (1 << CPU_TLB_ENTRY_BITS)); |
47 | diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c | 47 | diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c |
48 | index XXXXXXX..XXXXXXX 100644 | 48 | index XXXXXXX..XXXXXXX 100644 |
49 | --- a/accel/tcg/cputlb.c | 49 | --- a/accel/tcg/cputlb.c |
50 | +++ b/accel/tcg/cputlb.c | 50 | +++ b/accel/tcg/cputlb.c |
51 | @@ -XXX,XX +XXX,XX @@ static inline uint64_t tlb_read_idx(const CPUTLBEntry *entry, | 51 | @@ -XXX,XX +XXX,XX @@ static inline uint64_t tlb_read_idx(const CPUTLBEntry *entry, |
52 | { | 52 | { |
53 | /* Do not rearrange the CPUTLBEntry structure members. */ | 53 | /* Do not rearrange the CPUTLBEntry structure members. */ |
54 | QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_read) != | 54 | QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_read) != |
55 | - MMU_DATA_LOAD * sizeof(uint64_t)); | 55 | - MMU_DATA_LOAD * sizeof(uint64_t)); |
56 | + MMU_DATA_LOAD * sizeof(uintptr_t)); | 56 | + MMU_DATA_LOAD * sizeof(uintptr_t)); |
57 | QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_write) != | 57 | QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_write) != |
58 | - MMU_DATA_STORE * sizeof(uint64_t)); | 58 | - MMU_DATA_STORE * sizeof(uint64_t)); |
59 | + MMU_DATA_STORE * sizeof(uintptr_t)); | 59 | + MMU_DATA_STORE * sizeof(uintptr_t)); |
60 | QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_code) != | 60 | QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_code) != |
61 | - MMU_INST_FETCH * sizeof(uint64_t)); | 61 | - MMU_INST_FETCH * sizeof(uint64_t)); |
62 | + MMU_INST_FETCH * sizeof(uintptr_t)); | 62 | + MMU_INST_FETCH * sizeof(uintptr_t)); |
63 | 63 | ||
64 | -#if TARGET_LONG_BITS == 32 | 64 | -#if TARGET_LONG_BITS == 32 |
65 | - /* Use qatomic_read, in case of addr_write; only care about low bits. */ | 65 | - /* Use qatomic_read, in case of addr_write; only care about low bits. */ |
66 | - const uint32_t *ptr = (uint32_t *)&entry->addr_idx[access_type]; | 66 | - const uint32_t *ptr = (uint32_t *)&entry->addr_idx[access_type]; |
67 | - ptr += HOST_BIG_ENDIAN; | 67 | - ptr += HOST_BIG_ENDIAN; |
68 | - return qatomic_read(ptr); | 68 | - return qatomic_read(ptr); |
69 | -#else | 69 | -#else |
70 | - const uint64_t *ptr = &entry->addr_idx[access_type]; | 70 | - const uint64_t *ptr = &entry->addr_idx[access_type]; |
71 | + const uintptr_t *ptr = &entry->addr_idx[access_type]; | 71 | + const uintptr_t *ptr = &entry->addr_idx[access_type]; |
72 | /* ofs might correspond to .addr_write, so use qatomic_read */ | 72 | /* ofs might correspond to .addr_write, so use qatomic_read */ |
73 | return qatomic_read(ptr); | 73 | return qatomic_read(ptr); |
74 | -#endif | 74 | -#endif |
75 | } | 75 | } |
76 | 76 | ||
77 | static inline uint64_t tlb_addr_write(const CPUTLBEntry *entry) | 77 | static inline uint64_t tlb_addr_write(const CPUTLBEntry *entry) |
78 | @@ -XXX,XX +XXX,XX @@ static void tlb_reset_dirty_range_locked(CPUTLBEntry *tlb_entry, | 78 | @@ -XXX,XX +XXX,XX @@ static void tlb_reset_dirty_range_locked(CPUTLBEntry *tlb_entry, |
79 | addr &= TARGET_PAGE_MASK; | 79 | addr &= TARGET_PAGE_MASK; |
80 | addr += tlb_entry->addend; | 80 | addr += tlb_entry->addend; |
81 | if ((addr - start) < length) { | 81 | if ((addr - start) < length) { |
82 | -#if TARGET_LONG_BITS == 32 | 82 | -#if TARGET_LONG_BITS == 32 |
83 | - uint32_t *ptr_write = (uint32_t *)&tlb_entry->addr_write; | 83 | - uint32_t *ptr_write = (uint32_t *)&tlb_entry->addr_write; |
84 | - ptr_write += HOST_BIG_ENDIAN; | 84 | - ptr_write += HOST_BIG_ENDIAN; |
85 | - qatomic_set(ptr_write, *ptr_write | TLB_NOTDIRTY); | 85 | - qatomic_set(ptr_write, *ptr_write | TLB_NOTDIRTY); |
86 | -#else | 86 | -#else |
87 | qatomic_set(&tlb_entry->addr_write, | 87 | qatomic_set(&tlb_entry->addr_write, |
88 | tlb_entry->addr_write | TLB_NOTDIRTY); | 88 | tlb_entry->addr_write | TLB_NOTDIRTY); |
89 | -#endif | 89 | -#endif |
90 | } | 90 | } |
91 | } | 91 | } |
92 | } | 92 | } |
93 | diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc | 93 | diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc |
94 | index XXXXXXX..XXXXXXX 100644 | 94 | index XXXXXXX..XXXXXXX 100644 |
95 | --- a/tcg/arm/tcg-target.c.inc | 95 | --- a/tcg/arm/tcg-target.c.inc |
96 | +++ b/tcg/arm/tcg-target.c.inc | 96 | +++ b/tcg/arm/tcg-target.c.inc |
97 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 97 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
98 | * Add the tlb_table pointer, creating the CPUTLBEntry address in R1. | 98 | * Add the tlb_table pointer, creating the CPUTLBEntry address in R1. |
99 | * Load the tlb comparator into R2 and the fast path addend into R1. | 99 | * Load the tlb comparator into R2 and the fast path addend into R1. |
100 | */ | 100 | */ |
101 | - QEMU_BUILD_BUG_ON(HOST_BIG_ENDIAN); | 101 | - QEMU_BUILD_BUG_ON(HOST_BIG_ENDIAN); |
102 | if (cmp_off == 0) { | 102 | if (cmp_off == 0) { |
103 | tcg_out_ld32_rwb(s, COND_AL, TCG_REG_R2, TCG_REG_R1, TCG_REG_R0); | 103 | tcg_out_ld32_rwb(s, COND_AL, TCG_REG_R2, TCG_REG_R1, TCG_REG_R0); |
104 | } else { | 104 | } else { |
105 | diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc | 105 | diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc |
106 | index XXXXXXX..XXXXXXX 100644 | 106 | index XXXXXXX..XXXXXXX 100644 |
107 | --- a/tcg/mips/tcg-target.c.inc | 107 | --- a/tcg/mips/tcg-target.c.inc |
108 | +++ b/tcg/mips/tcg-target.c.inc | 108 | +++ b/tcg/mips/tcg-target.c.inc |
109 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 109 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
110 | /* Add the tlb_table pointer, creating the CPUTLBEntry address. */ | 110 | /* Add the tlb_table pointer, creating the CPUTLBEntry address. */ |
111 | tcg_out_opc_reg(s, ALIAS_PADD, TCG_TMP3, TCG_TMP3, TCG_TMP1); | 111 | tcg_out_opc_reg(s, ALIAS_PADD, TCG_TMP3, TCG_TMP3, TCG_TMP1); |
112 | 112 | ||
113 | - if (TCG_TARGET_REG_BITS == 32 || addr_type == TCG_TYPE_I32) { | 113 | - if (TCG_TARGET_REG_BITS == 32 || addr_type == TCG_TYPE_I32) { |
114 | - /* Load the (low half) tlb comparator. */ | 114 | - /* Load the (low half) tlb comparator. */ |
115 | + /* Load the tlb comparator. */ | 115 | + /* Load the tlb comparator. */ |
116 | + if (TCG_TARGET_REG_BITS == 64 && addr_type == TCG_TYPE_I32) { | 116 | + if (TCG_TARGET_REG_BITS == 64 && addr_type == TCG_TYPE_I32) { |
117 | tcg_out_ld(s, TCG_TYPE_I32, TCG_TMP0, TCG_TMP3, | 117 | tcg_out_ld(s, TCG_TYPE_I32, TCG_TMP0, TCG_TMP3, |
118 | cmp_off + HOST_BIG_ENDIAN * 4); | 118 | cmp_off + HOST_BIG_ENDIAN * 4); |
119 | } else { | 119 | } else { |
120 | - tcg_out_ld(s, TCG_TYPE_I64, TCG_TMP0, TCG_TMP3, cmp_off); | 120 | - tcg_out_ld(s, TCG_TYPE_I64, TCG_TMP0, TCG_TMP3, cmp_off); |
121 | + tcg_out_ld(s, TCG_TYPE_REG, TCG_TMP0, TCG_TMP3, cmp_off); | 121 | + tcg_out_ld(s, TCG_TYPE_REG, TCG_TMP0, TCG_TMP3, cmp_off); |
122 | } | 122 | } |
123 | 123 | ||
124 | - if (TCG_TARGET_REG_BITS == 64 || addr_type == TCG_TYPE_I32) { | 124 | - if (TCG_TARGET_REG_BITS == 64 || addr_type == TCG_TYPE_I32) { |
125 | - /* Load the tlb addend for the fast path. */ | 125 | - /* Load the tlb addend for the fast path. */ |
126 | - tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP3, TCG_TMP3, add_off); | 126 | - tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP3, TCG_TMP3, add_off); |
127 | - } | 127 | - } |
128 | + /* Load the tlb addend for the fast path. */ | 128 | + /* Load the tlb addend for the fast path. */ |
129 | + tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP3, TCG_TMP3, add_off); | 129 | + tcg_out_ld(s, TCG_TYPE_PTR, TCG_TMP3, TCG_TMP3, add_off); |
130 | 130 | ||
131 | /* | 131 | /* |
132 | * Mask the page bits, keeping the alignment bits to compare against. | 132 | * Mask the page bits, keeping the alignment bits to compare against. |
133 | diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc | 133 | diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc |
134 | index XXXXXXX..XXXXXXX 100644 | 134 | index XXXXXXX..XXXXXXX 100644 |
135 | --- a/tcg/ppc/tcg-target.c.inc | 135 | --- a/tcg/ppc/tcg-target.c.inc |
136 | +++ b/tcg/ppc/tcg-target.c.inc | 136 | +++ b/tcg/ppc/tcg-target.c.inc |
137 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, | 137 | @@ -XXX,XX +XXX,XX @@ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, |
138 | tcg_out32(s, AND | SAB(TCG_REG_TMP1, TCG_REG_TMP1, TCG_REG_R0)); | 138 | tcg_out32(s, AND | SAB(TCG_REG_TMP1, TCG_REG_TMP1, TCG_REG_R0)); |
139 | 139 | ||
140 | /* | 140 | /* |
141 | - * Load the (low part) TLB comparator into TMP2. | 141 | - * Load the (low part) TLB comparator into TMP2. |
142 | + * Load the TLB comparator into TMP2. | 142 | + * Load the TLB comparator into TMP2. |
143 | * For 64-bit host, always load the entire 64-bit slot for simplicity. | 143 | * For 64-bit host, always load the entire 64-bit slot for simplicity. |
144 | * We will ignore the high bits with tcg_out_cmp(..., addr_type). | 144 | * We will ignore the high bits with tcg_out_cmp(..., addr_type). |
145 | */ | 145 | */ |
146 | - if (TCG_TARGET_REG_BITS == 64) { | 146 | - if (TCG_TARGET_REG_BITS == 64) { |
147 | - if (cmp_off == 0) { | 147 | - if (cmp_off == 0) { |
148 | - tcg_out32(s, LDUX | TAB(TCG_REG_TMP2, | 148 | - tcg_out32(s, LDUX | TAB(TCG_REG_TMP2, |
149 | - TCG_REG_TMP1, TCG_REG_TMP2)); | 149 | - TCG_REG_TMP1, TCG_REG_TMP2)); |
150 | - } else { | 150 | - } else { |
151 | - tcg_out32(s, ADD | TAB(TCG_REG_TMP1, | 151 | - tcg_out32(s, ADD | TAB(TCG_REG_TMP1, |
152 | - TCG_REG_TMP1, TCG_REG_TMP2)); | 152 | - TCG_REG_TMP1, TCG_REG_TMP2)); |
153 | - tcg_out_ld(s, TCG_TYPE_I64, TCG_REG_TMP2, | 153 | - tcg_out_ld(s, TCG_TYPE_I64, TCG_REG_TMP2, |
154 | - TCG_REG_TMP1, cmp_off); | 154 | - TCG_REG_TMP1, cmp_off); |
155 | - } | 155 | - } |
156 | - } else if (cmp_off == 0 && !HOST_BIG_ENDIAN) { | 156 | - } else if (cmp_off == 0 && !HOST_BIG_ENDIAN) { |
157 | - tcg_out32(s, LWZUX | TAB(TCG_REG_TMP2, | 157 | - tcg_out32(s, LWZUX | TAB(TCG_REG_TMP2, |
158 | - TCG_REG_TMP1, TCG_REG_TMP2)); | 158 | - TCG_REG_TMP1, TCG_REG_TMP2)); |
159 | + if (cmp_off == 0) { | 159 | + if (cmp_off == 0) { |
160 | + tcg_out32(s, (TCG_TARGET_REG_BITS == 64 ? LDUX : LWZUX) | 160 | + tcg_out32(s, (TCG_TARGET_REG_BITS == 64 ? LDUX : LWZUX) |
161 | + | TAB(TCG_REG_TMP2, TCG_REG_TMP1, TCG_REG_TMP2)); | 161 | + | TAB(TCG_REG_TMP2, TCG_REG_TMP1, TCG_REG_TMP2)); |
162 | } else { | 162 | } else { |
163 | tcg_out32(s, ADD | TAB(TCG_REG_TMP1, TCG_REG_TMP1, TCG_REG_TMP2)); | 163 | tcg_out32(s, ADD | TAB(TCG_REG_TMP1, TCG_REG_TMP1, TCG_REG_TMP2)); |
164 | - tcg_out_ld(s, TCG_TYPE_I32, TCG_REG_TMP2, TCG_REG_TMP1, | 164 | - tcg_out_ld(s, TCG_TYPE_I32, TCG_REG_TMP2, TCG_REG_TMP1, |
165 | - cmp_off + 4 * HOST_BIG_ENDIAN); | 165 | - cmp_off + 4 * HOST_BIG_ENDIAN); |
166 | + tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP2, TCG_REG_TMP1, cmp_off); | 166 | + tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP2, TCG_REG_TMP1, cmp_off); |
167 | } | 167 | } |
168 | 168 | ||
169 | /* | 169 | /* |
170 | -- | 170 | -- |
171 | 2.43.0 | 171 | 2.43.0 |
172 | 172 | ||
173 | 173 | diff view generated by jsdifflib |
1 | For loongarch, mips, riscv and sparc, a zero register is | 1 | For loongarch, mips, riscv and sparc, a zero register is |
---|---|---|---|
2 | available all the time. For aarch64, register index 31 | 2 | available all the time. For aarch64, register index 31 |
3 | depends on context: sometimes it is the stack pointer, | 3 | depends on context: sometimes it is the stack pointer, |
4 | and sometimes it is the zero register. | 4 | and sometimes it is the zero register. |
5 | 5 | ||
6 | Introduce a new general-purpose constraint which maps 0 | 6 | Introduce a new general-purpose constraint which maps 0 |
7 | to TCG_REG_ZERO, if defined. This differs from existing | 7 | to TCG_REG_ZERO, if defined. This differs from existing |
8 | constant constraints in that const_arg[*] is recorded as | 8 | constant constraints in that const_arg[*] is recorded as |
9 | false, indicating that the value is in a register. | 9 | false, indicating that the value is in a register. |
10 | 10 | ||
11 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | 11 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
12 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 12 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
13 | --- | 13 | --- |
14 | include/tcg/tcg.h | 3 ++- | 14 | include/tcg/tcg.h | 3 ++- |
15 | tcg/aarch64/tcg-target.h | 2 ++ | 15 | tcg/aarch64/tcg-target.h | 2 ++ |
16 | tcg/loongarch64/tcg-target.h | 2 ++ | 16 | tcg/loongarch64/tcg-target.h | 2 ++ |
17 | tcg/mips/tcg-target.h | 2 ++ | 17 | tcg/mips/tcg-target.h | 2 ++ |
18 | tcg/riscv/tcg-target.h | 2 ++ | 18 | tcg/riscv/tcg-target.h | 2 ++ |
19 | tcg/sparc64/tcg-target.h | 3 ++- | 19 | tcg/sparc64/tcg-target.h | 3 ++- |
20 | tcg/tcg.c | 29 ++++++++++++++++++++++------- | 20 | tcg/tcg.c | 29 ++++++++++++++++++++++------- |
21 | docs/devel/tcg-ops.rst | 4 +++- | 21 | docs/devel/tcg-ops.rst | 4 +++- |
22 | 8 files changed, 37 insertions(+), 10 deletions(-) | 22 | 8 files changed, 37 insertions(+), 10 deletions(-) |
23 | 23 | ||
24 | diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h | 24 | diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h |
25 | index XXXXXXX..XXXXXXX 100644 | 25 | index XXXXXXX..XXXXXXX 100644 |
26 | --- a/include/tcg/tcg.h | 26 | --- a/include/tcg/tcg.h |
27 | +++ b/include/tcg/tcg.h | 27 | +++ b/include/tcg/tcg.h |
28 | @@ -XXX,XX +XXX,XX @@ void tb_target_set_jmp_target(const TranslationBlock *, int, | 28 | @@ -XXX,XX +XXX,XX @@ void tb_target_set_jmp_target(const TranslationBlock *, int, |
29 | 29 | ||
30 | void tcg_set_frame(TCGContext *s, TCGReg reg, intptr_t start, intptr_t size); | 30 | void tcg_set_frame(TCGContext *s, TCGReg reg, intptr_t start, intptr_t size); |
31 | 31 | ||
32 | -#define TCG_CT_CONST 1 /* any constant of register size */ | 32 | -#define TCG_CT_CONST 1 /* any constant of register size */ |
33 | +#define TCG_CT_CONST 1 /* any constant of register size */ | 33 | +#define TCG_CT_CONST 1 /* any constant of register size */ |
34 | +#define TCG_CT_REG_ZERO 2 /* zero, in TCG_REG_ZERO */ | 34 | +#define TCG_CT_REG_ZERO 2 /* zero, in TCG_REG_ZERO */ |
35 | 35 | ||
36 | typedef struct TCGArgConstraint { | 36 | typedef struct TCGArgConstraint { |
37 | unsigned ct : 16; | 37 | unsigned ct : 16; |
38 | diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h | 38 | diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h |
39 | index XXXXXXX..XXXXXXX 100644 | 39 | index XXXXXXX..XXXXXXX 100644 |
40 | --- a/tcg/aarch64/tcg-target.h | 40 | --- a/tcg/aarch64/tcg-target.h |
41 | +++ b/tcg/aarch64/tcg-target.h | 41 | +++ b/tcg/aarch64/tcg-target.h |
42 | @@ -XXX,XX +XXX,XX @@ typedef enum { | 42 | @@ -XXX,XX +XXX,XX @@ typedef enum { |
43 | TCG_AREG0 = TCG_REG_X19, | 43 | TCG_AREG0 = TCG_REG_X19, |
44 | } TCGReg; | 44 | } TCGReg; |
45 | 45 | ||
46 | +#define TCG_REG_ZERO TCG_REG_XZR | 46 | +#define TCG_REG_ZERO TCG_REG_XZR |
47 | + | 47 | + |
48 | #define TCG_TARGET_NB_REGS 64 | 48 | #define TCG_TARGET_NB_REGS 64 |
49 | 49 | ||
50 | #endif /* AARCH64_TCG_TARGET_H */ | 50 | #endif /* AARCH64_TCG_TARGET_H */ |
51 | diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h | 51 | diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h |
52 | index XXXXXXX..XXXXXXX 100644 | 52 | index XXXXXXX..XXXXXXX 100644 |
53 | --- a/tcg/loongarch64/tcg-target.h | 53 | --- a/tcg/loongarch64/tcg-target.h |
54 | +++ b/tcg/loongarch64/tcg-target.h | 54 | +++ b/tcg/loongarch64/tcg-target.h |
55 | @@ -XXX,XX +XXX,XX @@ typedef enum { | 55 | @@ -XXX,XX +XXX,XX @@ typedef enum { |
56 | TCG_VEC_TMP0 = TCG_REG_V23, | 56 | TCG_VEC_TMP0 = TCG_REG_V23, |
57 | } TCGReg; | 57 | } TCGReg; |
58 | 58 | ||
59 | +#define TCG_REG_ZERO TCG_REG_ZERO | 59 | +#define TCG_REG_ZERO TCG_REG_ZERO |
60 | + | 60 | + |
61 | #endif /* LOONGARCH_TCG_TARGET_H */ | 61 | #endif /* LOONGARCH_TCG_TARGET_H */ |
62 | diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h | 62 | diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h |
63 | index XXXXXXX..XXXXXXX 100644 | 63 | index XXXXXXX..XXXXXXX 100644 |
64 | --- a/tcg/mips/tcg-target.h | 64 | --- a/tcg/mips/tcg-target.h |
65 | +++ b/tcg/mips/tcg-target.h | 65 | +++ b/tcg/mips/tcg-target.h |
66 | @@ -XXX,XX +XXX,XX @@ typedef enum { | 66 | @@ -XXX,XX +XXX,XX @@ typedef enum { |
67 | TCG_AREG0 = TCG_REG_S8, | 67 | TCG_AREG0 = TCG_REG_S8, |
68 | } TCGReg; | 68 | } TCGReg; |
69 | 69 | ||
70 | +#define TCG_REG_ZERO TCG_REG_ZERO | 70 | +#define TCG_REG_ZERO TCG_REG_ZERO |
71 | + | 71 | + |
72 | #endif | 72 | #endif |
73 | diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h | 73 | diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h |
74 | index XXXXXXX..XXXXXXX 100644 | 74 | index XXXXXXX..XXXXXXX 100644 |
75 | --- a/tcg/riscv/tcg-target.h | 75 | --- a/tcg/riscv/tcg-target.h |
76 | +++ b/tcg/riscv/tcg-target.h | 76 | +++ b/tcg/riscv/tcg-target.h |
77 | @@ -XXX,XX +XXX,XX @@ typedef enum { | 77 | @@ -XXX,XX +XXX,XX @@ typedef enum { |
78 | TCG_REG_TMP2 = TCG_REG_T4, | 78 | TCG_REG_TMP2 = TCG_REG_T4, |
79 | } TCGReg; | 79 | } TCGReg; |
80 | 80 | ||
81 | +#define TCG_REG_ZERO TCG_REG_ZERO | 81 | +#define TCG_REG_ZERO TCG_REG_ZERO |
82 | + | 82 | + |
83 | #endif | 83 | #endif |
84 | diff --git a/tcg/sparc64/tcg-target.h b/tcg/sparc64/tcg-target.h | 84 | diff --git a/tcg/sparc64/tcg-target.h b/tcg/sparc64/tcg-target.h |
85 | index XXXXXXX..XXXXXXX 100644 | 85 | index XXXXXXX..XXXXXXX 100644 |
86 | --- a/tcg/sparc64/tcg-target.h | 86 | --- a/tcg/sparc64/tcg-target.h |
87 | +++ b/tcg/sparc64/tcg-target.h | 87 | +++ b/tcg/sparc64/tcg-target.h |
88 | @@ -XXX,XX +XXX,XX @@ typedef enum { | 88 | @@ -XXX,XX +XXX,XX @@ typedef enum { |
89 | TCG_REG_I7, | 89 | TCG_REG_I7, |
90 | } TCGReg; | 90 | } TCGReg; |
91 | 91 | ||
92 | -#define TCG_AREG0 TCG_REG_I0 | 92 | -#define TCG_AREG0 TCG_REG_I0 |
93 | +#define TCG_AREG0 TCG_REG_I0 | 93 | +#define TCG_AREG0 TCG_REG_I0 |
94 | +#define TCG_REG_ZERO TCG_REG_G0 | 94 | +#define TCG_REG_ZERO TCG_REG_G0 |
95 | 95 | ||
96 | #endif | 96 | #endif |
97 | diff --git a/tcg/tcg.c b/tcg/tcg.c | 97 | diff --git a/tcg/tcg.c b/tcg/tcg.c |
98 | index XXXXXXX..XXXXXXX 100644 | 98 | index XXXXXXX..XXXXXXX 100644 |
99 | --- a/tcg/tcg.c | 99 | --- a/tcg/tcg.c |
100 | +++ b/tcg/tcg.c | 100 | +++ b/tcg/tcg.c |
101 | @@ -XXX,XX +XXX,XX @@ static void process_constraint_sets(void) | 101 | @@ -XXX,XX +XXX,XX @@ static void process_constraint_sets(void) |
102 | case 'i': | 102 | case 'i': |
103 | args_ct[i].ct |= TCG_CT_CONST; | 103 | args_ct[i].ct |= TCG_CT_CONST; |
104 | break; | 104 | break; |
105 | +#ifdef TCG_REG_ZERO | 105 | +#ifdef TCG_REG_ZERO |
106 | + case 'z': | 106 | + case 'z': |
107 | + args_ct[i].ct |= TCG_CT_REG_ZERO; | 107 | + args_ct[i].ct |= TCG_CT_REG_ZERO; |
108 | + break; | 108 | + break; |
109 | +#endif | 109 | +#endif |
110 | 110 | ||
111 | /* Include all of the target-specific constraints. */ | 111 | /* Include all of the target-specific constraints. */ |
112 | 112 | ||
113 | @@ -XXX,XX +XXX,XX @@ static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) | 113 | @@ -XXX,XX +XXX,XX @@ static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) |
114 | arg_ct = &args_ct[i]; | 114 | arg_ct = &args_ct[i]; |
115 | ts = arg_temp(arg); | 115 | ts = arg_temp(arg); |
116 | 116 | ||
117 | - if (ts->val_type == TEMP_VAL_CONST | 117 | - if (ts->val_type == TEMP_VAL_CONST |
118 | - && tcg_target_const_match(ts->val, arg_ct->ct, ts->type, | 118 | - && tcg_target_const_match(ts->val, arg_ct->ct, ts->type, |
119 | - op_cond, TCGOP_VECE(op))) { | 119 | - op_cond, TCGOP_VECE(op))) { |
120 | - /* constant is OK for instruction */ | 120 | - /* constant is OK for instruction */ |
121 | - const_args[i] = 1; | 121 | - const_args[i] = 1; |
122 | - new_args[i] = ts->val; | 122 | - new_args[i] = ts->val; |
123 | - continue; | 123 | - continue; |
124 | + if (ts->val_type == TEMP_VAL_CONST) { | 124 | + if (ts->val_type == TEMP_VAL_CONST) { |
125 | +#ifdef TCG_REG_ZERO | 125 | +#ifdef TCG_REG_ZERO |
126 | + if (ts->val == 0 && (arg_ct->ct & TCG_CT_REG_ZERO)) { | 126 | + if (ts->val == 0 && (arg_ct->ct & TCG_CT_REG_ZERO)) { |
127 | + /* Hardware zero register: indicate register via non-const. */ | 127 | + /* Hardware zero register: indicate register via non-const. */ |
128 | + const_args[i] = 0; | 128 | + const_args[i] = 0; |
129 | + new_args[i] = TCG_REG_ZERO; | 129 | + new_args[i] = TCG_REG_ZERO; |
130 | + continue; | 130 | + continue; |
131 | + } | 131 | + } |
132 | +#endif | 132 | +#endif |
133 | + | 133 | + |
134 | + if (tcg_target_const_match(ts->val, arg_ct->ct, ts->type, | 134 | + if (tcg_target_const_match(ts->val, arg_ct->ct, ts->type, |
135 | + op_cond, TCGOP_VECE(op))) { | 135 | + op_cond, TCGOP_VECE(op))) { |
136 | + /* constant is OK for instruction */ | 136 | + /* constant is OK for instruction */ |
137 | + const_args[i] = 1; | 137 | + const_args[i] = 1; |
138 | + new_args[i] = ts->val; | 138 | + new_args[i] = ts->val; |
139 | + continue; | 139 | + continue; |
140 | + } | 140 | + } |
141 | } | 141 | } |
142 | 142 | ||
143 | reg = ts->reg; | 143 | reg = ts->reg; |
144 | diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst | 144 | diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst |
145 | index XXXXXXX..XXXXXXX 100644 | 145 | index XXXXXXX..XXXXXXX 100644 |
146 | --- a/docs/devel/tcg-ops.rst | 146 | --- a/docs/devel/tcg-ops.rst |
147 | +++ b/docs/devel/tcg-ops.rst | 147 | +++ b/docs/devel/tcg-ops.rst |
148 | @@ -XXX,XX +XXX,XX @@ operation uses a constant input constraint which does not allow all | 148 | @@ -XXX,XX +XXX,XX @@ operation uses a constant input constraint which does not allow all |
149 | constants, it must also accept registers in order to have a fallback. | 149 | constants, it must also accept registers in order to have a fallback. |
150 | The constraint '``i``' is defined generically to accept any constant. | 150 | The constraint '``i``' is defined generically to accept any constant. |
151 | The constraint '``r``' is not defined generically, but is consistently | 151 | The constraint '``r``' is not defined generically, but is consistently |
152 | -used by each backend to indicate all registers. | 152 | -used by each backend to indicate all registers. |
153 | +used by each backend to indicate all registers. If ``TCG_REG_ZERO`` | 153 | +used by each backend to indicate all registers. If ``TCG_REG_ZERO`` |
154 | +is defined by the backend, the constraint '``z``' is defined generically | 154 | +is defined by the backend, the constraint '``z``' is defined generically |
155 | +to map constant 0 to the hardware zero register. | 155 | +to map constant 0 to the hardware zero register. |
156 | 156 | ||
157 | The movi_i32 and movi_i64 operations must accept any constants. | 157 | The movi_i32 and movi_i64 operations must accept any constants. |
158 | 158 | ||
159 | -- | 159 | -- |
160 | 2.43.0 | 160 | 2.43.0 |
161 | 161 | ||
162 | 162 | diff view generated by jsdifflib |
1 | Note that 'Z' is still used for addsub2. | 1 | Note that 'Z' is still used for addsub2. |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 3 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
4 | --- | 4 | --- |
5 | tcg/aarch64/tcg-target-con-set.h | 12 ++++----- | 5 | tcg/aarch64/tcg-target-con-set.h | 12 ++++----- |
6 | tcg/aarch64/tcg-target.c.inc | 46 ++++++++++++++------------------ | 6 | tcg/aarch64/tcg-target.c.inc | 46 ++++++++++++++------------------ |
7 | 2 files changed, 26 insertions(+), 32 deletions(-) | 7 | 2 files changed, 26 insertions(+), 32 deletions(-) |
8 | 8 | ||
9 | diff --git a/tcg/aarch64/tcg-target-con-set.h b/tcg/aarch64/tcg-target-con-set.h | 9 | diff --git a/tcg/aarch64/tcg-target-con-set.h b/tcg/aarch64/tcg-target-con-set.h |
10 | index XXXXXXX..XXXXXXX 100644 | 10 | index XXXXXXX..XXXXXXX 100644 |
11 | --- a/tcg/aarch64/tcg-target-con-set.h | 11 | --- a/tcg/aarch64/tcg-target-con-set.h |
12 | +++ b/tcg/aarch64/tcg-target-con-set.h | 12 | +++ b/tcg/aarch64/tcg-target-con-set.h |
13 | @@ -XXX,XX +XXX,XX @@ | 13 | @@ -XXX,XX +XXX,XX @@ |
14 | */ | 14 | */ |
15 | C_O0_I1(r) | 15 | C_O0_I1(r) |
16 | C_O0_I2(r, rC) | 16 | C_O0_I2(r, rC) |
17 | -C_O0_I2(rZ, r) | 17 | -C_O0_I2(rZ, r) |
18 | +C_O0_I2(rz, r) | 18 | +C_O0_I2(rz, r) |
19 | C_O0_I2(w, r) | 19 | C_O0_I2(w, r) |
20 | -C_O0_I3(rZ, rZ, r) | 20 | -C_O0_I3(rZ, rZ, r) |
21 | +C_O0_I3(rz, rz, r) | 21 | +C_O0_I3(rz, rz, r) |
22 | C_O1_I1(r, r) | 22 | C_O1_I1(r, r) |
23 | C_O1_I1(w, r) | 23 | C_O1_I1(w, r) |
24 | C_O1_I1(w, w) | 24 | C_O1_I1(w, w) |
25 | C_O1_I1(w, wr) | 25 | C_O1_I1(w, wr) |
26 | -C_O1_I2(r, 0, rZ) | 26 | -C_O1_I2(r, 0, rZ) |
27 | +C_O1_I2(r, 0, rz) | 27 | +C_O1_I2(r, 0, rz) |
28 | C_O1_I2(r, r, r) | 28 | C_O1_I2(r, r, r) |
29 | C_O1_I2(r, r, rA) | 29 | C_O1_I2(r, r, rA) |
30 | C_O1_I2(r, r, rAL) | 30 | C_O1_I2(r, r, rAL) |
31 | C_O1_I2(r, r, rC) | 31 | C_O1_I2(r, r, rC) |
32 | C_O1_I2(r, r, ri) | 32 | C_O1_I2(r, r, ri) |
33 | C_O1_I2(r, r, rL) | 33 | C_O1_I2(r, r, rL) |
34 | -C_O1_I2(r, rZ, rZ) | 34 | -C_O1_I2(r, rZ, rZ) |
35 | +C_O1_I2(r, rz, rz) | 35 | +C_O1_I2(r, rz, rz) |
36 | C_O1_I2(w, 0, w) | 36 | C_O1_I2(w, 0, w) |
37 | C_O1_I2(w, w, w) | 37 | C_O1_I2(w, w, w) |
38 | C_O1_I2(w, w, wN) | 38 | C_O1_I2(w, w, wN) |
39 | C_O1_I2(w, w, wO) | 39 | C_O1_I2(w, w, wO) |
40 | C_O1_I2(w, w, wZ) | 40 | C_O1_I2(w, w, wZ) |
41 | C_O1_I3(w, w, w, w) | 41 | C_O1_I3(w, w, w, w) |
42 | -C_O1_I4(r, r, rC, rZ, rZ) | 42 | -C_O1_I4(r, r, rC, rZ, rZ) |
43 | +C_O1_I4(r, r, rC, rz, rz) | 43 | +C_O1_I4(r, r, rC, rz, rz) |
44 | C_O2_I1(r, r, r) | 44 | C_O2_I1(r, r, r) |
45 | -C_O2_I4(r, r, rZ, rZ, rA, rMZ) | 45 | -C_O2_I4(r, r, rZ, rZ, rA, rMZ) |
46 | +C_O2_I4(r, r, rz, rz, rA, rMZ) | 46 | +C_O2_I4(r, r, rz, rz, rA, rMZ) |
47 | diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc | 47 | diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc |
48 | index XXXXXXX..XXXXXXX 100644 | 48 | index XXXXXXX..XXXXXXX 100644 |
49 | --- a/tcg/aarch64/tcg-target.c.inc | 49 | --- a/tcg/aarch64/tcg-target.c.inc |
50 | +++ b/tcg/aarch64/tcg-target.c.inc | 50 | +++ b/tcg/aarch64/tcg-target.c.inc |
51 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, | 51 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, |
52 | TCGArg a2 = args[2]; | 52 | TCGArg a2 = args[2]; |
53 | int c2 = const_args[2]; | 53 | int c2 = const_args[2]; |
54 | 54 | ||
55 | - /* Some operands are defined with "rZ" constraint, a register or | 55 | - /* Some operands are defined with "rZ" constraint, a register or |
56 | - the zero register. These need not actually test args[I] == 0. */ | 56 | - the zero register. These need not actually test args[I] == 0. */ |
57 | -#define REG0(I) (const_args[I] ? TCG_REG_XZR : (TCGReg)args[I]) | 57 | -#define REG0(I) (const_args[I] ? TCG_REG_XZR : (TCGReg)args[I]) |
58 | - | 58 | - |
59 | switch (opc) { | 59 | switch (opc) { |
60 | case INDEX_op_goto_ptr: | 60 | case INDEX_op_goto_ptr: |
61 | tcg_out_insn(s, 3207, BR, a0); | 61 | tcg_out_insn(s, 3207, BR, a0); |
62 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, | 62 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, |
63 | 63 | ||
64 | case INDEX_op_st8_i32: | 64 | case INDEX_op_st8_i32: |
65 | case INDEX_op_st8_i64: | 65 | case INDEX_op_st8_i64: |
66 | - tcg_out_ldst(s, I3312_STRB, REG0(0), a1, a2, 0); | 66 | - tcg_out_ldst(s, I3312_STRB, REG0(0), a1, a2, 0); |
67 | + tcg_out_ldst(s, I3312_STRB, a0, a1, a2, 0); | 67 | + tcg_out_ldst(s, I3312_STRB, a0, a1, a2, 0); |
68 | break; | 68 | break; |
69 | case INDEX_op_st16_i32: | 69 | case INDEX_op_st16_i32: |
70 | case INDEX_op_st16_i64: | 70 | case INDEX_op_st16_i64: |
71 | - tcg_out_ldst(s, I3312_STRH, REG0(0), a1, a2, 1); | 71 | - tcg_out_ldst(s, I3312_STRH, REG0(0), a1, a2, 1); |
72 | + tcg_out_ldst(s, I3312_STRH, a0, a1, a2, 1); | 72 | + tcg_out_ldst(s, I3312_STRH, a0, a1, a2, 1); |
73 | break; | 73 | break; |
74 | case INDEX_op_st_i32: | 74 | case INDEX_op_st_i32: |
75 | case INDEX_op_st32_i64: | 75 | case INDEX_op_st32_i64: |
76 | - tcg_out_ldst(s, I3312_STRW, REG0(0), a1, a2, 2); | 76 | - tcg_out_ldst(s, I3312_STRW, REG0(0), a1, a2, 2); |
77 | + tcg_out_ldst(s, I3312_STRW, a0, a1, a2, 2); | 77 | + tcg_out_ldst(s, I3312_STRW, a0, a1, a2, 2); |
78 | break; | 78 | break; |
79 | case INDEX_op_st_i64: | 79 | case INDEX_op_st_i64: |
80 | - tcg_out_ldst(s, I3312_STRX, REG0(0), a1, a2, 3); | 80 | - tcg_out_ldst(s, I3312_STRX, REG0(0), a1, a2, 3); |
81 | + tcg_out_ldst(s, I3312_STRX, a0, a1, a2, 3); | 81 | + tcg_out_ldst(s, I3312_STRX, a0, a1, a2, 3); |
82 | break; | 82 | break; |
83 | 83 | ||
84 | case INDEX_op_add_i32: | 84 | case INDEX_op_add_i32: |
85 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, | 85 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, |
86 | /* FALLTHRU */ | 86 | /* FALLTHRU */ |
87 | case INDEX_op_movcond_i64: | 87 | case INDEX_op_movcond_i64: |
88 | tcg_out_cmp(s, ext, args[5], a1, a2, c2); | 88 | tcg_out_cmp(s, ext, args[5], a1, a2, c2); |
89 | - tcg_out_insn(s, 3506, CSEL, ext, a0, REG0(3), REG0(4), args[5]); | 89 | - tcg_out_insn(s, 3506, CSEL, ext, a0, REG0(3), REG0(4), args[5]); |
90 | + tcg_out_insn(s, 3506, CSEL, ext, a0, args[3], args[4], args[5]); | 90 | + tcg_out_insn(s, 3506, CSEL, ext, a0, args[3], args[4], args[5]); |
91 | break; | 91 | break; |
92 | 92 | ||
93 | case INDEX_op_qemu_ld_i32: | 93 | case INDEX_op_qemu_ld_i32: |
94 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, | 94 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, |
95 | break; | 95 | break; |
96 | case INDEX_op_qemu_st_i32: | 96 | case INDEX_op_qemu_st_i32: |
97 | case INDEX_op_qemu_st_i64: | 97 | case INDEX_op_qemu_st_i64: |
98 | - tcg_out_qemu_st(s, REG0(0), a1, a2, ext); | 98 | - tcg_out_qemu_st(s, REG0(0), a1, a2, ext); |
99 | + tcg_out_qemu_st(s, a0, a1, a2, ext); | 99 | + tcg_out_qemu_st(s, a0, a1, a2, ext); |
100 | break; | 100 | break; |
101 | case INDEX_op_qemu_ld_i128: | 101 | case INDEX_op_qemu_ld_i128: |
102 | tcg_out_qemu_ldst_i128(s, a0, a1, a2, args[3], true); | 102 | tcg_out_qemu_ldst_i128(s, a0, a1, a2, args[3], true); |
103 | break; | 103 | break; |
104 | case INDEX_op_qemu_st_i128: | 104 | case INDEX_op_qemu_st_i128: |
105 | - tcg_out_qemu_ldst_i128(s, REG0(0), REG0(1), a2, args[3], false); | 105 | - tcg_out_qemu_ldst_i128(s, REG0(0), REG0(1), a2, args[3], false); |
106 | + tcg_out_qemu_ldst_i128(s, a0, a1, a2, args[3], false); | 106 | + tcg_out_qemu_ldst_i128(s, a0, a1, a2, args[3], false); |
107 | break; | 107 | break; |
108 | 108 | ||
109 | case INDEX_op_bswap64_i64: | 109 | case INDEX_op_bswap64_i64: |
110 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, | 110 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, |
111 | 111 | ||
112 | case INDEX_op_deposit_i64: | 112 | case INDEX_op_deposit_i64: |
113 | case INDEX_op_deposit_i32: | 113 | case INDEX_op_deposit_i32: |
114 | - tcg_out_dep(s, ext, a0, REG0(2), args[3], args[4]); | 114 | - tcg_out_dep(s, ext, a0, REG0(2), args[3], args[4]); |
115 | + tcg_out_dep(s, ext, a0, a2, args[3], args[4]); | 115 | + tcg_out_dep(s, ext, a0, a2, args[3], args[4]); |
116 | break; | 116 | break; |
117 | 117 | ||
118 | case INDEX_op_extract_i64: | 118 | case INDEX_op_extract_i64: |
119 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, | 119 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, |
120 | 120 | ||
121 | case INDEX_op_extract2_i64: | 121 | case INDEX_op_extract2_i64: |
122 | case INDEX_op_extract2_i32: | 122 | case INDEX_op_extract2_i32: |
123 | - tcg_out_extr(s, ext, a0, REG0(2), REG0(1), args[3]); | 123 | - tcg_out_extr(s, ext, a0, REG0(2), REG0(1), args[3]); |
124 | + tcg_out_extr(s, ext, a0, a2, a1, args[3]); | 124 | + tcg_out_extr(s, ext, a0, a2, a1, args[3]); |
125 | break; | 125 | break; |
126 | 126 | ||
127 | case INDEX_op_add2_i32: | 127 | case INDEX_op_add2_i32: |
128 | - tcg_out_addsub2(s, TCG_TYPE_I32, a0, a1, REG0(2), REG0(3), | 128 | - tcg_out_addsub2(s, TCG_TYPE_I32, a0, a1, REG0(2), REG0(3), |
129 | + tcg_out_addsub2(s, TCG_TYPE_I32, a0, a1, a2, args[3], | 129 | + tcg_out_addsub2(s, TCG_TYPE_I32, a0, a1, a2, args[3], |
130 | (int32_t)args[4], args[5], const_args[4], | 130 | (int32_t)args[4], args[5], const_args[4], |
131 | const_args[5], false); | 131 | const_args[5], false); |
132 | break; | 132 | break; |
133 | case INDEX_op_add2_i64: | 133 | case INDEX_op_add2_i64: |
134 | - tcg_out_addsub2(s, TCG_TYPE_I64, a0, a1, REG0(2), REG0(3), args[4], | 134 | - tcg_out_addsub2(s, TCG_TYPE_I64, a0, a1, REG0(2), REG0(3), args[4], |
135 | + tcg_out_addsub2(s, TCG_TYPE_I64, a0, a1, a2, args[3], args[4], | 135 | + tcg_out_addsub2(s, TCG_TYPE_I64, a0, a1, a2, args[3], args[4], |
136 | args[5], const_args[4], const_args[5], false); | 136 | args[5], const_args[4], const_args[5], false); |
137 | break; | 137 | break; |
138 | case INDEX_op_sub2_i32: | 138 | case INDEX_op_sub2_i32: |
139 | - tcg_out_addsub2(s, TCG_TYPE_I32, a0, a1, REG0(2), REG0(3), | 139 | - tcg_out_addsub2(s, TCG_TYPE_I32, a0, a1, REG0(2), REG0(3), |
140 | + tcg_out_addsub2(s, TCG_TYPE_I32, a0, a1, a2, args[3], | 140 | + tcg_out_addsub2(s, TCG_TYPE_I32, a0, a1, a2, args[3], |
141 | (int32_t)args[4], args[5], const_args[4], | 141 | (int32_t)args[4], args[5], const_args[4], |
142 | const_args[5], true); | 142 | const_args[5], true); |
143 | break; | 143 | break; |
144 | case INDEX_op_sub2_i64: | 144 | case INDEX_op_sub2_i64: |
145 | - tcg_out_addsub2(s, TCG_TYPE_I64, a0, a1, REG0(2), REG0(3), args[4], | 145 | - tcg_out_addsub2(s, TCG_TYPE_I64, a0, a1, REG0(2), REG0(3), args[4], |
146 | + tcg_out_addsub2(s, TCG_TYPE_I64, a0, a1, a2, args[3], args[4], | 146 | + tcg_out_addsub2(s, TCG_TYPE_I64, a0, a1, a2, args[3], args[4], |
147 | args[5], const_args[4], const_args[5], true); | 147 | args[5], const_args[4], const_args[5], true); |
148 | break; | 148 | break; |
149 | 149 | ||
150 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, | 150 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType ext, |
151 | default: | 151 | default: |
152 | g_assert_not_reached(); | 152 | g_assert_not_reached(); |
153 | } | 153 | } |
154 | - | 154 | - |
155 | -#undef REG0 | 155 | -#undef REG0 |
156 | } | 156 | } |
157 | 157 | ||
158 | static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, | 158 | static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, |
159 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 159 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
160 | case INDEX_op_st16_i64: | 160 | case INDEX_op_st16_i64: |
161 | case INDEX_op_st32_i64: | 161 | case INDEX_op_st32_i64: |
162 | case INDEX_op_st_i64: | 162 | case INDEX_op_st_i64: |
163 | - return C_O0_I2(rZ, r); | 163 | - return C_O0_I2(rZ, r); |
164 | + return C_O0_I2(rz, r); | 164 | + return C_O0_I2(rz, r); |
165 | 165 | ||
166 | case INDEX_op_add_i32: | 166 | case INDEX_op_add_i32: |
167 | case INDEX_op_add_i64: | 167 | case INDEX_op_add_i64: |
168 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 168 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
169 | 169 | ||
170 | case INDEX_op_movcond_i32: | 170 | case INDEX_op_movcond_i32: |
171 | case INDEX_op_movcond_i64: | 171 | case INDEX_op_movcond_i64: |
172 | - return C_O1_I4(r, r, rC, rZ, rZ); | 172 | - return C_O1_I4(r, r, rC, rZ, rZ); |
173 | + return C_O1_I4(r, r, rC, rz, rz); | 173 | + return C_O1_I4(r, r, rC, rz, rz); |
174 | 174 | ||
175 | case INDEX_op_qemu_ld_i32: | 175 | case INDEX_op_qemu_ld_i32: |
176 | case INDEX_op_qemu_ld_i64: | 176 | case INDEX_op_qemu_ld_i64: |
177 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 177 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
178 | return C_O2_I1(r, r, r); | 178 | return C_O2_I1(r, r, r); |
179 | case INDEX_op_qemu_st_i32: | 179 | case INDEX_op_qemu_st_i32: |
180 | case INDEX_op_qemu_st_i64: | 180 | case INDEX_op_qemu_st_i64: |
181 | - return C_O0_I2(rZ, r); | 181 | - return C_O0_I2(rZ, r); |
182 | + return C_O0_I2(rz, r); | 182 | + return C_O0_I2(rz, r); |
183 | case INDEX_op_qemu_st_i128: | 183 | case INDEX_op_qemu_st_i128: |
184 | - return C_O0_I3(rZ, rZ, r); | 184 | - return C_O0_I3(rZ, rZ, r); |
185 | + return C_O0_I3(rz, rz, r); | 185 | + return C_O0_I3(rz, rz, r); |
186 | 186 | ||
187 | case INDEX_op_deposit_i32: | 187 | case INDEX_op_deposit_i32: |
188 | case INDEX_op_deposit_i64: | 188 | case INDEX_op_deposit_i64: |
189 | - return C_O1_I2(r, 0, rZ); | 189 | - return C_O1_I2(r, 0, rZ); |
190 | + return C_O1_I2(r, 0, rz); | 190 | + return C_O1_I2(r, 0, rz); |
191 | 191 | ||
192 | case INDEX_op_extract2_i32: | 192 | case INDEX_op_extract2_i32: |
193 | case INDEX_op_extract2_i64: | 193 | case INDEX_op_extract2_i64: |
194 | - return C_O1_I2(r, rZ, rZ); | 194 | - return C_O1_I2(r, rZ, rZ); |
195 | + return C_O1_I2(r, rz, rz); | 195 | + return C_O1_I2(r, rz, rz); |
196 | 196 | ||
197 | case INDEX_op_add2_i32: | 197 | case INDEX_op_add2_i32: |
198 | case INDEX_op_add2_i64: | 198 | case INDEX_op_add2_i64: |
199 | case INDEX_op_sub2_i32: | 199 | case INDEX_op_sub2_i32: |
200 | case INDEX_op_sub2_i64: | 200 | case INDEX_op_sub2_i64: |
201 | - return C_O2_I4(r, r, rZ, rZ, rA, rMZ); | 201 | - return C_O2_I4(r, r, rZ, rZ, rA, rMZ); |
202 | + return C_O2_I4(r, r, rz, rz, rA, rMZ); | 202 | + return C_O2_I4(r, r, rz, rz, rA, rMZ); |
203 | 203 | ||
204 | case INDEX_op_add_vec: | 204 | case INDEX_op_add_vec: |
205 | case INDEX_op_sub_vec: | 205 | case INDEX_op_sub_vec: |
206 | -- | 206 | -- |
207 | 2.43.0 | 207 | 2.43.0 | diff view generated by jsdifflib |
1 | Replace target-specific 'Z' with generic 'z'. | 1 | Replace target-specific 'Z' with generic 'z'. |
---|---|---|---|
2 | 2 | ||
3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | 3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
5 | --- | 5 | --- |
6 | tcg/loongarch64/tcg-target-con-set.h | 15 ++++++------- | 6 | tcg/loongarch64/tcg-target-con-set.h | 15 ++++++------- |
7 | tcg/loongarch64/tcg-target-con-str.h | 1 - | 7 | tcg/loongarch64/tcg-target-con-str.h | 1 - |
8 | tcg/loongarch64/tcg-target.c.inc | 32 ++++++++++++---------------- | 8 | tcg/loongarch64/tcg-target.c.inc | 32 ++++++++++++---------------- |
9 | 3 files changed, 21 insertions(+), 27 deletions(-) | 9 | 3 files changed, 21 insertions(+), 27 deletions(-) |
10 | 10 | ||
11 | diff --git a/tcg/loongarch64/tcg-target-con-set.h b/tcg/loongarch64/tcg-target-con-set.h | 11 | diff --git a/tcg/loongarch64/tcg-target-con-set.h b/tcg/loongarch64/tcg-target-con-set.h |
12 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/tcg/loongarch64/tcg-target-con-set.h | 13 | --- a/tcg/loongarch64/tcg-target-con-set.h |
14 | +++ b/tcg/loongarch64/tcg-target-con-set.h | 14 | +++ b/tcg/loongarch64/tcg-target-con-set.h |
15 | @@ -XXX,XX +XXX,XX @@ | 15 | @@ -XXX,XX +XXX,XX @@ |
16 | * tcg-target-con-str.h; the constraint combination is inclusive or. | 16 | * tcg-target-con-str.h; the constraint combination is inclusive or. |
17 | */ | 17 | */ |
18 | C_O0_I1(r) | 18 | C_O0_I1(r) |
19 | -C_O0_I2(rZ, r) | 19 | -C_O0_I2(rZ, r) |
20 | -C_O0_I2(rZ, rZ) | 20 | -C_O0_I2(rZ, rZ) |
21 | +C_O0_I2(rz, r) | 21 | +C_O0_I2(rz, r) |
22 | +C_O0_I2(rz, rz) | 22 | +C_O0_I2(rz, rz) |
23 | C_O0_I2(w, r) | 23 | C_O0_I2(w, r) |
24 | C_O0_I3(r, r, r) | 24 | C_O0_I3(r, r, r) |
25 | C_O1_I1(r, r) | 25 | C_O1_I1(r, r) |
26 | @@ -XXX,XX +XXX,XX @@ C_O1_I2(r, r, rI) | 26 | @@ -XXX,XX +XXX,XX @@ C_O1_I2(r, r, rI) |
27 | C_O1_I2(r, r, rJ) | 27 | C_O1_I2(r, r, rJ) |
28 | C_O1_I2(r, r, rU) | 28 | C_O1_I2(r, r, rU) |
29 | C_O1_I2(r, r, rW) | 29 | C_O1_I2(r, r, rW) |
30 | -C_O1_I2(r, r, rZ) | 30 | -C_O1_I2(r, r, rZ) |
31 | -C_O1_I2(r, 0, rZ) | 31 | -C_O1_I2(r, 0, rZ) |
32 | -C_O1_I2(r, rZ, ri) | 32 | -C_O1_I2(r, rZ, ri) |
33 | -C_O1_I2(r, rZ, rJ) | 33 | -C_O1_I2(r, rZ, rJ) |
34 | -C_O1_I2(r, rZ, rZ) | 34 | -C_O1_I2(r, rZ, rZ) |
35 | +C_O1_I2(r, 0, rz) | 35 | +C_O1_I2(r, 0, rz) |
36 | +C_O1_I2(r, rz, ri) | 36 | +C_O1_I2(r, rz, ri) |
37 | +C_O1_I2(r, rz, rJ) | 37 | +C_O1_I2(r, rz, rJ) |
38 | +C_O1_I2(r, rz, rz) | 38 | +C_O1_I2(r, rz, rz) |
39 | C_O1_I2(w, w, w) | 39 | C_O1_I2(w, w, w) |
40 | C_O1_I2(w, w, wM) | 40 | C_O1_I2(w, w, wM) |
41 | C_O1_I2(w, w, wA) | 41 | C_O1_I2(w, w, wA) |
42 | C_O1_I3(w, w, w, w) | 42 | C_O1_I3(w, w, w, w) |
43 | -C_O1_I4(r, rZ, rJ, rZ, rZ) | 43 | -C_O1_I4(r, rZ, rJ, rZ, rZ) |
44 | +C_O1_I4(r, rz, rJ, rz, rz) | 44 | +C_O1_I4(r, rz, rJ, rz, rz) |
45 | C_N2_I1(r, r, r) | 45 | C_N2_I1(r, r, r) |
46 | diff --git a/tcg/loongarch64/tcg-target-con-str.h b/tcg/loongarch64/tcg-target-con-str.h | 46 | diff --git a/tcg/loongarch64/tcg-target-con-str.h b/tcg/loongarch64/tcg-target-con-str.h |
47 | index XXXXXXX..XXXXXXX 100644 | 47 | index XXXXXXX..XXXXXXX 100644 |
48 | --- a/tcg/loongarch64/tcg-target-con-str.h | 48 | --- a/tcg/loongarch64/tcg-target-con-str.h |
49 | +++ b/tcg/loongarch64/tcg-target-con-str.h | 49 | +++ b/tcg/loongarch64/tcg-target-con-str.h |
50 | @@ -XXX,XX +XXX,XX @@ REGS('w', ALL_VECTOR_REGS) | 50 | @@ -XXX,XX +XXX,XX @@ REGS('w', ALL_VECTOR_REGS) |
51 | CONST('I', TCG_CT_CONST_S12) | 51 | CONST('I', TCG_CT_CONST_S12) |
52 | CONST('J', TCG_CT_CONST_S32) | 52 | CONST('J', TCG_CT_CONST_S32) |
53 | CONST('U', TCG_CT_CONST_U12) | 53 | CONST('U', TCG_CT_CONST_U12) |
54 | -CONST('Z', TCG_CT_CONST_ZERO) | 54 | -CONST('Z', TCG_CT_CONST_ZERO) |
55 | CONST('C', TCG_CT_CONST_C12) | 55 | CONST('C', TCG_CT_CONST_C12) |
56 | CONST('W', TCG_CT_CONST_WSZ) | 56 | CONST('W', TCG_CT_CONST_WSZ) |
57 | CONST('M', TCG_CT_CONST_VCMP) | 57 | CONST('M', TCG_CT_CONST_VCMP) |
58 | diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc | 58 | diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc |
59 | index XXXXXXX..XXXXXXX 100644 | 59 | index XXXXXXX..XXXXXXX 100644 |
60 | --- a/tcg/loongarch64/tcg-target.c.inc | 60 | --- a/tcg/loongarch64/tcg-target.c.inc |
61 | +++ b/tcg/loongarch64/tcg-target.c.inc | 61 | +++ b/tcg/loongarch64/tcg-target.c.inc |
62 | @@ -XXX,XX +XXX,XX @@ static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKind kind, int slot) | 62 | @@ -XXX,XX +XXX,XX @@ static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKind kind, int slot) |
63 | 63 | ||
64 | #define TCG_GUEST_BASE_REG TCG_REG_S1 | 64 | #define TCG_GUEST_BASE_REG TCG_REG_S1 |
65 | 65 | ||
66 | -#define TCG_CT_CONST_ZERO 0x100 | 66 | -#define TCG_CT_CONST_ZERO 0x100 |
67 | -#define TCG_CT_CONST_S12 0x200 | 67 | -#define TCG_CT_CONST_S12 0x200 |
68 | -#define TCG_CT_CONST_S32 0x400 | 68 | -#define TCG_CT_CONST_S32 0x400 |
69 | -#define TCG_CT_CONST_U12 0x800 | 69 | -#define TCG_CT_CONST_U12 0x800 |
70 | -#define TCG_CT_CONST_C12 0x1000 | 70 | -#define TCG_CT_CONST_C12 0x1000 |
71 | -#define TCG_CT_CONST_WSZ 0x2000 | 71 | -#define TCG_CT_CONST_WSZ 0x2000 |
72 | -#define TCG_CT_CONST_VCMP 0x4000 | 72 | -#define TCG_CT_CONST_VCMP 0x4000 |
73 | -#define TCG_CT_CONST_VADD 0x8000 | 73 | -#define TCG_CT_CONST_VADD 0x8000 |
74 | +#define TCG_CT_CONST_S12 0x100 | 74 | +#define TCG_CT_CONST_S12 0x100 |
75 | +#define TCG_CT_CONST_S32 0x200 | 75 | +#define TCG_CT_CONST_S32 0x200 |
76 | +#define TCG_CT_CONST_U12 0x400 | 76 | +#define TCG_CT_CONST_U12 0x400 |
77 | +#define TCG_CT_CONST_C12 0x800 | 77 | +#define TCG_CT_CONST_C12 0x800 |
78 | +#define TCG_CT_CONST_WSZ 0x1000 | 78 | +#define TCG_CT_CONST_WSZ 0x1000 |
79 | +#define TCG_CT_CONST_VCMP 0x2000 | 79 | +#define TCG_CT_CONST_VCMP 0x2000 |
80 | +#define TCG_CT_CONST_VADD 0x4000 | 80 | +#define TCG_CT_CONST_VADD 0x4000 |
81 | 81 | ||
82 | #define ALL_GENERAL_REGS MAKE_64BIT_MASK(0, 32) | 82 | #define ALL_GENERAL_REGS MAKE_64BIT_MASK(0, 32) |
83 | #define ALL_VECTOR_REGS MAKE_64BIT_MASK(32, 32) | 83 | #define ALL_VECTOR_REGS MAKE_64BIT_MASK(32, 32) |
84 | @@ -XXX,XX +XXX,XX @@ static bool tcg_target_const_match(int64_t val, int ct, | 84 | @@ -XXX,XX +XXX,XX @@ static bool tcg_target_const_match(int64_t val, int ct, |
85 | if (ct & TCG_CT_CONST) { | 85 | if (ct & TCG_CT_CONST) { |
86 | return true; | 86 | return true; |
87 | } | 87 | } |
88 | - if ((ct & TCG_CT_CONST_ZERO) && val == 0) { | 88 | - if ((ct & TCG_CT_CONST_ZERO) && val == 0) { |
89 | - return true; | 89 | - return true; |
90 | - } | 90 | - } |
91 | if ((ct & TCG_CT_CONST_S12) && val == sextreg(val, 0, 12)) { | 91 | if ((ct & TCG_CT_CONST_S12) && val == sextreg(val, 0, 12)) { |
92 | return true; | 92 | return true; |
93 | } | 93 | } |
94 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 94 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
95 | case INDEX_op_st_i64: | 95 | case INDEX_op_st_i64: |
96 | case INDEX_op_qemu_st_i32: | 96 | case INDEX_op_qemu_st_i32: |
97 | case INDEX_op_qemu_st_i64: | 97 | case INDEX_op_qemu_st_i64: |
98 | - return C_O0_I2(rZ, r); | 98 | - return C_O0_I2(rZ, r); |
99 | + return C_O0_I2(rz, r); | 99 | + return C_O0_I2(rz, r); |
100 | 100 | ||
101 | case INDEX_op_qemu_ld_i128: | 101 | case INDEX_op_qemu_ld_i128: |
102 | return C_N2_I1(r, r, r); | 102 | return C_N2_I1(r, r, r); |
103 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 103 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
104 | 104 | ||
105 | case INDEX_op_brcond_i32: | 105 | case INDEX_op_brcond_i32: |
106 | case INDEX_op_brcond_i64: | 106 | case INDEX_op_brcond_i64: |
107 | - return C_O0_I2(rZ, rZ); | 107 | - return C_O0_I2(rZ, rZ); |
108 | + return C_O0_I2(rz, rz); | 108 | + return C_O0_I2(rz, rz); |
109 | 109 | ||
110 | case INDEX_op_ext8s_i32: | 110 | case INDEX_op_ext8s_i32: |
111 | case INDEX_op_ext8s_i64: | 111 | case INDEX_op_ext8s_i64: |
112 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 112 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
113 | case INDEX_op_deposit_i32: | 113 | case INDEX_op_deposit_i32: |
114 | case INDEX_op_deposit_i64: | 114 | case INDEX_op_deposit_i64: |
115 | /* Must deposit into the same register as input */ | 115 | /* Must deposit into the same register as input */ |
116 | - return C_O1_I2(r, 0, rZ); | 116 | - return C_O1_I2(r, 0, rZ); |
117 | + return C_O1_I2(r, 0, rz); | 117 | + return C_O1_I2(r, 0, rz); |
118 | 118 | ||
119 | case INDEX_op_sub_i32: | 119 | case INDEX_op_sub_i32: |
120 | case INDEX_op_setcond_i32: | 120 | case INDEX_op_setcond_i32: |
121 | - return C_O1_I2(r, rZ, ri); | 121 | - return C_O1_I2(r, rZ, ri); |
122 | + return C_O1_I2(r, rz, ri); | 122 | + return C_O1_I2(r, rz, ri); |
123 | case INDEX_op_sub_i64: | 123 | case INDEX_op_sub_i64: |
124 | case INDEX_op_setcond_i64: | 124 | case INDEX_op_setcond_i64: |
125 | - return C_O1_I2(r, rZ, rJ); | 125 | - return C_O1_I2(r, rZ, rJ); |
126 | + return C_O1_I2(r, rz, rJ); | 126 | + return C_O1_I2(r, rz, rJ); |
127 | 127 | ||
128 | case INDEX_op_mul_i32: | 128 | case INDEX_op_mul_i32: |
129 | case INDEX_op_mul_i64: | 129 | case INDEX_op_mul_i64: |
130 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 130 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
131 | case INDEX_op_rem_i64: | 131 | case INDEX_op_rem_i64: |
132 | case INDEX_op_remu_i32: | 132 | case INDEX_op_remu_i32: |
133 | case INDEX_op_remu_i64: | 133 | case INDEX_op_remu_i64: |
134 | - return C_O1_I2(r, rZ, rZ); | 134 | - return C_O1_I2(r, rZ, rZ); |
135 | + return C_O1_I2(r, rz, rz); | 135 | + return C_O1_I2(r, rz, rz); |
136 | 136 | ||
137 | case INDEX_op_movcond_i32: | 137 | case INDEX_op_movcond_i32: |
138 | case INDEX_op_movcond_i64: | 138 | case INDEX_op_movcond_i64: |
139 | - return C_O1_I4(r, rZ, rJ, rZ, rZ); | 139 | - return C_O1_I4(r, rZ, rJ, rZ, rZ); |
140 | + return C_O1_I4(r, rz, rJ, rz, rz); | 140 | + return C_O1_I4(r, rz, rJ, rz, rz); |
141 | 141 | ||
142 | case INDEX_op_ld_vec: | 142 | case INDEX_op_ld_vec: |
143 | case INDEX_op_dupm_vec: | 143 | case INDEX_op_dupm_vec: |
144 | -- | 144 | -- |
145 | 2.43.0 | 145 | 2.43.0 |
146 | 146 | ||
147 | 147 | diff view generated by jsdifflib |
1 | Replace target-specific 'Z' with generic 'z'. | 1 | Replace target-specific 'Z' with generic 'z'. |
---|---|---|---|
2 | 2 | ||
3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | 3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
5 | --- | 5 | --- |
6 | tcg/mips/tcg-target-con-set.h | 26 ++++++++++----------- | 6 | tcg/mips/tcg-target-con-set.h | 26 ++++++++++----------- |
7 | tcg/mips/tcg-target-con-str.h | 1 - | 7 | tcg/mips/tcg-target-con-str.h | 1 - |
8 | tcg/mips/tcg-target.c.inc | 44 ++++++++++++++--------------------- | 8 | tcg/mips/tcg-target.c.inc | 44 ++++++++++++++--------------------- |
9 | 3 files changed, 31 insertions(+), 40 deletions(-) | 9 | 3 files changed, 31 insertions(+), 40 deletions(-) |
10 | 10 | ||
11 | diff --git a/tcg/mips/tcg-target-con-set.h b/tcg/mips/tcg-target-con-set.h | 11 | diff --git a/tcg/mips/tcg-target-con-set.h b/tcg/mips/tcg-target-con-set.h |
12 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/tcg/mips/tcg-target-con-set.h | 13 | --- a/tcg/mips/tcg-target-con-set.h |
14 | +++ b/tcg/mips/tcg-target-con-set.h | 14 | +++ b/tcg/mips/tcg-target-con-set.h |
15 | @@ -XXX,XX +XXX,XX @@ | 15 | @@ -XXX,XX +XXX,XX @@ |
16 | * tcg-target-con-str.h; the constraint combination is inclusive or. | 16 | * tcg-target-con-str.h; the constraint combination is inclusive or. |
17 | */ | 17 | */ |
18 | C_O0_I1(r) | 18 | C_O0_I1(r) |
19 | -C_O0_I2(rZ, r) | 19 | -C_O0_I2(rZ, r) |
20 | -C_O0_I2(rZ, rZ) | 20 | -C_O0_I2(rZ, rZ) |
21 | -C_O0_I3(rZ, r, r) | 21 | -C_O0_I3(rZ, r, r) |
22 | -C_O0_I3(rZ, rZ, r) | 22 | -C_O0_I3(rZ, rZ, r) |
23 | -C_O0_I4(rZ, rZ, rZ, rZ) | 23 | -C_O0_I4(rZ, rZ, rZ, rZ) |
24 | -C_O0_I4(rZ, rZ, r, r) | 24 | -C_O0_I4(rZ, rZ, r, r) |
25 | +C_O0_I2(rz, r) | 25 | +C_O0_I2(rz, r) |
26 | +C_O0_I2(rz, rz) | 26 | +C_O0_I2(rz, rz) |
27 | +C_O0_I3(rz, r, r) | 27 | +C_O0_I3(rz, r, r) |
28 | +C_O0_I3(rz, rz, r) | 28 | +C_O0_I3(rz, rz, r) |
29 | +C_O0_I4(rz, rz, rz, rz) | 29 | +C_O0_I4(rz, rz, rz, rz) |
30 | +C_O0_I4(rz, rz, r, r) | 30 | +C_O0_I4(rz, rz, r, r) |
31 | C_O1_I1(r, r) | 31 | C_O1_I1(r, r) |
32 | -C_O1_I2(r, 0, rZ) | 32 | -C_O1_I2(r, 0, rZ) |
33 | +C_O1_I2(r, 0, rz) | 33 | +C_O1_I2(r, 0, rz) |
34 | C_O1_I2(r, r, r) | 34 | C_O1_I2(r, r, r) |
35 | C_O1_I2(r, r, ri) | 35 | C_O1_I2(r, r, ri) |
36 | C_O1_I2(r, r, rI) | 36 | C_O1_I2(r, r, rI) |
37 | C_O1_I2(r, r, rIK) | 37 | C_O1_I2(r, r, rIK) |
38 | C_O1_I2(r, r, rJ) | 38 | C_O1_I2(r, r, rJ) |
39 | -C_O1_I2(r, r, rWZ) | 39 | -C_O1_I2(r, r, rWZ) |
40 | -C_O1_I2(r, rZ, rN) | 40 | -C_O1_I2(r, rZ, rN) |
41 | -C_O1_I2(r, rZ, rZ) | 41 | -C_O1_I2(r, rZ, rZ) |
42 | -C_O1_I4(r, rZ, rZ, rZ, 0) | 42 | -C_O1_I4(r, rZ, rZ, rZ, 0) |
43 | -C_O1_I4(r, rZ, rZ, rZ, rZ) | 43 | -C_O1_I4(r, rZ, rZ, rZ, rZ) |
44 | +C_O1_I2(r, r, rzW) | 44 | +C_O1_I2(r, r, rzW) |
45 | +C_O1_I2(r, rz, rN) | 45 | +C_O1_I2(r, rz, rN) |
46 | +C_O1_I2(r, rz, rz) | 46 | +C_O1_I2(r, rz, rz) |
47 | +C_O1_I4(r, rz, rz, rz, 0) | 47 | +C_O1_I4(r, rz, rz, rz, 0) |
48 | +C_O1_I4(r, rz, rz, rz, rz) | 48 | +C_O1_I4(r, rz, rz, rz, rz) |
49 | C_O2_I1(r, r, r) | 49 | C_O2_I1(r, r, r) |
50 | C_O2_I2(r, r, r, r) | 50 | C_O2_I2(r, r, r, r) |
51 | -C_O2_I4(r, r, rZ, rZ, rN, rN) | 51 | -C_O2_I4(r, r, rZ, rZ, rN, rN) |
52 | +C_O2_I4(r, r, rz, rz, rN, rN) | 52 | +C_O2_I4(r, r, rz, rz, rN, rN) |
53 | diff --git a/tcg/mips/tcg-target-con-str.h b/tcg/mips/tcg-target-con-str.h | 53 | diff --git a/tcg/mips/tcg-target-con-str.h b/tcg/mips/tcg-target-con-str.h |
54 | index XXXXXXX..XXXXXXX 100644 | 54 | index XXXXXXX..XXXXXXX 100644 |
55 | --- a/tcg/mips/tcg-target-con-str.h | 55 | --- a/tcg/mips/tcg-target-con-str.h |
56 | +++ b/tcg/mips/tcg-target-con-str.h | 56 | +++ b/tcg/mips/tcg-target-con-str.h |
57 | @@ -XXX,XX +XXX,XX @@ CONST('J', TCG_CT_CONST_S16) | 57 | @@ -XXX,XX +XXX,XX @@ CONST('J', TCG_CT_CONST_S16) |
58 | CONST('K', TCG_CT_CONST_P2M1) | 58 | CONST('K', TCG_CT_CONST_P2M1) |
59 | CONST('N', TCG_CT_CONST_N16) | 59 | CONST('N', TCG_CT_CONST_N16) |
60 | CONST('W', TCG_CT_CONST_WSZ) | 60 | CONST('W', TCG_CT_CONST_WSZ) |
61 | -CONST('Z', TCG_CT_CONST_ZERO) | 61 | -CONST('Z', TCG_CT_CONST_ZERO) |
62 | diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc | 62 | diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc |
63 | index XXXXXXX..XXXXXXX 100644 | 63 | index XXXXXXX..XXXXXXX 100644 |
64 | --- a/tcg/mips/tcg-target.c.inc | 64 | --- a/tcg/mips/tcg-target.c.inc |
65 | +++ b/tcg/mips/tcg-target.c.inc | 65 | +++ b/tcg/mips/tcg-target.c.inc |
66 | @@ -XXX,XX +XXX,XX @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int type, | 66 | @@ -XXX,XX +XXX,XX @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int type, |
67 | g_assert_not_reached(); | 67 | g_assert_not_reached(); |
68 | } | 68 | } |
69 | 69 | ||
70 | -#define TCG_CT_CONST_ZERO 0x100 | 70 | -#define TCG_CT_CONST_ZERO 0x100 |
71 | -#define TCG_CT_CONST_U16 0x200 /* Unsigned 16-bit: 0 - 0xffff. */ | 71 | -#define TCG_CT_CONST_U16 0x200 /* Unsigned 16-bit: 0 - 0xffff. */ |
72 | -#define TCG_CT_CONST_S16 0x400 /* Signed 16-bit: -32768 - 32767 */ | 72 | -#define TCG_CT_CONST_S16 0x400 /* Signed 16-bit: -32768 - 32767 */ |
73 | -#define TCG_CT_CONST_P2M1 0x800 /* Power of 2 minus 1. */ | 73 | -#define TCG_CT_CONST_P2M1 0x800 /* Power of 2 minus 1. */ |
74 | -#define TCG_CT_CONST_N16 0x1000 /* "Negatable" 16-bit: -32767 - 32767 */ | 74 | -#define TCG_CT_CONST_N16 0x1000 /* "Negatable" 16-bit: -32767 - 32767 */ |
75 | -#define TCG_CT_CONST_WSZ 0x2000 /* word size */ | 75 | -#define TCG_CT_CONST_WSZ 0x2000 /* word size */ |
76 | +#define TCG_CT_CONST_U16 0x100 /* Unsigned 16-bit: 0 - 0xffff. */ | 76 | +#define TCG_CT_CONST_U16 0x100 /* Unsigned 16-bit: 0 - 0xffff. */ |
77 | +#define TCG_CT_CONST_S16 0x200 /* Signed 16-bit: -32768 - 32767 */ | 77 | +#define TCG_CT_CONST_S16 0x200 /* Signed 16-bit: -32768 - 32767 */ |
78 | +#define TCG_CT_CONST_P2M1 0x400 /* Power of 2 minus 1. */ | 78 | +#define TCG_CT_CONST_P2M1 0x400 /* Power of 2 minus 1. */ |
79 | +#define TCG_CT_CONST_N16 0x800 /* "Negatable" 16-bit: -32767 - 32767 */ | 79 | +#define TCG_CT_CONST_N16 0x800 /* "Negatable" 16-bit: -32767 - 32767 */ |
80 | +#define TCG_CT_CONST_WSZ 0x1000 /* word size */ | 80 | +#define TCG_CT_CONST_WSZ 0x1000 /* word size */ |
81 | 81 | ||
82 | #define ALL_GENERAL_REGS 0xffffffffu | 82 | #define ALL_GENERAL_REGS 0xffffffffu |
83 | 83 | ||
84 | @@ -XXX,XX +XXX,XX @@ static bool tcg_target_const_match(int64_t val, int ct, | 84 | @@ -XXX,XX +XXX,XX @@ static bool tcg_target_const_match(int64_t val, int ct, |
85 | { | 85 | { |
86 | if (ct & TCG_CT_CONST) { | 86 | if (ct & TCG_CT_CONST) { |
87 | return 1; | 87 | return 1; |
88 | - } else if ((ct & TCG_CT_CONST_ZERO) && val == 0) { | 88 | - } else if ((ct & TCG_CT_CONST_ZERO) && val == 0) { |
89 | - return 1; | 89 | - return 1; |
90 | } else if ((ct & TCG_CT_CONST_U16) && val == (uint16_t)val) { | 90 | } else if ((ct & TCG_CT_CONST_U16) && val == (uint16_t)val) { |
91 | return 1; | 91 | return 1; |
92 | } else if ((ct & TCG_CT_CONST_S16) && val == (int16_t)val) { | 92 | } else if ((ct & TCG_CT_CONST_S16) && val == (int16_t)val) { |
93 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, | 93 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCGType type, |
94 | TCGArg a0, a1, a2; | 94 | TCGArg a0, a1, a2; |
95 | int c2; | 95 | int c2; |
96 | 96 | ||
97 | - /* | 97 | - /* |
98 | - * Note that many operands use the constraint set "rZ". | 98 | - * Note that many operands use the constraint set "rZ". |
99 | - * We make use of the fact that 0 is the ZERO register, | 99 | - * We make use of the fact that 0 is the ZERO register, |
100 | - * and hence such cases need not check for const_args. | 100 | - * and hence such cases need not check for const_args. |
101 | - */ | 101 | - */ |
102 | a0 = args[0]; | 102 | a0 = args[0]; |
103 | a1 = args[1]; | 103 | a1 = args[1]; |
104 | a2 = args[2]; | 104 | a2 = args[2]; |
105 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 105 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
106 | case INDEX_op_st16_i64: | 106 | case INDEX_op_st16_i64: |
107 | case INDEX_op_st32_i64: | 107 | case INDEX_op_st32_i64: |
108 | case INDEX_op_st_i64: | 108 | case INDEX_op_st_i64: |
109 | - return C_O0_I2(rZ, r); | 109 | - return C_O0_I2(rZ, r); |
110 | + return C_O0_I2(rz, r); | 110 | + return C_O0_I2(rz, r); |
111 | 111 | ||
112 | case INDEX_op_add_i32: | 112 | case INDEX_op_add_i32: |
113 | case INDEX_op_add_i64: | 113 | case INDEX_op_add_i64: |
114 | return C_O1_I2(r, r, rJ); | 114 | return C_O1_I2(r, r, rJ); |
115 | case INDEX_op_sub_i32: | 115 | case INDEX_op_sub_i32: |
116 | case INDEX_op_sub_i64: | 116 | case INDEX_op_sub_i64: |
117 | - return C_O1_I2(r, rZ, rN); | 117 | - return C_O1_I2(r, rZ, rN); |
118 | + return C_O1_I2(r, rz, rN); | 118 | + return C_O1_I2(r, rz, rN); |
119 | case INDEX_op_mul_i32: | 119 | case INDEX_op_mul_i32: |
120 | case INDEX_op_mulsh_i32: | 120 | case INDEX_op_mulsh_i32: |
121 | case INDEX_op_muluh_i32: | 121 | case INDEX_op_muluh_i32: |
122 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 122 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
123 | case INDEX_op_remu_i64: | 123 | case INDEX_op_remu_i64: |
124 | case INDEX_op_nor_i64: | 124 | case INDEX_op_nor_i64: |
125 | case INDEX_op_setcond_i64: | 125 | case INDEX_op_setcond_i64: |
126 | - return C_O1_I2(r, rZ, rZ); | 126 | - return C_O1_I2(r, rZ, rZ); |
127 | + return C_O1_I2(r, rz, rz); | 127 | + return C_O1_I2(r, rz, rz); |
128 | case INDEX_op_muls2_i32: | 128 | case INDEX_op_muls2_i32: |
129 | case INDEX_op_mulu2_i32: | 129 | case INDEX_op_mulu2_i32: |
130 | case INDEX_op_muls2_i64: | 130 | case INDEX_op_muls2_i64: |
131 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 131 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
132 | return C_O1_I2(r, r, ri); | 132 | return C_O1_I2(r, r, ri); |
133 | case INDEX_op_clz_i32: | 133 | case INDEX_op_clz_i32: |
134 | case INDEX_op_clz_i64: | 134 | case INDEX_op_clz_i64: |
135 | - return C_O1_I2(r, r, rWZ); | 135 | - return C_O1_I2(r, r, rWZ); |
136 | + return C_O1_I2(r, r, rzW); | 136 | + return C_O1_I2(r, r, rzW); |
137 | 137 | ||
138 | case INDEX_op_deposit_i32: | 138 | case INDEX_op_deposit_i32: |
139 | case INDEX_op_deposit_i64: | 139 | case INDEX_op_deposit_i64: |
140 | - return C_O1_I2(r, 0, rZ); | 140 | - return C_O1_I2(r, 0, rZ); |
141 | + return C_O1_I2(r, 0, rz); | 141 | + return C_O1_I2(r, 0, rz); |
142 | case INDEX_op_brcond_i32: | 142 | case INDEX_op_brcond_i32: |
143 | case INDEX_op_brcond_i64: | 143 | case INDEX_op_brcond_i64: |
144 | - return C_O0_I2(rZ, rZ); | 144 | - return C_O0_I2(rZ, rZ); |
145 | + return C_O0_I2(rz, rz); | 145 | + return C_O0_I2(rz, rz); |
146 | case INDEX_op_movcond_i32: | 146 | case INDEX_op_movcond_i32: |
147 | case INDEX_op_movcond_i64: | 147 | case INDEX_op_movcond_i64: |
148 | return (use_mips32r6_instructions | 148 | return (use_mips32r6_instructions |
149 | - ? C_O1_I4(r, rZ, rZ, rZ, rZ) | 149 | - ? C_O1_I4(r, rZ, rZ, rZ, rZ) |
150 | - : C_O1_I4(r, rZ, rZ, rZ, 0)); | 150 | - : C_O1_I4(r, rZ, rZ, rZ, 0)); |
151 | + ? C_O1_I4(r, rz, rz, rz, rz) | 151 | + ? C_O1_I4(r, rz, rz, rz, rz) |
152 | + : C_O1_I4(r, rz, rz, rz, 0)); | 152 | + : C_O1_I4(r, rz, rz, rz, 0)); |
153 | case INDEX_op_add2_i32: | 153 | case INDEX_op_add2_i32: |
154 | case INDEX_op_sub2_i32: | 154 | case INDEX_op_sub2_i32: |
155 | - return C_O2_I4(r, r, rZ, rZ, rN, rN); | 155 | - return C_O2_I4(r, r, rZ, rZ, rN, rN); |
156 | + return C_O2_I4(r, r, rz, rz, rN, rN); | 156 | + return C_O2_I4(r, r, rz, rz, rN, rN); |
157 | case INDEX_op_setcond2_i32: | 157 | case INDEX_op_setcond2_i32: |
158 | - return C_O1_I4(r, rZ, rZ, rZ, rZ); | 158 | - return C_O1_I4(r, rZ, rZ, rZ, rZ); |
159 | + return C_O1_I4(r, rz, rz, rz, rz); | 159 | + return C_O1_I4(r, rz, rz, rz, rz); |
160 | case INDEX_op_brcond2_i32: | 160 | case INDEX_op_brcond2_i32: |
161 | - return C_O0_I4(rZ, rZ, rZ, rZ); | 161 | - return C_O0_I4(rZ, rZ, rZ, rZ); |
162 | + return C_O0_I4(rz, rz, rz, rz); | 162 | + return C_O0_I4(rz, rz, rz, rz); |
163 | 163 | ||
164 | case INDEX_op_qemu_ld_i32: | 164 | case INDEX_op_qemu_ld_i32: |
165 | return C_O1_I1(r, r); | 165 | return C_O1_I1(r, r); |
166 | case INDEX_op_qemu_st_i32: | 166 | case INDEX_op_qemu_st_i32: |
167 | - return C_O0_I2(rZ, r); | 167 | - return C_O0_I2(rZ, r); |
168 | + return C_O0_I2(rz, r); | 168 | + return C_O0_I2(rz, r); |
169 | case INDEX_op_qemu_ld_i64: | 169 | case INDEX_op_qemu_ld_i64: |
170 | return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, r) : C_O2_I1(r, r, r); | 170 | return TCG_TARGET_REG_BITS == 64 ? C_O1_I1(r, r) : C_O2_I1(r, r, r); |
171 | case INDEX_op_qemu_st_i64: | 171 | case INDEX_op_qemu_st_i64: |
172 | - return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(rZ, r) : C_O0_I3(rZ, rZ, r); | 172 | - return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(rZ, r) : C_O0_I3(rZ, rZ, r); |
173 | + return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(rz, r) : C_O0_I3(rz, rz, r); | 173 | + return TCG_TARGET_REG_BITS == 64 ? C_O0_I2(rz, r) : C_O0_I3(rz, rz, r); |
174 | 174 | ||
175 | default: | 175 | default: |
176 | return C_NotImplemented; | 176 | return C_NotImplemented; |
177 | -- | 177 | -- |
178 | 2.43.0 | 178 | 2.43.0 |
179 | 179 | ||
180 | 180 | diff view generated by jsdifflib |
1 | Replace target-specific 'Z' with generic 'z'. | 1 | Replace target-specific 'Z' with generic 'z'. |
---|---|---|---|
2 | 2 | ||
3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | 3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
5 | --- | 5 | --- |
6 | tcg/riscv/tcg-target-con-set.h | 10 +++++----- | 6 | tcg/riscv/tcg-target-con-set.h | 10 +++++----- |
7 | tcg/riscv/tcg-target-con-str.h | 1 - | 7 | tcg/riscv/tcg-target-con-str.h | 1 - |
8 | tcg/riscv/tcg-target.c.inc | 28 ++++++++++++---------------- | 8 | tcg/riscv/tcg-target.c.inc | 28 ++++++++++++---------------- |
9 | 3 files changed, 17 insertions(+), 22 deletions(-) | 9 | 3 files changed, 17 insertions(+), 22 deletions(-) |
10 | 10 | ||
11 | diff --git a/tcg/riscv/tcg-target-con-set.h b/tcg/riscv/tcg-target-con-set.h | 11 | diff --git a/tcg/riscv/tcg-target-con-set.h b/tcg/riscv/tcg-target-con-set.h |
12 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/tcg/riscv/tcg-target-con-set.h | 13 | --- a/tcg/riscv/tcg-target-con-set.h |
14 | +++ b/tcg/riscv/tcg-target-con-set.h | 14 | +++ b/tcg/riscv/tcg-target-con-set.h |
15 | @@ -XXX,XX +XXX,XX @@ | 15 | @@ -XXX,XX +XXX,XX @@ |
16 | * tcg-target-con-str.h; the constraint combination is inclusive or. | 16 | * tcg-target-con-str.h; the constraint combination is inclusive or. |
17 | */ | 17 | */ |
18 | C_O0_I1(r) | 18 | C_O0_I1(r) |
19 | -C_O0_I2(rZ, r) | 19 | -C_O0_I2(rZ, r) |
20 | -C_O0_I2(rZ, rZ) | 20 | -C_O0_I2(rZ, rZ) |
21 | +C_O0_I2(rz, r) | 21 | +C_O0_I2(rz, r) |
22 | +C_O0_I2(rz, rz) | 22 | +C_O0_I2(rz, rz) |
23 | C_O1_I1(r, r) | 23 | C_O1_I1(r, r) |
24 | C_O1_I2(r, r, ri) | 24 | C_O1_I2(r, r, ri) |
25 | C_O1_I2(r, r, rI) | 25 | C_O1_I2(r, r, rI) |
26 | C_O1_I2(r, r, rJ) | 26 | C_O1_I2(r, r, rJ) |
27 | -C_O1_I2(r, rZ, rN) | 27 | -C_O1_I2(r, rZ, rN) |
28 | -C_O1_I2(r, rZ, rZ) | 28 | -C_O1_I2(r, rZ, rZ) |
29 | +C_O1_I2(r, rz, rN) | 29 | +C_O1_I2(r, rz, rN) |
30 | +C_O1_I2(r, rz, rz) | 30 | +C_O1_I2(r, rz, rz) |
31 | C_N1_I2(r, r, rM) | 31 | C_N1_I2(r, r, rM) |
32 | C_O1_I4(r, r, rI, rM, rM) | 32 | C_O1_I4(r, r, rI, rM, rM) |
33 | -C_O2_I4(r, r, rZ, rZ, rM, rM) | 33 | -C_O2_I4(r, r, rZ, rZ, rM, rM) |
34 | +C_O2_I4(r, r, rz, rz, rM, rM) | 34 | +C_O2_I4(r, r, rz, rz, rM, rM) |
35 | C_O0_I2(v, r) | 35 | C_O0_I2(v, r) |
36 | C_O1_I1(v, r) | 36 | C_O1_I1(v, r) |
37 | C_O1_I1(v, v) | 37 | C_O1_I1(v, v) |
38 | diff --git a/tcg/riscv/tcg-target-con-str.h b/tcg/riscv/tcg-target-con-str.h | 38 | diff --git a/tcg/riscv/tcg-target-con-str.h b/tcg/riscv/tcg-target-con-str.h |
39 | index XXXXXXX..XXXXXXX 100644 | 39 | index XXXXXXX..XXXXXXX 100644 |
40 | --- a/tcg/riscv/tcg-target-con-str.h | 40 | --- a/tcg/riscv/tcg-target-con-str.h |
41 | +++ b/tcg/riscv/tcg-target-con-str.h | 41 | +++ b/tcg/riscv/tcg-target-con-str.h |
42 | @@ -XXX,XX +XXX,XX @@ CONST('K', TCG_CT_CONST_S5) | 42 | @@ -XXX,XX +XXX,XX @@ CONST('K', TCG_CT_CONST_S5) |
43 | CONST('L', TCG_CT_CONST_CMP_VI) | 43 | CONST('L', TCG_CT_CONST_CMP_VI) |
44 | CONST('N', TCG_CT_CONST_N12) | 44 | CONST('N', TCG_CT_CONST_N12) |
45 | CONST('M', TCG_CT_CONST_M12) | 45 | CONST('M', TCG_CT_CONST_M12) |
46 | -CONST('Z', TCG_CT_CONST_ZERO) | 46 | -CONST('Z', TCG_CT_CONST_ZERO) |
47 | diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc | 47 | diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc |
48 | index XXXXXXX..XXXXXXX 100644 | 48 | index XXXXXXX..XXXXXXX 100644 |
49 | --- a/tcg/riscv/tcg-target.c.inc | 49 | --- a/tcg/riscv/tcg-target.c.inc |
50 | +++ b/tcg/riscv/tcg-target.c.inc | 50 | +++ b/tcg/riscv/tcg-target.c.inc |
51 | @@ -XXX,XX +XXX,XX @@ static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKind kind, int slot) | 51 | @@ -XXX,XX +XXX,XX @@ static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKind kind, int slot) |
52 | return TCG_REG_A0 + slot; | 52 | return TCG_REG_A0 + slot; |
53 | } | 53 | } |
54 | 54 | ||
55 | -#define TCG_CT_CONST_ZERO 0x100 | 55 | -#define TCG_CT_CONST_ZERO 0x100 |
56 | -#define TCG_CT_CONST_S12 0x200 | 56 | -#define TCG_CT_CONST_S12 0x200 |
57 | -#define TCG_CT_CONST_N12 0x400 | 57 | -#define TCG_CT_CONST_N12 0x400 |
58 | -#define TCG_CT_CONST_M12 0x800 | 58 | -#define TCG_CT_CONST_M12 0x800 |
59 | -#define TCG_CT_CONST_J12 0x1000 | 59 | -#define TCG_CT_CONST_J12 0x1000 |
60 | -#define TCG_CT_CONST_S5 0x2000 | 60 | -#define TCG_CT_CONST_S5 0x2000 |
61 | -#define TCG_CT_CONST_CMP_VI 0x4000 | 61 | -#define TCG_CT_CONST_CMP_VI 0x4000 |
62 | +#define TCG_CT_CONST_S12 0x100 | 62 | +#define TCG_CT_CONST_S12 0x100 |
63 | +#define TCG_CT_CONST_N12 0x200 | 63 | +#define TCG_CT_CONST_N12 0x200 |
64 | +#define TCG_CT_CONST_M12 0x400 | 64 | +#define TCG_CT_CONST_M12 0x400 |
65 | +#define TCG_CT_CONST_J12 0x800 | 65 | +#define TCG_CT_CONST_J12 0x800 |
66 | +#define TCG_CT_CONST_S5 0x1000 | 66 | +#define TCG_CT_CONST_S5 0x1000 |
67 | +#define TCG_CT_CONST_CMP_VI 0x2000 | 67 | +#define TCG_CT_CONST_CMP_VI 0x2000 |
68 | 68 | ||
69 | #define ALL_GENERAL_REGS MAKE_64BIT_MASK(0, 32) | 69 | #define ALL_GENERAL_REGS MAKE_64BIT_MASK(0, 32) |
70 | #define ALL_VECTOR_REGS MAKE_64BIT_MASK(32, 32) | 70 | #define ALL_VECTOR_REGS MAKE_64BIT_MASK(32, 32) |
71 | @@ -XXX,XX +XXX,XX @@ static bool tcg_target_const_match(int64_t val, int ct, | 71 | @@ -XXX,XX +XXX,XX @@ static bool tcg_target_const_match(int64_t val, int ct, |
72 | if (ct & TCG_CT_CONST) { | 72 | if (ct & TCG_CT_CONST) { |
73 | return 1; | 73 | return 1; |
74 | } | 74 | } |
75 | - if ((ct & TCG_CT_CONST_ZERO) && val == 0) { | 75 | - if ((ct & TCG_CT_CONST_ZERO) && val == 0) { |
76 | - return 1; | 76 | - return 1; |
77 | - } | 77 | - } |
78 | if (type >= TCG_TYPE_V64) { | 78 | if (type >= TCG_TYPE_V64) { |
79 | /* Val is replicated by VECE; extract the highest element. */ | 79 | /* Val is replicated by VECE; extract the highest element. */ |
80 | val >>= (-8 << vece) & 63; | 80 | val >>= (-8 << vece) & 63; |
81 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 81 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
82 | case INDEX_op_st16_i64: | 82 | case INDEX_op_st16_i64: |
83 | case INDEX_op_st32_i64: | 83 | case INDEX_op_st32_i64: |
84 | case INDEX_op_st_i64: | 84 | case INDEX_op_st_i64: |
85 | - return C_O0_I2(rZ, r); | 85 | - return C_O0_I2(rZ, r); |
86 | + return C_O0_I2(rz, r); | 86 | + return C_O0_I2(rz, r); |
87 | 87 | ||
88 | case INDEX_op_add_i32: | 88 | case INDEX_op_add_i32: |
89 | case INDEX_op_and_i32: | 89 | case INDEX_op_and_i32: |
90 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 90 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
91 | 91 | ||
92 | case INDEX_op_sub_i32: | 92 | case INDEX_op_sub_i32: |
93 | case INDEX_op_sub_i64: | 93 | case INDEX_op_sub_i64: |
94 | - return C_O1_I2(r, rZ, rN); | 94 | - return C_O1_I2(r, rZ, rN); |
95 | + return C_O1_I2(r, rz, rN); | 95 | + return C_O1_I2(r, rz, rN); |
96 | 96 | ||
97 | case INDEX_op_mul_i32: | 97 | case INDEX_op_mul_i32: |
98 | case INDEX_op_mulsh_i32: | 98 | case INDEX_op_mulsh_i32: |
99 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 99 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
100 | case INDEX_op_divu_i64: | 100 | case INDEX_op_divu_i64: |
101 | case INDEX_op_rem_i64: | 101 | case INDEX_op_rem_i64: |
102 | case INDEX_op_remu_i64: | 102 | case INDEX_op_remu_i64: |
103 | - return C_O1_I2(r, rZ, rZ); | 103 | - return C_O1_I2(r, rZ, rZ); |
104 | + return C_O1_I2(r, rz, rz); | 104 | + return C_O1_I2(r, rz, rz); |
105 | 105 | ||
106 | case INDEX_op_shl_i32: | 106 | case INDEX_op_shl_i32: |
107 | case INDEX_op_shr_i32: | 107 | case INDEX_op_shr_i32: |
108 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 108 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
109 | 109 | ||
110 | case INDEX_op_brcond_i32: | 110 | case INDEX_op_brcond_i32: |
111 | case INDEX_op_brcond_i64: | 111 | case INDEX_op_brcond_i64: |
112 | - return C_O0_I2(rZ, rZ); | 112 | - return C_O0_I2(rZ, rZ); |
113 | + return C_O0_I2(rz, rz); | 113 | + return C_O0_I2(rz, rz); |
114 | 114 | ||
115 | case INDEX_op_movcond_i32: | 115 | case INDEX_op_movcond_i32: |
116 | case INDEX_op_movcond_i64: | 116 | case INDEX_op_movcond_i64: |
117 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 117 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
118 | case INDEX_op_add2_i64: | 118 | case INDEX_op_add2_i64: |
119 | case INDEX_op_sub2_i32: | 119 | case INDEX_op_sub2_i32: |
120 | case INDEX_op_sub2_i64: | 120 | case INDEX_op_sub2_i64: |
121 | - return C_O2_I4(r, r, rZ, rZ, rM, rM); | 121 | - return C_O2_I4(r, r, rZ, rZ, rM, rM); |
122 | + return C_O2_I4(r, r, rz, rz, rM, rM); | 122 | + return C_O2_I4(r, r, rz, rz, rM, rM); |
123 | 123 | ||
124 | case INDEX_op_qemu_ld_i32: | 124 | case INDEX_op_qemu_ld_i32: |
125 | case INDEX_op_qemu_ld_i64: | 125 | case INDEX_op_qemu_ld_i64: |
126 | return C_O1_I1(r, r); | 126 | return C_O1_I1(r, r); |
127 | case INDEX_op_qemu_st_i32: | 127 | case INDEX_op_qemu_st_i32: |
128 | case INDEX_op_qemu_st_i64: | 128 | case INDEX_op_qemu_st_i64: |
129 | - return C_O0_I2(rZ, r); | 129 | - return C_O0_I2(rZ, r); |
130 | + return C_O0_I2(rz, r); | 130 | + return C_O0_I2(rz, r); |
131 | 131 | ||
132 | case INDEX_op_st_vec: | 132 | case INDEX_op_st_vec: |
133 | return C_O0_I2(v, r); | 133 | return C_O0_I2(v, r); |
134 | -- | 134 | -- |
135 | 2.43.0 | 135 | 2.43.0 |
136 | 136 | ||
137 | 137 | diff view generated by jsdifflib |
1 | Replace target-specific 'Z' with generic 'z'. | 1 | Replace target-specific 'Z' with generic 'z'. |
---|---|---|---|
2 | 2 | ||
3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | 3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> |
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
5 | --- | 5 | --- |
6 | tcg/sparc64/tcg-target-con-set.h | 12 ++++++------ | 6 | tcg/sparc64/tcg-target-con-set.h | 12 ++++++------ |
7 | tcg/sparc64/tcg-target-con-str.h | 1 - | 7 | tcg/sparc64/tcg-target-con-str.h | 1 - |
8 | tcg/sparc64/tcg-target.c.inc | 17 +++++++---------- | 8 | tcg/sparc64/tcg-target.c.inc | 17 +++++++---------- |
9 | 3 files changed, 13 insertions(+), 17 deletions(-) | 9 | 3 files changed, 13 insertions(+), 17 deletions(-) |
10 | 10 | ||
11 | diff --git a/tcg/sparc64/tcg-target-con-set.h b/tcg/sparc64/tcg-target-con-set.h | 11 | diff --git a/tcg/sparc64/tcg-target-con-set.h b/tcg/sparc64/tcg-target-con-set.h |
12 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/tcg/sparc64/tcg-target-con-set.h | 13 | --- a/tcg/sparc64/tcg-target-con-set.h |
14 | +++ b/tcg/sparc64/tcg-target-con-set.h | 14 | +++ b/tcg/sparc64/tcg-target-con-set.h |
15 | @@ -XXX,XX +XXX,XX @@ | 15 | @@ -XXX,XX +XXX,XX @@ |
16 | * tcg-target-con-str.h; the constraint combination is inclusive or. | 16 | * tcg-target-con-str.h; the constraint combination is inclusive or. |
17 | */ | 17 | */ |
18 | C_O0_I1(r) | 18 | C_O0_I1(r) |
19 | -C_O0_I2(rZ, r) | 19 | -C_O0_I2(rZ, r) |
20 | -C_O0_I2(rZ, rJ) | 20 | -C_O0_I2(rZ, rJ) |
21 | +C_O0_I2(rz, r) | 21 | +C_O0_I2(rz, r) |
22 | +C_O0_I2(rz, rJ) | 22 | +C_O0_I2(rz, rJ) |
23 | C_O1_I1(r, r) | 23 | C_O1_I1(r, r) |
24 | C_O1_I2(r, r, r) | 24 | C_O1_I2(r, r, r) |
25 | -C_O1_I2(r, rZ, rJ) | 25 | -C_O1_I2(r, rZ, rJ) |
26 | -C_O1_I4(r, rZ, rJ, rI, 0) | 26 | -C_O1_I4(r, rZ, rJ, rI, 0) |
27 | -C_O2_I2(r, r, rZ, rJ) | 27 | -C_O2_I2(r, r, rZ, rJ) |
28 | -C_O2_I4(r, r, rZ, rZ, rJ, rJ) | 28 | -C_O2_I4(r, r, rZ, rZ, rJ, rJ) |
29 | +C_O1_I2(r, rz, rJ) | 29 | +C_O1_I2(r, rz, rJ) |
30 | +C_O1_I4(r, rz, rJ, rI, 0) | 30 | +C_O1_I4(r, rz, rJ, rI, 0) |
31 | +C_O2_I2(r, r, rz, rJ) | 31 | +C_O2_I2(r, r, rz, rJ) |
32 | +C_O2_I4(r, r, rz, rz, rJ, rJ) | 32 | +C_O2_I4(r, r, rz, rz, rJ, rJ) |
33 | diff --git a/tcg/sparc64/tcg-target-con-str.h b/tcg/sparc64/tcg-target-con-str.h | 33 | diff --git a/tcg/sparc64/tcg-target-con-str.h b/tcg/sparc64/tcg-target-con-str.h |
34 | index XXXXXXX..XXXXXXX 100644 | 34 | index XXXXXXX..XXXXXXX 100644 |
35 | --- a/tcg/sparc64/tcg-target-con-str.h | 35 | --- a/tcg/sparc64/tcg-target-con-str.h |
36 | +++ b/tcg/sparc64/tcg-target-con-str.h | 36 | +++ b/tcg/sparc64/tcg-target-con-str.h |
37 | @@ -XXX,XX +XXX,XX @@ REGS('r', ALL_GENERAL_REGS) | 37 | @@ -XXX,XX +XXX,XX @@ REGS('r', ALL_GENERAL_REGS) |
38 | */ | 38 | */ |
39 | CONST('I', TCG_CT_CONST_S11) | 39 | CONST('I', TCG_CT_CONST_S11) |
40 | CONST('J', TCG_CT_CONST_S13) | 40 | CONST('J', TCG_CT_CONST_S13) |
41 | -CONST('Z', TCG_CT_CONST_ZERO) | 41 | -CONST('Z', TCG_CT_CONST_ZERO) |
42 | diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc | 42 | diff --git a/tcg/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc |
43 | index XXXXXXX..XXXXXXX 100644 | 43 | index XXXXXXX..XXXXXXX 100644 |
44 | --- a/tcg/sparc64/tcg-target.c.inc | 44 | --- a/tcg/sparc64/tcg-target.c.inc |
45 | +++ b/tcg/sparc64/tcg-target.c.inc | 45 | +++ b/tcg/sparc64/tcg-target.c.inc |
46 | @@ -XXX,XX +XXX,XX @@ static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { | 46 | @@ -XXX,XX +XXX,XX @@ static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { |
47 | 47 | ||
48 | #define TCG_CT_CONST_S11 0x100 | 48 | #define TCG_CT_CONST_S11 0x100 |
49 | #define TCG_CT_CONST_S13 0x200 | 49 | #define TCG_CT_CONST_S13 0x200 |
50 | -#define TCG_CT_CONST_ZERO 0x400 | 50 | -#define TCG_CT_CONST_ZERO 0x400 |
51 | 51 | ||
52 | #define ALL_GENERAL_REGS MAKE_64BIT_MASK(0, 32) | 52 | #define ALL_GENERAL_REGS MAKE_64BIT_MASK(0, 32) |
53 | 53 | ||
54 | @@ -XXX,XX +XXX,XX @@ static bool tcg_target_const_match(int64_t val, int ct, | 54 | @@ -XXX,XX +XXX,XX @@ static bool tcg_target_const_match(int64_t val, int ct, |
55 | val = (int32_t)val; | 55 | val = (int32_t)val; |
56 | } | 56 | } |
57 | 57 | ||
58 | - if ((ct & TCG_CT_CONST_ZERO) && val == 0) { | 58 | - if ((ct & TCG_CT_CONST_ZERO) && val == 0) { |
59 | - return 1; | 59 | - return 1; |
60 | - } else if ((ct & TCG_CT_CONST_S11) && check_fit_tl(val, 11)) { | 60 | - } else if ((ct & TCG_CT_CONST_S11) && check_fit_tl(val, 11)) { |
61 | + if ((ct & TCG_CT_CONST_S11) && check_fit_tl(val, 11)) { | 61 | + if ((ct & TCG_CT_CONST_S11) && check_fit_tl(val, 11)) { |
62 | return 1; | 62 | return 1; |
63 | } else if ((ct & TCG_CT_CONST_S13) && check_fit_tl(val, 13)) { | 63 | } else if ((ct & TCG_CT_CONST_S13) && check_fit_tl(val, 13)) { |
64 | return 1; | 64 | return 1; |
65 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 65 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
66 | case INDEX_op_st_i64: | 66 | case INDEX_op_st_i64: |
67 | case INDEX_op_qemu_st_i32: | 67 | case INDEX_op_qemu_st_i32: |
68 | case INDEX_op_qemu_st_i64: | 68 | case INDEX_op_qemu_st_i64: |
69 | - return C_O0_I2(rZ, r); | 69 | - return C_O0_I2(rZ, r); |
70 | + return C_O0_I2(rz, r); | 70 | + return C_O0_I2(rz, r); |
71 | 71 | ||
72 | case INDEX_op_add_i32: | 72 | case INDEX_op_add_i32: |
73 | case INDEX_op_add_i64: | 73 | case INDEX_op_add_i64: |
74 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) | 74 | @@ -XXX,XX +XXX,XX @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) |
75 | case INDEX_op_setcond_i64: | 75 | case INDEX_op_setcond_i64: |
76 | case INDEX_op_negsetcond_i32: | 76 | case INDEX_op_negsetcond_i32: |
77 | case INDEX_op_negsetcond_i64: | 77 | case INDEX_op_negsetcond_i64: |
78 | - return C_O1_I2(r, rZ, rJ); | 78 | - return C_O1_I2(r, rZ, rJ); |
79 | + return C_O1_I2(r, rz, rJ); | 79 | + return C_O1_I2(r, rz, rJ); |
80 | 80 | ||
81 | case INDEX_op_brcond_i32: | 81 | case INDEX_op_brcond_i32: |
82 | case INDEX_op_brcond_i64: | 82 | case INDEX_op_brcond_i64: |
83 | - return C_O0_I2(rZ, rJ); | 83 | - return C_O0_I2(rZ, rJ); |
84 | + return C_O0_I2(rz, rJ); | 84 | + return C_O0_I2(rz, rJ); |
85 | case INDEX_op_movcond_i32: | 85 | case INDEX_op_movcond_i32: |
86 | case INDEX_op_movcond_i64: | 86 | case INDEX_op_movcond_i64: |
87 | - return C_O1_I4(r, rZ, rJ, rI, 0); | 87 | - return C_O1_I4(r, rZ, rJ, rI, 0); |
88 | + return C_O1_I4(r, rz, rJ, rI, 0); | 88 | + return C_O1_I4(r, rz, rJ, rI, 0); |
89 | case INDEX_op_add2_i32: | 89 | case INDEX_op_add2_i32: |
90 | case INDEX_op_add2_i64: | 90 | case INDEX_op_add2_i64: |
91 | case INDEX_op_sub2_i32: | 91 | case INDEX_op_sub2_i32: |
92 | case INDEX_op_sub2_i64: | 92 | case INDEX_op_sub2_i64: |
93 | - return C_O2_I4(r, r, rZ, rZ, rJ, rJ); | 93 | - return C_O2_I4(r, r, rZ, rZ, rJ, rJ); |
94 | + return C_O2_I4(r, r, rz, rz, rJ, rJ); | 94 | + return C_O2_I4(r, r, rz, rz, rJ, rJ); |
95 | case INDEX_op_mulu2_i32: | 95 | case INDEX_op_mulu2_i32: |
96 | case INDEX_op_muls2_i32: | 96 | case INDEX_op_muls2_i32: |
97 | - return C_O2_I2(r, r, rZ, rJ); | 97 | - return C_O2_I2(r, r, rZ, rJ); |
98 | + return C_O2_I2(r, r, rz, rJ); | 98 | + return C_O2_I2(r, r, rz, rJ); |
99 | case INDEX_op_muluh_i64: | 99 | case INDEX_op_muluh_i64: |
100 | return C_O1_I2(r, r, r); | 100 | return C_O1_I2(r, r, r); |
101 | 101 | ||
102 | -- | 102 | -- |
103 | 2.43.0 | 103 | 2.43.0 |
104 | 104 | ||
105 | 105 | diff view generated by jsdifflib |
1 | From: Fabiano Rosas <farosas@suse.de> | 1 | From: Fabiano Rosas <farosas@suse.de> |
---|---|---|---|
2 | 2 | ||
3 | When complying with the alignment requested in the ELF and unmapping | 3 | When complying with the alignment requested in the ELF and unmapping |
4 | the excess reservation, having align_end not aligned to the guest page | 4 | the excess reservation, having align_end not aligned to the guest page |
5 | causes the unmap to be rejected by the alignment check at | 5 | causes the unmap to be rejected by the alignment check at |
6 | target_munmap and later brk adjustments hit an EEXIST. | 6 | target_munmap and later brk adjustments hit an EEXIST. |
7 | 7 | ||
8 | Fix by aligning the start of region to be unmapped. | 8 | Fix by aligning the start of region to be unmapped. |
9 | 9 | ||
10 | Fixes: c81d1fafa6 ("linux-user: Honor elf alignment when placing images") | 10 | Fixes: c81d1fafa6 ("linux-user: Honor elf alignment when placing images") |
11 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1913 | 11 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1913 |
12 | Signed-off-by: Fabiano Rosas <farosas@suse.de> | 12 | Signed-off-by: Fabiano Rosas <farosas@suse.de> |
13 | [rth: Align load_end as well.] | 13 | [rth: Align load_end as well.] |
14 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 14 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
15 | Message-ID: <20250213143558.10504-1-farosas@suse.de> | 15 | Message-ID: <20250213143558.10504-1-farosas@suse.de> |
16 | --- | 16 | --- |
17 | linux-user/elfload.c | 4 ++-- | 17 | linux-user/elfload.c | 4 ++-- |
18 | 1 file changed, 2 insertions(+), 2 deletions(-) | 18 | 1 file changed, 2 insertions(+), 2 deletions(-) |
19 | 19 | ||
20 | diff --git a/linux-user/elfload.c b/linux-user/elfload.c | 20 | diff --git a/linux-user/elfload.c b/linux-user/elfload.c |
21 | index XXXXXXX..XXXXXXX 100644 | 21 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/linux-user/elfload.c | 22 | --- a/linux-user/elfload.c |
23 | +++ b/linux-user/elfload.c | 23 | +++ b/linux-user/elfload.c |
24 | @@ -XXX,XX +XXX,XX @@ static void load_elf_image(const char *image_name, const ImageSource *src, | 24 | @@ -XXX,XX +XXX,XX @@ static void load_elf_image(const char *image_name, const ImageSource *src, |
25 | 25 | ||
26 | if (align_size != reserve_size) { | 26 | if (align_size != reserve_size) { |
27 | abi_ulong align_addr = ROUND_UP(load_addr, align); | 27 | abi_ulong align_addr = ROUND_UP(load_addr, align); |
28 | - abi_ulong align_end = align_addr + reserve_size; | 28 | - abi_ulong align_end = align_addr + reserve_size; |
29 | - abi_ulong load_end = load_addr + align_size; | 29 | - abi_ulong load_end = load_addr + align_size; |
30 | + abi_ulong align_end = TARGET_PAGE_ALIGN(align_addr + reserve_size); | 30 | + abi_ulong align_end = TARGET_PAGE_ALIGN(align_addr + reserve_size); |
31 | + abi_ulong load_end = TARGET_PAGE_ALIGN(load_addr + align_size); | 31 | + abi_ulong load_end = TARGET_PAGE_ALIGN(load_addr + align_size); |
32 | 32 | ||
33 | if (align_addr != load_addr) { | 33 | if (align_addr != load_addr) { |
34 | target_munmap(load_addr, align_addr - load_addr); | 34 | target_munmap(load_addr, align_addr - load_addr); |
35 | -- | 35 | -- |
36 | 2.43.0 | 36 | 2.43.0 | diff view generated by jsdifflib |
1 | From: Andreas Schwab <schwab@suse.de> | 1 | From: Andreas Schwab <schwab@suse.de> |
---|---|---|---|
2 | 2 | ||
3 | SA_RESTORER and the associated sa_restorer field of struct sigaction are | 3 | SA_RESTORER and the associated sa_restorer field of struct sigaction are |
4 | an obsolete feature, not expected to be used by future architectures. | 4 | an obsolete feature, not expected to be used by future architectures. |
5 | They are also absent on RISC-V, LoongArch, Hexagon and OpenRISC, but | 5 | They are also absent on RISC-V, LoongArch, Hexagon and OpenRISC, but |
6 | defined due to their use of generic/signal.h. This leads to corrupted | 6 | defined due to their use of generic/signal.h. This leads to corrupted |
7 | data and out-of-bounds accesses. | 7 | data and out-of-bounds accesses. |
8 | 8 | ||
9 | Move the definition of TARGET_SA_RESTORER out of generic/signal.h into the | 9 | Move the definition of TARGET_SA_RESTORER out of generic/signal.h into the |
10 | target_signal.h files that need it. Note that m68k has the sa_restorer | 10 | target_signal.h files that need it. Note that m68k has the sa_restorer |
11 | field, but does not use it and does not define SA_RESTORER. | 11 | field, but does not use it and does not define SA_RESTORER. |
12 | 12 | ||
13 | Reported-by: Thomas Weißschuh <thomas@t-8ch.de> | 13 | Reported-by: Thomas Weißschuh <thomas@t-8ch.de> |
14 | Signed-off-by: Andreas Schwab <schwab@suse.de> | 14 | Signed-off-by: Andreas Schwab <schwab@suse.de> |
15 | Reviewed-by: Thomas Weißschuh <thomas@t-8ch.de> | 15 | Reviewed-by: Thomas Weißschuh <thomas@t-8ch.de> |
16 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 16 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
17 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 17 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
18 | Message-ID: <mvmed060xc9.fsf@suse.de> | 18 | Message-ID: <mvmed060xc9.fsf@suse.de> |
19 | --- | 19 | --- |
20 | linux-user/aarch64/target_signal.h | 2 ++ | 20 | linux-user/aarch64/target_signal.h | 2 ++ |
21 | linux-user/arm/target_signal.h | 2 ++ | 21 | linux-user/arm/target_signal.h | 2 ++ |
22 | linux-user/generic/signal.h | 1 - | 22 | linux-user/generic/signal.h | 1 - |
23 | linux-user/i386/target_signal.h | 2 ++ | 23 | linux-user/i386/target_signal.h | 2 ++ |
24 | linux-user/m68k/target_signal.h | 1 + | 24 | linux-user/m68k/target_signal.h | 1 + |
25 | linux-user/microblaze/target_signal.h | 2 ++ | 25 | linux-user/microblaze/target_signal.h | 2 ++ |
26 | linux-user/ppc/target_signal.h | 2 ++ | 26 | linux-user/ppc/target_signal.h | 2 ++ |
27 | linux-user/s390x/target_signal.h | 2 ++ | 27 | linux-user/s390x/target_signal.h | 2 ++ |
28 | linux-user/sh4/target_signal.h | 2 ++ | 28 | linux-user/sh4/target_signal.h | 2 ++ |
29 | linux-user/x86_64/target_signal.h | 2 ++ | 29 | linux-user/x86_64/target_signal.h | 2 ++ |
30 | linux-user/xtensa/target_signal.h | 2 ++ | 30 | linux-user/xtensa/target_signal.h | 2 ++ |
31 | 11 files changed, 19 insertions(+), 1 deletion(-) | 31 | 11 files changed, 19 insertions(+), 1 deletion(-) |
32 | 32 | ||
33 | diff --git a/linux-user/aarch64/target_signal.h b/linux-user/aarch64/target_signal.h | 33 | diff --git a/linux-user/aarch64/target_signal.h b/linux-user/aarch64/target_signal.h |
34 | index XXXXXXX..XXXXXXX 100644 | 34 | index XXXXXXX..XXXXXXX 100644 |
35 | --- a/linux-user/aarch64/target_signal.h | 35 | --- a/linux-user/aarch64/target_signal.h |
36 | +++ b/linux-user/aarch64/target_signal.h | 36 | +++ b/linux-user/aarch64/target_signal.h |
37 | @@ -XXX,XX +XXX,XX @@ | 37 | @@ -XXX,XX +XXX,XX @@ |
38 | 38 | ||
39 | #include "../generic/signal.h" | 39 | #include "../generic/signal.h" |
40 | 40 | ||
41 | +#define TARGET_SA_RESTORER 0x04000000 | 41 | +#define TARGET_SA_RESTORER 0x04000000 |
42 | + | 42 | + |
43 | #define TARGET_SEGV_MTEAERR 8 /* Asynchronous ARM MTE error */ | 43 | #define TARGET_SEGV_MTEAERR 8 /* Asynchronous ARM MTE error */ |
44 | #define TARGET_SEGV_MTESERR 9 /* Synchronous ARM MTE exception */ | 44 | #define TARGET_SEGV_MTESERR 9 /* Synchronous ARM MTE exception */ |
45 | 45 | ||
46 | diff --git a/linux-user/arm/target_signal.h b/linux-user/arm/target_signal.h | 46 | diff --git a/linux-user/arm/target_signal.h b/linux-user/arm/target_signal.h |
47 | index XXXXXXX..XXXXXXX 100644 | 47 | index XXXXXXX..XXXXXXX 100644 |
48 | --- a/linux-user/arm/target_signal.h | 48 | --- a/linux-user/arm/target_signal.h |
49 | +++ b/linux-user/arm/target_signal.h | 49 | +++ b/linux-user/arm/target_signal.h |
50 | @@ -XXX,XX +XXX,XX @@ | 50 | @@ -XXX,XX +XXX,XX @@ |
51 | 51 | ||
52 | #include "../generic/signal.h" | 52 | #include "../generic/signal.h" |
53 | 53 | ||
54 | +#define TARGET_SA_RESTORER 0x04000000 | 54 | +#define TARGET_SA_RESTORER 0x04000000 |
55 | + | 55 | + |
56 | #define TARGET_ARCH_HAS_SETUP_FRAME | 56 | #define TARGET_ARCH_HAS_SETUP_FRAME |
57 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 | 57 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 |
58 | 58 | ||
59 | diff --git a/linux-user/generic/signal.h b/linux-user/generic/signal.h | 59 | diff --git a/linux-user/generic/signal.h b/linux-user/generic/signal.h |
60 | index XXXXXXX..XXXXXXX 100644 | 60 | index XXXXXXX..XXXXXXX 100644 |
61 | --- a/linux-user/generic/signal.h | 61 | --- a/linux-user/generic/signal.h |
62 | +++ b/linux-user/generic/signal.h | 62 | +++ b/linux-user/generic/signal.h |
63 | @@ -XXX,XX +XXX,XX @@ | 63 | @@ -XXX,XX +XXX,XX @@ |
64 | #define TARGET_SA_RESTART 0x10000000 | 64 | #define TARGET_SA_RESTART 0x10000000 |
65 | #define TARGET_SA_NODEFER 0x40000000 | 65 | #define TARGET_SA_NODEFER 0x40000000 |
66 | #define TARGET_SA_RESETHAND 0x80000000 | 66 | #define TARGET_SA_RESETHAND 0x80000000 |
67 | -#define TARGET_SA_RESTORER 0x04000000 | 67 | -#define TARGET_SA_RESTORER 0x04000000 |
68 | 68 | ||
69 | #define TARGET_SIGHUP 1 | 69 | #define TARGET_SIGHUP 1 |
70 | #define TARGET_SIGINT 2 | 70 | #define TARGET_SIGINT 2 |
71 | diff --git a/linux-user/i386/target_signal.h b/linux-user/i386/target_signal.h | 71 | diff --git a/linux-user/i386/target_signal.h b/linux-user/i386/target_signal.h |
72 | index XXXXXXX..XXXXXXX 100644 | 72 | index XXXXXXX..XXXXXXX 100644 |
73 | --- a/linux-user/i386/target_signal.h | 73 | --- a/linux-user/i386/target_signal.h |
74 | +++ b/linux-user/i386/target_signal.h | 74 | +++ b/linux-user/i386/target_signal.h |
75 | @@ -XXX,XX +XXX,XX @@ | 75 | @@ -XXX,XX +XXX,XX @@ |
76 | 76 | ||
77 | #include "../generic/signal.h" | 77 | #include "../generic/signal.h" |
78 | 78 | ||
79 | +#define TARGET_SA_RESTORER 0x04000000 | 79 | +#define TARGET_SA_RESTORER 0x04000000 |
80 | + | 80 | + |
81 | #define TARGET_ARCH_HAS_SETUP_FRAME | 81 | #define TARGET_ARCH_HAS_SETUP_FRAME |
82 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 | 82 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 |
83 | 83 | ||
84 | diff --git a/linux-user/m68k/target_signal.h b/linux-user/m68k/target_signal.h | 84 | diff --git a/linux-user/m68k/target_signal.h b/linux-user/m68k/target_signal.h |
85 | index XXXXXXX..XXXXXXX 100644 | 85 | index XXXXXXX..XXXXXXX 100644 |
86 | --- a/linux-user/m68k/target_signal.h | 86 | --- a/linux-user/m68k/target_signal.h |
87 | +++ b/linux-user/m68k/target_signal.h | 87 | +++ b/linux-user/m68k/target_signal.h |
88 | @@ -XXX,XX +XXX,XX @@ | 88 | @@ -XXX,XX +XXX,XX @@ |
89 | 89 | ||
90 | #include "../generic/signal.h" | 90 | #include "../generic/signal.h" |
91 | 91 | ||
92 | +#define TARGET_ARCH_HAS_SA_RESTORER 1 | 92 | +#define TARGET_ARCH_HAS_SA_RESTORER 1 |
93 | #define TARGET_ARCH_HAS_SETUP_FRAME | 93 | #define TARGET_ARCH_HAS_SETUP_FRAME |
94 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 | 94 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 |
95 | 95 | ||
96 | diff --git a/linux-user/microblaze/target_signal.h b/linux-user/microblaze/target_signal.h | 96 | diff --git a/linux-user/microblaze/target_signal.h b/linux-user/microblaze/target_signal.h |
97 | index XXXXXXX..XXXXXXX 100644 | 97 | index XXXXXXX..XXXXXXX 100644 |
98 | --- a/linux-user/microblaze/target_signal.h | 98 | --- a/linux-user/microblaze/target_signal.h |
99 | +++ b/linux-user/microblaze/target_signal.h | 99 | +++ b/linux-user/microblaze/target_signal.h |
100 | @@ -XXX,XX +XXX,XX @@ | 100 | @@ -XXX,XX +XXX,XX @@ |
101 | 101 | ||
102 | #include "../generic/signal.h" | 102 | #include "../generic/signal.h" |
103 | 103 | ||
104 | +#define TARGET_SA_RESTORER 0x04000000 | 104 | +#define TARGET_SA_RESTORER 0x04000000 |
105 | + | 105 | + |
106 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 | 106 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 |
107 | 107 | ||
108 | #endif /* MICROBLAZE_TARGET_SIGNAL_H */ | 108 | #endif /* MICROBLAZE_TARGET_SIGNAL_H */ |
109 | diff --git a/linux-user/ppc/target_signal.h b/linux-user/ppc/target_signal.h | 109 | diff --git a/linux-user/ppc/target_signal.h b/linux-user/ppc/target_signal.h |
110 | index XXXXXXX..XXXXXXX 100644 | 110 | index XXXXXXX..XXXXXXX 100644 |
111 | --- a/linux-user/ppc/target_signal.h | 111 | --- a/linux-user/ppc/target_signal.h |
112 | +++ b/linux-user/ppc/target_signal.h | 112 | +++ b/linux-user/ppc/target_signal.h |
113 | @@ -XXX,XX +XXX,XX @@ | 113 | @@ -XXX,XX +XXX,XX @@ |
114 | 114 | ||
115 | #include "../generic/signal.h" | 115 | #include "../generic/signal.h" |
116 | 116 | ||
117 | +#define TARGET_SA_RESTORER 0x04000000 | 117 | +#define TARGET_SA_RESTORER 0x04000000 |
118 | + | 118 | + |
119 | #if !defined(TARGET_PPC64) | 119 | #if !defined(TARGET_PPC64) |
120 | #define TARGET_ARCH_HAS_SETUP_FRAME | 120 | #define TARGET_ARCH_HAS_SETUP_FRAME |
121 | #endif | 121 | #endif |
122 | diff --git a/linux-user/s390x/target_signal.h b/linux-user/s390x/target_signal.h | 122 | diff --git a/linux-user/s390x/target_signal.h b/linux-user/s390x/target_signal.h |
123 | index XXXXXXX..XXXXXXX 100644 | 123 | index XXXXXXX..XXXXXXX 100644 |
124 | --- a/linux-user/s390x/target_signal.h | 124 | --- a/linux-user/s390x/target_signal.h |
125 | +++ b/linux-user/s390x/target_signal.h | 125 | +++ b/linux-user/s390x/target_signal.h |
126 | @@ -XXX,XX +XXX,XX @@ | 126 | @@ -XXX,XX +XXX,XX @@ |
127 | 127 | ||
128 | #include "../generic/signal.h" | 128 | #include "../generic/signal.h" |
129 | 129 | ||
130 | +#define TARGET_SA_RESTORER 0x04000000 | 130 | +#define TARGET_SA_RESTORER 0x04000000 |
131 | + | 131 | + |
132 | #define TARGET_ARCH_HAS_SETUP_FRAME | 132 | #define TARGET_ARCH_HAS_SETUP_FRAME |
133 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 | 133 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 |
134 | 134 | ||
135 | diff --git a/linux-user/sh4/target_signal.h b/linux-user/sh4/target_signal.h | 135 | diff --git a/linux-user/sh4/target_signal.h b/linux-user/sh4/target_signal.h |
136 | index XXXXXXX..XXXXXXX 100644 | 136 | index XXXXXXX..XXXXXXX 100644 |
137 | --- a/linux-user/sh4/target_signal.h | 137 | --- a/linux-user/sh4/target_signal.h |
138 | +++ b/linux-user/sh4/target_signal.h | 138 | +++ b/linux-user/sh4/target_signal.h |
139 | @@ -XXX,XX +XXX,XX @@ | 139 | @@ -XXX,XX +XXX,XX @@ |
140 | 140 | ||
141 | #include "../generic/signal.h" | 141 | #include "../generic/signal.h" |
142 | 142 | ||
143 | +#define TARGET_SA_RESTORER 0x04000000 | 143 | +#define TARGET_SA_RESTORER 0x04000000 |
144 | + | 144 | + |
145 | #define TARGET_ARCH_HAS_SETUP_FRAME | 145 | #define TARGET_ARCH_HAS_SETUP_FRAME |
146 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 | 146 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 |
147 | 147 | ||
148 | diff --git a/linux-user/x86_64/target_signal.h b/linux-user/x86_64/target_signal.h | 148 | diff --git a/linux-user/x86_64/target_signal.h b/linux-user/x86_64/target_signal.h |
149 | index XXXXXXX..XXXXXXX 100644 | 149 | index XXXXXXX..XXXXXXX 100644 |
150 | --- a/linux-user/x86_64/target_signal.h | 150 | --- a/linux-user/x86_64/target_signal.h |
151 | +++ b/linux-user/x86_64/target_signal.h | 151 | +++ b/linux-user/x86_64/target_signal.h |
152 | @@ -XXX,XX +XXX,XX @@ | 152 | @@ -XXX,XX +XXX,XX @@ |
153 | 153 | ||
154 | #include "../generic/signal.h" | 154 | #include "../generic/signal.h" |
155 | 155 | ||
156 | +#define TARGET_SA_RESTORER 0x04000000 | 156 | +#define TARGET_SA_RESTORER 0x04000000 |
157 | + | 157 | + |
158 | /* For x86_64, use of SA_RESTORER is mandatory. */ | 158 | /* For x86_64, use of SA_RESTORER is mandatory. */ |
159 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 0 | 159 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 0 |
160 | 160 | ||
161 | diff --git a/linux-user/xtensa/target_signal.h b/linux-user/xtensa/target_signal.h | 161 | diff --git a/linux-user/xtensa/target_signal.h b/linux-user/xtensa/target_signal.h |
162 | index XXXXXXX..XXXXXXX 100644 | 162 | index XXXXXXX..XXXXXXX 100644 |
163 | --- a/linux-user/xtensa/target_signal.h | 163 | --- a/linux-user/xtensa/target_signal.h |
164 | +++ b/linux-user/xtensa/target_signal.h | 164 | +++ b/linux-user/xtensa/target_signal.h |
165 | @@ -XXX,XX +XXX,XX @@ | 165 | @@ -XXX,XX +XXX,XX @@ |
166 | 166 | ||
167 | #include "../generic/signal.h" | 167 | #include "../generic/signal.h" |
168 | 168 | ||
169 | +#define TARGET_SA_RESTORER 0x04000000 | 169 | +#define TARGET_SA_RESTORER 0x04000000 |
170 | + | 170 | + |
171 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 | 171 | #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1 |
172 | 172 | ||
173 | #endif | 173 | #endif |
174 | -- | 174 | -- |
175 | 2.43.0 | 175 | 2.43.0 |
176 | 176 | ||
177 | 177 | diff view generated by jsdifflib |
1 | From: Mikael Szreder <git@miszr.win> | 1 | From: Mikael Szreder <git@miszr.win> |
---|---|---|---|
2 | 2 | ||
3 | A bug was introduced in commit 0bba7572d40d which causes the fdtox | 3 | A bug was introduced in commit 0bba7572d40d which causes the fdtox |
4 | and fqtox instructions to incorrectly select the destination registers. | 4 | and fqtox instructions to incorrectly select the destination registers. |
5 | More information and a test program can be found in issue #2802. | 5 | More information and a test program can be found in issue #2802. |
6 | 6 | ||
7 | Cc: qemu-stable@nongnu.org | ||
7 | Fixes: 0bba7572d40d ("target/sparc: Perform DFPREG/QFPREG in decodetree") | 8 | Fixes: 0bba7572d40d ("target/sparc: Perform DFPREG/QFPREG in decodetree") |
8 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2802 | 9 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2802 |
9 | Signed-off-by: Mikael Szreder <git@miszr.win> | 10 | Signed-off-by: Mikael Szreder <git@miszr.win> |
10 | Acked-by: Artyom Tarasenko <atar4qemu@gmail.com> | 11 | Acked-by: Artyom Tarasenko <atar4qemu@gmail.com> |
11 | [rth: Squash patches together, since the second fixes a typo in the first.] | 12 | [rth: Squash patches together, since the second fixes a typo in the first.] |
... | ... | diff view generated by jsdifflib |
... | ... | ||
---|---|---|---|
7 | 7 | ||
8 | The issue was caused by the confusion between even register numbers | 8 | The issue was caused by the confusion between even register numbers |
9 | and even register indexes. For example, the register index of f32 is 64 | 9 | and even register indexes. For example, the register index of f32 is 64 |
10 | and f34 is 65. | 10 | and f34 is 65. |
11 | 11 | ||
12 | Cc: qemu-stable@nongnu.org | ||
12 | Fixes: 30038fd81808 ("target-sparc: Change fpr representation to doubles.") | 13 | Fixes: 30038fd81808 ("target-sparc: Change fpr representation to doubles.") |
13 | Signed-off-by: Mikael Szreder <git@miszr.win> | 14 | Signed-off-by: Mikael Szreder <git@miszr.win> |
14 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 15 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
15 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 16 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
16 | Message-ID: <20250214070343.11501-1-git@miszr.win> | 17 | Message-ID: <20250214070343.11501-1-git@miszr.win> |
... | ... | diff view generated by jsdifflib |
1 | From: Artyom Tarasenko <atar4qemu@gmail.com> | 1 | From: Artyom Tarasenko <atar4qemu@gmail.com> |
---|---|---|---|
2 | 2 | ||
3 | Fake access to | 3 | Fake access to |
4 | PCR Performance Control Register | 4 | PCR Performance Control Register |
5 | and | 5 | and |
6 | PIC Performance Instrumentation Counter. | 6 | PIC Performance Instrumentation Counter. |
7 | 7 | ||
8 | Ignore writes in privileged mode, and return 0 on reads. | 8 | Ignore writes in privileged mode, and return 0 on reads. |
9 | 9 | ||
10 | This allows booting Tribblix, MilaX and v9os under Niagara target. | 10 | This allows booting Tribblix, MilaX and v9os under Niagara target. |
11 | 11 | ||
12 | Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> | 12 | Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> |
13 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 13 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
14 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 14 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
15 | Message-ID: <20250209211248.50383-1-atar4qemu@gmail.com> | 15 | Message-ID: <20250209211248.50383-1-atar4qemu@gmail.com> |
16 | --- | 16 | --- |
17 | target/sparc/translate.c | 19 +++++++++++++++++++ | 17 | target/sparc/translate.c | 19 +++++++++++++++++++ |
18 | target/sparc/insns.decode | 7 ++++++- | 18 | target/sparc/insns.decode | 7 ++++++- |
19 | 2 files changed, 25 insertions(+), 1 deletion(-) | 19 | 2 files changed, 25 insertions(+), 1 deletion(-) |
20 | 20 | ||
21 | diff --git a/target/sparc/translate.c b/target/sparc/translate.c | 21 | diff --git a/target/sparc/translate.c b/target/sparc/translate.c |
22 | index XXXXXXX..XXXXXXX 100644 | 22 | index XXXXXXX..XXXXXXX 100644 |
23 | --- a/target/sparc/translate.c | 23 | --- a/target/sparc/translate.c |
24 | +++ b/target/sparc/translate.c | 24 | +++ b/target/sparc/translate.c |
25 | @@ -XXX,XX +XXX,XX @@ static TCGv do_rd_leon3_config(DisasContext *dc, TCGv dst) | 25 | @@ -XXX,XX +XXX,XX @@ static TCGv do_rd_leon3_config(DisasContext *dc, TCGv dst) |
26 | 26 | ||
27 | TRANS(RDASR17, ASR17, do_rd_special, true, a->rd, do_rd_leon3_config) | 27 | TRANS(RDASR17, ASR17, do_rd_special, true, a->rd, do_rd_leon3_config) |
28 | 28 | ||
29 | +static TCGv do_rdpic(DisasContext *dc, TCGv dst) | 29 | +static TCGv do_rdpic(DisasContext *dc, TCGv dst) |
30 | +{ | 30 | +{ |
31 | + return tcg_constant_tl(0); | 31 | + return tcg_constant_tl(0); |
32 | +} | 32 | +} |
33 | + | 33 | + |
34 | +TRANS(RDPIC, HYPV, do_rd_special, supervisor(dc), a->rd, do_rdpic) | 34 | +TRANS(RDPIC, HYPV, do_rd_special, supervisor(dc), a->rd, do_rdpic) |
35 | + | 35 | + |
36 | + | 36 | + |
37 | static TCGv do_rdccr(DisasContext *dc, TCGv dst) | 37 | static TCGv do_rdccr(DisasContext *dc, TCGv dst) |
38 | { | 38 | { |
39 | gen_helper_rdccr(dst, tcg_env); | 39 | gen_helper_rdccr(dst, tcg_env); |
40 | @@ -XXX,XX +XXX,XX @@ static void do_wrfprs(DisasContext *dc, TCGv src) | 40 | @@ -XXX,XX +XXX,XX @@ static void do_wrfprs(DisasContext *dc, TCGv src) |
41 | 41 | ||
42 | TRANS(WRFPRS, 64, do_wr_special, a, true, do_wrfprs) | 42 | TRANS(WRFPRS, 64, do_wr_special, a, true, do_wrfprs) |
43 | 43 | ||
44 | +static bool do_priv_nop(DisasContext *dc, bool priv) | 44 | +static bool do_priv_nop(DisasContext *dc, bool priv) |
45 | +{ | 45 | +{ |
46 | + if (!priv) { | 46 | + if (!priv) { |
47 | + return raise_priv(dc); | 47 | + return raise_priv(dc); |
48 | + } | 48 | + } |
49 | + return advance_pc(dc); | 49 | + return advance_pc(dc); |
50 | +} | 50 | +} |
51 | + | 51 | + |
52 | +TRANS(WRPCR, HYPV, do_priv_nop, supervisor(dc)) | 52 | +TRANS(WRPCR, HYPV, do_priv_nop, supervisor(dc)) |
53 | +TRANS(WRPIC, HYPV, do_priv_nop, supervisor(dc)) | 53 | +TRANS(WRPIC, HYPV, do_priv_nop, supervisor(dc)) |
54 | + | 54 | + |
55 | static void do_wrgsr(DisasContext *dc, TCGv src) | 55 | static void do_wrgsr(DisasContext *dc, TCGv src) |
56 | { | 56 | { |
57 | gen_trap_ifnofpu(dc); | 57 | gen_trap_ifnofpu(dc); |
58 | diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode | 58 | diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode |
59 | index XXXXXXX..XXXXXXX 100644 | 59 | index XXXXXXX..XXXXXXX 100644 |
60 | --- a/target/sparc/insns.decode | 60 | --- a/target/sparc/insns.decode |
61 | +++ b/target/sparc/insns.decode | 61 | +++ b/target/sparc/insns.decode |
62 | @@ -XXX,XX +XXX,XX @@ CALL 01 i:s30 | 62 | @@ -XXX,XX +XXX,XX @@ CALL 01 i:s30 |
63 | RDTICK 10 rd:5 101000 00100 0 0000000000000 | 63 | RDTICK 10 rd:5 101000 00100 0 0000000000000 |
64 | RDPC 10 rd:5 101000 00101 0 0000000000000 | 64 | RDPC 10 rd:5 101000 00101 0 0000000000000 |
65 | RDFPRS 10 rd:5 101000 00110 0 0000000000000 | 65 | RDFPRS 10 rd:5 101000 00110 0 0000000000000 |
66 | - RDASR17 10 rd:5 101000 10001 0 0000000000000 | 66 | - RDASR17 10 rd:5 101000 10001 0 0000000000000 |
67 | + { | 67 | + { |
68 | + RDASR17 10 rd:5 101000 10001 0 0000000000000 | 68 | + RDASR17 10 rd:5 101000 10001 0 0000000000000 |
69 | + RDPIC 10 rd:5 101000 10001 0 0000000000000 | 69 | + RDPIC 10 rd:5 101000 10001 0 0000000000000 |
70 | + } | 70 | + } |
71 | RDGSR 10 rd:5 101000 10011 0 0000000000000 | 71 | RDGSR 10 rd:5 101000 10011 0 0000000000000 |
72 | RDSOFTINT 10 rd:5 101000 10110 0 0000000000000 | 72 | RDSOFTINT 10 rd:5 101000 10110 0 0000000000000 |
73 | RDTICK_CMPR 10 rd:5 101000 10111 0 0000000000000 | 73 | RDTICK_CMPR 10 rd:5 101000 10111 0 0000000000000 |
74 | @@ -XXX,XX +XXX,XX @@ CALL 01 i:s30 | 74 | @@ -XXX,XX +XXX,XX @@ CALL 01 i:s30 |
75 | WRCCR 10 00010 110000 ..... . ............. @n_r_ri | 75 | WRCCR 10 00010 110000 ..... . ............. @n_r_ri |
76 | WRASI 10 00011 110000 ..... . ............. @n_r_ri | 76 | WRASI 10 00011 110000 ..... . ............. @n_r_ri |
77 | WRFPRS 10 00110 110000 ..... . ............. @n_r_ri | 77 | WRFPRS 10 00110 110000 ..... . ............. @n_r_ri |
78 | + WRPCR 10 10000 110000 01000 0 0000000000000 | 78 | + WRPCR 10 10000 110000 01000 0 0000000000000 |
79 | + WRPIC 10 10001 110000 01000 0 0000000000000 | 79 | + WRPIC 10 10001 110000 01000 0 0000000000000 |
80 | { | 80 | { |
81 | WRGSR 10 10011 110000 ..... . ............. @n_r_ri | 81 | WRGSR 10 10011 110000 ..... . ............. @n_r_ri |
82 | WRPOWERDOWN 10 10011 110000 ..... . ............. @n_r_ri | 82 | WRPOWERDOWN 10 10011 110000 ..... . ............. @n_r_ri |
83 | -- | 83 | -- |
84 | 2.43.0 | 84 | 2.43.0 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Eliminate code repetition by using the appropriate helpers. | ||
1 | 2 | ||
3 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | --- | ||
6 | tcg/i386/tcg-target.c.inc | 65 +++++---------------------------------- | ||
7 | 1 file changed, 8 insertions(+), 57 deletions(-) | ||
8 | |||
9 | diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc | ||
10 | index XXXXXXX..XXXXXXX 100644 | ||
11 | --- a/tcg/i386/tcg-target.c.inc | ||
12 | +++ b/tcg/i386/tcg-target.c.inc | ||
13 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_brcond2(TCGContext *s, const TCGArg *args, | ||
14 | tcg_out_brcond(s, 0, cond, args[1], args[3], const_args[3], | ||
15 | label_this, small); | ||
16 | break; | ||
17 | + | ||
18 | case TCG_COND_NE: | ||
19 | case TCG_COND_TSTNE: | ||
20 | tcg_out_brcond(s, 0, cond, args[0], args[2], const_args[2], | ||
21 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_brcond2(TCGContext *s, const TCGArg *args, | ||
22 | tcg_out_brcond(s, 0, cond, args[1], args[3], const_args[3], | ||
23 | label_this, small); | ||
24 | break; | ||
25 | - case TCG_COND_LT: | ||
26 | - tcg_out_brcond(s, 0, TCG_COND_LT, args[1], args[3], const_args[3], | ||
27 | - label_this, small); | ||
28 | - tcg_out_jxx(s, JCC_JNE, label_next, 1); | ||
29 | - tcg_out_brcond(s, 0, TCG_COND_LTU, args[0], args[2], const_args[2], | ||
30 | - label_this, small); | ||
31 | - break; | ||
32 | - case TCG_COND_LE: | ||
33 | - tcg_out_brcond(s, 0, TCG_COND_LT, args[1], args[3], const_args[3], | ||
34 | - label_this, small); | ||
35 | - tcg_out_jxx(s, JCC_JNE, label_next, 1); | ||
36 | - tcg_out_brcond(s, 0, TCG_COND_LEU, args[0], args[2], const_args[2], | ||
37 | - label_this, small); | ||
38 | - break; | ||
39 | - case TCG_COND_GT: | ||
40 | - tcg_out_brcond(s, 0, TCG_COND_GT, args[1], args[3], const_args[3], | ||
41 | - label_this, small); | ||
42 | - tcg_out_jxx(s, JCC_JNE, label_next, 1); | ||
43 | - tcg_out_brcond(s, 0, TCG_COND_GTU, args[0], args[2], const_args[2], | ||
44 | - label_this, small); | ||
45 | - break; | ||
46 | - case TCG_COND_GE: | ||
47 | - tcg_out_brcond(s, 0, TCG_COND_GT, args[1], args[3], const_args[3], | ||
48 | - label_this, small); | ||
49 | - tcg_out_jxx(s, JCC_JNE, label_next, 1); | ||
50 | - tcg_out_brcond(s, 0, TCG_COND_GEU, args[0], args[2], const_args[2], | ||
51 | - label_this, small); | ||
52 | - break; | ||
53 | - case TCG_COND_LTU: | ||
54 | - tcg_out_brcond(s, 0, TCG_COND_LTU, args[1], args[3], const_args[3], | ||
55 | - label_this, small); | ||
56 | - tcg_out_jxx(s, JCC_JNE, label_next, 1); | ||
57 | - tcg_out_brcond(s, 0, TCG_COND_LTU, args[0], args[2], const_args[2], | ||
58 | - label_this, small); | ||
59 | - break; | ||
60 | - case TCG_COND_LEU: | ||
61 | - tcg_out_brcond(s, 0, TCG_COND_LTU, args[1], args[3], const_args[3], | ||
62 | - label_this, small); | ||
63 | - tcg_out_jxx(s, JCC_JNE, label_next, 1); | ||
64 | - tcg_out_brcond(s, 0, TCG_COND_LEU, args[0], args[2], const_args[2], | ||
65 | - label_this, small); | ||
66 | - break; | ||
67 | - case TCG_COND_GTU: | ||
68 | - tcg_out_brcond(s, 0, TCG_COND_GTU, args[1], args[3], const_args[3], | ||
69 | - label_this, small); | ||
70 | - tcg_out_jxx(s, JCC_JNE, label_next, 1); | ||
71 | - tcg_out_brcond(s, 0, TCG_COND_GTU, args[0], args[2], const_args[2], | ||
72 | - label_this, small); | ||
73 | - break; | ||
74 | - case TCG_COND_GEU: | ||
75 | - tcg_out_brcond(s, 0, TCG_COND_GTU, args[1], args[3], const_args[3], | ||
76 | - label_this, small); | ||
77 | - tcg_out_jxx(s, JCC_JNE, label_next, 1); | ||
78 | - tcg_out_brcond(s, 0, TCG_COND_GEU, args[0], args[2], const_args[2], | ||
79 | - label_this, small); | ||
80 | - break; | ||
81 | + | ||
82 | default: | ||
83 | - g_assert_not_reached(); | ||
84 | + tcg_out_brcond(s, 0, tcg_high_cond(cond), args[1], | ||
85 | + args[3], const_args[3], label_this, small); | ||
86 | + tcg_out_jxx(s, JCC_JNE, label_next, 1); | ||
87 | + tcg_out_brcond(s, 0, tcg_unsigned_cond(cond), args[0], | ||
88 | + args[2], const_args[2], label_this, small); | ||
89 | + break; | ||
90 | } | ||
91 | tcg_out_label(s, label_next); | ||
92 | } | ||
93 | -- | ||
94 | 2.43.0 | ||
95 | |||
96 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | These defines never should have been added as they were | ||
2 | never used. Only 32-bit hosts may have these opcodes and | ||
3 | they have them unconditionally. | ||
1 | 4 | ||
5 | Fixes: 6cb14e4de29 ("tcg/loongarch64: Add the tcg-target.h file") | ||
6 | Fixes: fb1f70f3685 ("tcg/riscv: Add the tcg-target.h file") | ||
7 | Acked-by: Alistair Francis <alistair.francis@wdc.com> | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
9 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
10 | --- | ||
11 | tcg/loongarch64/tcg-target-has.h | 2 -- | ||
12 | tcg/riscv/tcg-target-has.h | 2 -- | ||
13 | 2 files changed, 4 deletions(-) | ||
14 | |||
15 | diff --git a/tcg/loongarch64/tcg-target-has.h b/tcg/loongarch64/tcg-target-has.h | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/tcg/loongarch64/tcg-target-has.h | ||
18 | +++ b/tcg/loongarch64/tcg-target-has.h | ||
19 | @@ -XXX,XX +XXX,XX @@ | ||
20 | #define TCG_TARGET_HAS_clz_i32 1 | ||
21 | #define TCG_TARGET_HAS_ctz_i32 1 | ||
22 | #define TCG_TARGET_HAS_ctpop_i32 0 | ||
23 | -#define TCG_TARGET_HAS_brcond2 0 | ||
24 | -#define TCG_TARGET_HAS_setcond2 0 | ||
25 | #define TCG_TARGET_HAS_qemu_st8_i32 0 | ||
26 | |||
27 | /* 64-bit operations */ | ||
28 | diff --git a/tcg/riscv/tcg-target-has.h b/tcg/riscv/tcg-target-has.h | ||
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/tcg/riscv/tcg-target-has.h | ||
31 | +++ b/tcg/riscv/tcg-target-has.h | ||
32 | @@ -XXX,XX +XXX,XX @@ | ||
33 | #define TCG_TARGET_HAS_clz_i32 (cpuinfo & CPUINFO_ZBB) | ||
34 | #define TCG_TARGET_HAS_ctz_i32 (cpuinfo & CPUINFO_ZBB) | ||
35 | #define TCG_TARGET_HAS_ctpop_i32 (cpuinfo & CPUINFO_ZBB) | ||
36 | -#define TCG_TARGET_HAS_brcond2 1 | ||
37 | -#define TCG_TARGET_HAS_setcond2 1 | ||
38 | #define TCG_TARGET_HAS_qemu_st8_i32 0 | ||
39 | |||
40 | #define TCG_TARGET_HAS_negsetcond_i64 1 | ||
41 | -- | ||
42 | 2.43.0 | ||
43 | |||
44 | diff view generated by jsdifflib |