* [PATCH][ARM][cleanup] Use R0_REGNUM and R1_REGNUM instead of 0 and 1 where appropriate
@ 2014-12-11 9:34 Kyrill Tkachov
2015-01-09 11:45 ` Kyrill Tkachov
2015-01-12 11:56 ` Ramana Radhakrishnan
0 siblings, 2 replies; 3+ messages in thread
From: Kyrill Tkachov @ 2014-12-11 9:34 UTC (permalink / raw)
To: GCC Patches; +Cc: Ramana Radhakrishnan, Richard Earnshaw
[-- Attachment #1: Type: text/plain, Size: 682 bytes --]
Hi all,
While looking in this area on other business I noticed we could be using
the names R0_REGNUM
and R1_REGNUM when creating those REG rtxs since it's a bit more
descriptive that just 0 and 1.
Tested arm-none-eabi.
Ok for trunk?
Thanks,
Kyrill
2014-12-11 Kyrylo Tkachov kyrylo.tkachov@arm.com
* config/arm/arm.c (arm_load_tp): Use R0_REGNUM instead of constant 0
in gen_rtx_REG.
(arm_tls_descseq_addr): Likewise.
(arm_gen_movmemqi): Likewise.
(arm_expand_epilogue_apcs_frame): Likewise.
(arm_expand_epilogue): Likewise.
(arm_expand_prologue): Likewise. Use R1_REGNUM instead of constant 1
in gen_rtx_REG.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: arm-cleanup-regnum.patch --]
[-- Type: text/x-patch; name=arm-cleanup-regnum.patch, Size: 2676 bytes --]
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 64494e8..d17c81d 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -7431,7 +7431,7 @@ arm_load_tp (rtx target)
emit_insn (gen_load_tp_soft ());
- tmp = gen_rtx_REG (SImode, 0);
+ tmp = gen_rtx_REG (SImode, R0_REGNUM);
emit_move_insn (target, tmp);
}
return target;
@@ -7495,13 +7495,13 @@ arm_tls_descseq_addr (rtx x, rtx reg)
gen_rtx_CONST (VOIDmode, label),
GEN_INT (!TARGET_ARM)),
UNSPEC_TLS);
- rtx reg0 = load_tls_operand (sum, gen_rtx_REG (SImode, 0));
+ rtx reg0 = load_tls_operand (sum, gen_rtx_REG (SImode, R0_REGNUM));
emit_insn (gen_tlscall (x, labelno));
if (!reg)
reg = gen_reg_rtx (SImode);
else
- gcc_assert (REGNO (reg) != 0);
+ gcc_assert (REGNO (reg) != R0_REGNUM);
emit_move_insn (reg, reg0);
@@ -14659,7 +14659,7 @@ arm_gen_movmemqi (rtx *operands)
else
{
mem = adjust_automodify_address (dstbase, SImode, dst, dstoffset);
- emit_move_insn (mem, gen_rtx_REG (SImode, 0));
+ emit_move_insn (mem, gen_rtx_REG (SImode, R0_REGNUM));
if (last_bytes != 0)
{
emit_insn (gen_addsi3 (dst, dst, GEN_INT (4)));
@@ -21092,8 +21092,8 @@ arm_expand_prologue (void)
Just tell it we saved SP in r0. */
gcc_assert (TARGET_THUMB2 && !arm_arch_notm && args_to_push == 0);
- r0 = gen_rtx_REG (SImode, 0);
- r1 = gen_rtx_REG (SImode, 1);
+ r0 = gen_rtx_REG (SImode, R0_REGNUM);
+ r1 = gen_rtx_REG (SImode, R1_REGNUM);
insn = emit_insn (gen_movsi (r0, stack_pointer_rtx));
RTX_FRAME_RELATED_P (insn) = 1;
@@ -24866,7 +24866,7 @@ arm_expand_epilogue_apcs_frame (bool really_return)
/* Restore the original stack pointer. Before prologue, the stack was
realigned and the original stack pointer saved in r0. For details,
see comment in arm_expand_prologue. */
- emit_insn (gen_movsi (stack_pointer_rtx, gen_rtx_REG (SImode, 0)));
+ emit_insn (gen_movsi (stack_pointer_rtx, gen_rtx_REG (SImode, R0_REGNUM)));
emit_jump_insn (simple_return_rtx);
}
@@ -25148,7 +25148,7 @@ arm_expand_epilogue (bool really_return)
/* Restore the original stack pointer. Before prologue, the stack was
realigned and the original stack pointer saved in r0. For details,
see comment in arm_expand_prologue. */
- emit_insn (gen_movsi (stack_pointer_rtx, gen_rtx_REG (SImode, 0)));
+ emit_insn (gen_movsi (stack_pointer_rtx, gen_rtx_REG (SImode, R0_REGNUM)));
emit_jump_insn (simple_return_rtx);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][ARM][cleanup] Use R0_REGNUM and R1_REGNUM instead of 0 and 1 where appropriate
2014-12-11 9:34 [PATCH][ARM][cleanup] Use R0_REGNUM and R1_REGNUM instead of 0 and 1 where appropriate Kyrill Tkachov
@ 2015-01-09 11:45 ` Kyrill Tkachov
2015-01-12 11:56 ` Ramana Radhakrishnan
1 sibling, 0 replies; 3+ messages in thread
From: Kyrill Tkachov @ 2015-01-09 11:45 UTC (permalink / raw)
To: GCC Patches; +Cc: Ramana Radhakrishnan, Richard Earnshaw
Ping.
https://gcc.gnu.org/ml/gcc-patches/2014-12/msg00989.html
Thanks,
Kyrill
On 11/12/14 09:34, Kyrill Tkachov wrote:
> Hi all,
>
> While looking in this area on other business I noticed we could be using
> the names R0_REGNUM
> and R1_REGNUM when creating those REG rtxs since it's a bit more
> descriptive that just 0 and 1.
>
> Tested arm-none-eabi.
>
> Ok for trunk?
>
> Thanks,
> Kyrill
>
> 2014-12-11 Kyrylo Tkachov kyrylo.tkachov@arm.com
>
> * config/arm/arm.c (arm_load_tp): Use R0_REGNUM instead of constant 0
> in gen_rtx_REG.
> (arm_tls_descseq_addr): Likewise.
> (arm_gen_movmemqi): Likewise.
> (arm_expand_epilogue_apcs_frame): Likewise.
> (arm_expand_epilogue): Likewise.
> (arm_expand_prologue): Likewise. Use R1_REGNUM instead of constant 1
> in gen_rtx_REG.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][ARM][cleanup] Use R0_REGNUM and R1_REGNUM instead of 0 and 1 where appropriate
2014-12-11 9:34 [PATCH][ARM][cleanup] Use R0_REGNUM and R1_REGNUM instead of 0 and 1 where appropriate Kyrill Tkachov
2015-01-09 11:45 ` Kyrill Tkachov
@ 2015-01-12 11:56 ` Ramana Radhakrishnan
1 sibling, 0 replies; 3+ messages in thread
From: Ramana Radhakrishnan @ 2015-01-12 11:56 UTC (permalink / raw)
To: Kyrill Tkachov; +Cc: GCC Patches, Ramana Radhakrishnan, Richard Earnshaw
On Thu, Dec 11, 2014 at 9:34 AM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
> Hi all,
>
> While looking in this area on other business I noticed we could be using the
> names R0_REGNUM
> and R1_REGNUM when creating those REG rtxs since it's a bit more descriptive
> that just 0 and 1.
>
> Tested arm-none-eabi.
>
> Ok for trunk?
Sorry been on holiday and now catching up on emails.
This is OK, thanks.
Ramana
>
> Thanks,
> Kyrill
>
> 2014-12-11 Kyrylo Tkachov kyrylo.tkachov@arm.com
>
> * config/arm/arm.c (arm_load_tp): Use R0_REGNUM instead of constant 0
> in gen_rtx_REG.
> (arm_tls_descseq_addr): Likewise.
> (arm_gen_movmemqi): Likewise.
> (arm_expand_epilogue_apcs_frame): Likewise.
> (arm_expand_epilogue): Likewise.
> (arm_expand_prologue): Likewise. Use R1_REGNUM instead of constant 1
> in gen_rtx_REG.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-01-12 11:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-11 9:34 [PATCH][ARM][cleanup] Use R0_REGNUM and R1_REGNUM instead of 0 and 1 where appropriate Kyrill Tkachov
2015-01-09 11:45 ` Kyrill Tkachov
2015-01-12 11:56 ` Ramana Radhakrishnan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).