[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 12/13] tcg-s390: Use all 20 bits of the offset in
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL v2 12/13] tcg-s390: Use all 20 bits of the offset in tcg_out_mem |
Date: |
Fri, 5 Apr 2013 13:47:40 -0500 |
This can save one insn, if the constant has any bits in 32-63 set,
but no bits in 21-31 set. It never results in more insns.
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/s390/tcg-target.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c
index 22927df..8e660b3 100644
--- a/tcg/s390/tcg-target.c
+++ b/tcg/s390/tcg-target.c
@@ -748,10 +748,11 @@ static void tcg_out_mem(TCGContext *s, S390Opcode opc_rx,
S390Opcode opc_rxy,
tcg_target_long ofs)
{
if (ofs < -0x80000 || ofs >= 0x80000) {
- /* Combine the low 16 bits of the offset with the actual load insn;
- the high 48 bits must come from an immediate load. */
- tcg_out_movi(s, TCG_TYPE_PTR, TCG_TMP0, ofs & ~0xffff);
- ofs &= 0xffff;
+ /* Combine the low 20 bits of the offset with the actual load insn;
+ the high 44 bits must come from an immediate load. */
+ tcg_target_long low = ((ofs & 0xfffff) ^ 0x80000) - 0x80000;
+ tcg_out_movi(s, TCG_TYPE_PTR, TCG_TMP0, ofs - low);
+ ofs = low;
/* If we were already given an index register, add it in. */
if (index != TCG_REG_NONE) {
--
1.8.1.4
- [Qemu-devel] [PULL v2 02/13] tcg-s390: Properly allocate a stack frame., (continued)
- [Qemu-devel] [PULL v2 02/13] tcg-s390: Properly allocate a stack frame., Richard Henderson, 2013/04/05
- [Qemu-devel] [PULL v2 01/13] tcg-s390: Fix movi, Richard Henderson, 2013/04/05
- [Qemu-devel] [PULL v2 04/13] tcg-s390: Implement add2/sub2 opcodes, Richard Henderson, 2013/04/05
- [Qemu-devel] [PULL v2 03/13] tcg-s390: Remove useless preprocessor conditions, Richard Henderson, 2013/04/05
- [Qemu-devel] [PULL v2 07/13] tcg-s390: Implement deposit opcodes, Richard Henderson, 2013/04/05
- [Qemu-devel] [PULL v2 05/13] tcg-s390: Implement mulu2_i64 opcode, Richard Henderson, 2013/04/05
- [Qemu-devel] [PULL v2 06/13] tcg-s390: Implement movcond opcodes, Richard Henderson, 2013/04/05
- [Qemu-devel] [PULL v2 09/13] tcg-s390: Use risbgz for andi, Richard Henderson, 2013/04/05
- [Qemu-devel] [PULL v2 08/13] tcg-s390: Remove constraint letters for and, Richard Henderson, 2013/04/05
- [Qemu-devel] [PULL v2 11/13] tcg-s390: Use load-address for addition, Richard Henderson, 2013/04/05
- [Qemu-devel] [PULL v2 12/13] tcg-s390: Use all 20 bits of the offset in tcg_out_mem,
Richard Henderson <=
- [Qemu-devel] [PULL v2 10/13] tcg-s390: Cleanup argument shuffling fixme in softmmu code, Richard Henderson, 2013/04/05
- [Qemu-devel] [PULL v2 13/13] tcg-s390: Fix merge error in tgen_brcond, Richard Henderson, 2013/04/05
- Re: [Qemu-devel] [PULL v2 00/13] tcg-s390 updates, Richard Henderson, 2013/04/09
- Re: [Qemu-devel] [PULL v2 00/13] tcg-s390 updates, Aurelien Jarno, 2013/04/13