Patchwork [AArch64] Minor refactoring of aarch64_add_offset

login
register
mail settings
Submitter Yufeng Zhang
Date June 25, 2013, 4:04 p.m.
Message ID <51C9BF73.4090001@arm.com>
Download mbox | patch
Permalink /patch/254218/
State New
Headers show

Comments

Yufeng Zhang - June 25, 2013, 4:04 p.m.
This patch carries out minor refactoring on aarch64_add_offset; it 
replaces 'DImode' and 'Pmode' with 'mode'.

OK for the trunk?

Thanks,
Yufeng


gcc/

         * config/aarch64/aarch64.c (aarch64_add_offset): Change to pass
         'mode' to aarch64_plus_immediate and gen_rtx_PLUS.
Marcus Shawcroft - June 27, 2013, 11:46 a.m.
On 25/06/13 17:04, Yufeng Zhang wrote:
> This patch carries out minor refactoring on aarch64_add_offset; it
> replaces 'DImode' and 'Pmode' with 'mode'.
>
> OK for the trunk?

OK
/Marcus

Patch

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 527b00d..81c6fd9 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -804,7 +804,7 @@  aarch64_force_temporary (rtx x, rtx value)
 static rtx
 aarch64_add_offset (enum machine_mode mode, rtx temp, rtx reg, HOST_WIDE_INT offset)
 {
-  if (!aarch64_plus_immediate (GEN_INT (offset), DImode))
+  if (!aarch64_plus_immediate (GEN_INT (offset), mode))
     {
       rtx high;
       /* Load the full offset into a register.  This
@@ -812,7 +812,7 @@  aarch64_add_offset (enum machine_mode mode, rtx temp, rtx reg, HOST_WIDE_INT off
       high = GEN_INT (offset);
       offset = 0;
       high = aarch64_force_temporary (temp, high);
-      reg = aarch64_force_temporary (temp, gen_rtx_PLUS (Pmode, high, reg));
+      reg = aarch64_force_temporary (temp, gen_rtx_PLUS (mode, high, reg));
     }
   return plus_constant (mode, reg, offset);
 }