[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/27] tcg/s390x: Use LARL+AGHI for odd addresses
From: |
Richard Henderson |
Subject: |
[PULL 11/27] tcg/s390x: Use LARL+AGHI for odd addresses |
Date: |
Fri, 6 Jan 2023 23:51:02 -0800 |
Add one instead of dropping odd addresses to the constant pool.
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/s390x/tcg-target.c.inc | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc
index e4403ffabf..6cf07152a5 100644
--- a/tcg/s390x/tcg-target.c.inc
+++ b/tcg/s390x/tcg-target.c.inc
@@ -806,6 +806,7 @@ static void tcg_out_movi(TCGContext *s, TCGType type,
TCGReg ret, tcg_target_long sval)
{
tcg_target_ulong uval;
+ ptrdiff_t pc_off;
/* Try all 32-bit insns that can load it in one go. */
if (maybe_out_small_movi(s, type, ret, sval)) {
@@ -832,14 +833,14 @@ static void tcg_out_movi(TCGContext *s, TCGType type,
return;
}
- /* Try for PC-relative address load. For odd addresses,
- attempt to use an offset from the start of the TB. */
- if ((sval & 1) == 0) {
- ptrdiff_t off = tcg_pcrel_diff(s, (void *)sval) >> 1;
- if (off == (int32_t)off) {
- tcg_out_insn(s, RIL, LARL, ret, off);
- return;
+ /* Try for PC-relative address load. For odd addresses, add one. */
+ pc_off = tcg_pcrel_diff(s, (void *)sval) >> 1;
+ if (pc_off == (int32_t)pc_off) {
+ tcg_out_insn(s, RIL, LARL, ret, pc_off);
+ if (sval & 1) {
+ tcg_out_insn(s, RI, AGHI, ret, 1);
}
+ return;
}
/* Otherwise, stuff it in the constant pool. */
--
2.34.1
- [PULL 03/27] tcg/s390x: Always set TCG_TARGET_HAS_direct_jump, (continued)
- [PULL 03/27] tcg/s390x: Always set TCG_TARGET_HAS_direct_jump, Richard Henderson, 2023/01/07
- [PULL 06/27] tcg/s390x: Check for extended-immediate facility at startup, Richard Henderson, 2023/01/07
- [PULL 08/27] tcg/s390x: Check for load-on-condition facility at startup, Richard Henderson, 2023/01/07
- [PULL 12/27] tcg/s390x: Distinguish RRF-a and RRF-c formats, Richard Henderson, 2023/01/07
- [PULL 15/27] tcg/s390x: Support MIE2 MGRK instruction, Richard Henderson, 2023/01/07
- [PULL 16/27] tcg/s390x: Issue XILF directly for xor_i32, Richard Henderson, 2023/01/07
- [PULL 09/27] tcg/s390x: Remove FAST_BCR_SER facility check, Richard Henderson, 2023/01/07
- [PULL 04/27] tcg/s390x: Remove USE_LONG_BRANCHES, Richard Henderson, 2023/01/07
- [PULL 07/27] tcg/s390x: Check for general-instruction-extension facility at startup, Richard Henderson, 2023/01/07
- [PULL 05/27] tcg/s390x: Check for long-displacement facility at startup, Richard Henderson, 2023/01/07
- [PULL 11/27] tcg/s390x: Use LARL+AGHI for odd addresses,
Richard Henderson <=
- [PULL 10/27] tcg/s390x: Remove DISTINCT_OPERANDS facility check, Richard Henderson, 2023/01/07
- [PULL 13/27] tcg/s390x: Distinguish RIE formats, Richard Henderson, 2023/01/07
- [PULL 14/27] tcg/s390x: Support MIE2 multiply single instructions, Richard Henderson, 2023/01/07
- [PULL 19/27] tcg/s390x: Support MIE3 logical operations, Richard Henderson, 2023/01/07
- [PULL 23/27] tcg/s390x: Use tgen_movcond_int in tgen_clz, Richard Henderson, 2023/01/07
- [PULL 25/27] tcg/s390x: Tighten constraints for 64-bit compare, Richard Henderson, 2023/01/07
- [PULL 17/27] tcg/s390x: Tighten constraints for or_i64 and xor_i64, Richard Henderson, 2023/01/07
- [PULL 18/27] tcg/s390x: Tighten constraints for and_i64, Richard Henderson, 2023/01/07
- [PULL 21/27] tcg/s390x: Generalize movcond implementation, Richard Henderson, 2023/01/07
- [PULL 26/27] tcg/s390x: Cleanup tcg_out_movi, Richard Henderson, 2023/01/07