]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sh.h (GET_SH_ARG_CLASS): Convert macro into ...
authorOleg Endo <olegendo@gcc.gnu.org>
Sun, 8 May 2016 14:15:24 +0000 (14:15 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Sun, 8 May 2016 14:15:24 +0000 (14:15 +0000)
gcc/
* config/sh/sh.h (GET_SH_ARG_CLASS): Convert macro into ...
* config/sh/sh.c (get_sh_arg_class): ... this new function.  Update its
users.

From-SVN: r236009

gcc/ChangeLog
gcc/config/sh/sh.c
gcc/config/sh/sh.h

index 62fe152b31ca2a1c589a4e13e339eba9c2803c28..26437399346d2462492508a9078dc9931042a6ac 100644 (file)
@@ -1,3 +1,9 @@
+2016-05-08  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       * config/sh/sh.h (GET_SH_ARG_CLASS): Convert macro into ...
+       * config/sh/sh.c (get_sh_arg_class): ... this new function.  Update its
+       users.
+
 2016-05-08  Oleg Endo  <olegendo@gcc.gnu.org>
 
        * config/sh/sh-protos.h (sh_media_register_for_return): Remove.
index 51f983c05075ec386ad6f558c372f888e3ff42b7..a36b098cf409df4ab7d7a3451c3e4a81628f25e2 100644 (file)
@@ -7898,6 +7898,20 @@ sh_callee_copies (cumulative_args_t cum, machine_mode mode,
              % SH_MIN_ALIGN_FOR_CALLEE_COPY == 0));
 }
 
+static sh_arg_class
+get_sh_arg_class (machine_mode mode)
+{
+  if (TARGET_FPU_ANY && mode == SFmode)
+    return SH_ARG_FLOAT;
+
+  if (TARGET_FPU_DOUBLE
+      && (GET_MODE_CLASS (mode) == MODE_FLOAT
+         || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT))
+    return SH_ARG_FLOAT;
+
+  return SH_ARG_INT;
+}
+
 /* Round a register number up to a proper boundary for an arg of mode
    MODE.
    The SH doesn't care about double alignment, so we only
@@ -7913,9 +7927,9 @@ sh_round_reg (const CUMULATIVE_ARGS& cum, machine_mode mode)
          && (mode == DFmode || mode == DCmode)
          && cum.arg_count[(int) SH_ARG_FLOAT] < NPARM_REGS (mode)))
      && GET_MODE_UNIT_SIZE (mode) > UNITS_PER_WORD)
-    ? (cum.arg_count[(int) GET_SH_ARG_CLASS (mode)]
-       + (cum.arg_count[(int) GET_SH_ARG_CLASS (mode)] & 1))
-    : cum.arg_count[(int) GET_SH_ARG_CLASS (mode)]);
+    ? (cum.arg_count[(int) get_sh_arg_class (mode)]
+       + (cum.arg_count[(int) get_sh_arg_class (mode)] & 1))
+    : cum.arg_count[(int) get_sh_arg_class (mode)]);
 }
 
 /* Return true if arg of the specified mode should be passed in a register
@@ -8067,7 +8081,7 @@ sh_function_arg_advance (cumulative_args_t ca_v, machine_mode mode,
 
   if (! ((TARGET_SH4 || TARGET_SH2A) || ca->renesas_abi)
       || sh_pass_in_reg_p (*ca, mode, type))
-    (ca->arg_count[(int) GET_SH_ARG_CLASS (mode)]
+    (ca->arg_count[(int) get_sh_arg_class (mode)]
      = (sh_round_reg (*ca, mode)
        + (mode == BLKmode
           ? CEIL (int_size_in_bytes (type), UNITS_PER_WORD)
index 34dd1359102a00b305aac70bb3697f128347b92d..f725535497081188b181cf77824a7a5a9ba90ddd 100644 (file)
@@ -1198,13 +1198,6 @@ extern bool current_function_interrupt;
 
 #endif // __cplusplus
 
-#define GET_SH_ARG_CLASS(MODE) \
-  ((TARGET_FPU_ANY && (MODE) == SFmode) \
-   ? SH_ARG_FLOAT \
-   : TARGET_FPU_DOUBLE && (GET_MODE_CLASS (MODE) == MODE_FLOAT \
-                          || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \
-     ? SH_ARG_FLOAT : SH_ARG_INT)
-
 /* Initialize a variable CUM of type CUMULATIVE_ARGS
    for a call to a function whose data type is FNTYPE.
    For a library call, FNTYPE is 0.