This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][AArch64][obvious] In aarch64_class_max_nregs use UNITS_PER_VREG and UNITS_PER_WORD


Hi all,

This patch replaces 15, 16, 7 and 8 in aarch64_class_max_nregs with the macro that they represent.
This should make the logic of that function easier to understand.

Bootstrapped and tested on aarch64.
Applying as obvious.

2015-05-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

    * config/aarch64/aarch64.c (aarch64_class_max_nregs):
    Use UNITS_PER_VREG and UNITS_PER_WORD instead of their direct
    values.
commit 8abd208611b50e8f477b6efb8d8604b3390a9072
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date:   Mon May 18 12:01:24 2015 +0100

    [AArch64] In aarch64_class_max_nregs use UNITS_PER_VREG and UNITS_PER_WORD

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index c939a4a..5f23359 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -4923,8 +4923,9 @@ aarch64_class_max_nregs (reg_class_t regclass, machine_mode mode)
     case FP_REGS:
     case FP_LO_REGS:
       return
-	aarch64_vector_mode_p (mode) ? (GET_MODE_SIZE (mode) + 15) / 16 :
-				       (GET_MODE_SIZE (mode) + 7) / 8;
+	aarch64_vector_mode_p (mode)
+	  ? (GET_MODE_SIZE (mode) + UNITS_PER_VREG - 1) / UNITS_PER_VREG
+	  : (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
     case STACK_REG:
       return 1;
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]