public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [PATCH, alpha]: Use CEIL macro
Date: Tue, 20 Oct 2015 15:42:00 -0000	[thread overview]
Message-ID: <CAFULd4YPyW0kTzpkgqCmOA+OpOhea22=65t6kh=qDbd70RnPDg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 465 bytes --]

... plus some cleanups due to unused macro argument.

No functional changes.

2015-10-20  Uros Bizjak  <ubizjak@gmail.com>

    * config/alpha/alpha.h (HARD_REGNO_NREGS): Use CEIL macro.
    (ALPHA_ARG_SIZE): Ditto.  Remove unused NAMED argument.
    * config/alpha/alpha.c (alpha_function_arg_advance): Update
    ALPHA_ARG_SIZE usage.
    (alpha_arg_partial_bytes): Ditto.

Bootstrapped and regression tested on alpha-linux-gnu, committed to
mainline SVN.

Uros.

[-- Attachment #2: a.diff.txt --]
[-- Type: text/plain, Size: 2536 bytes --]

Index: config/alpha/alpha.c
===================================================================
--- config/alpha/alpha.c	(revision 229082)
+++ config/alpha/alpha.c	(working copy)
@@ -5613,7 +5613,7 @@ alpha_function_arg_advance (cumulative_args_t cum_
 {
   CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
   bool onstack = targetm.calls.must_pass_in_stack (mode, type);
-  int increment = onstack ? 6 : ALPHA_ARG_SIZE (mode, type, named);
+  int increment = onstack ? 6 : ALPHA_ARG_SIZE (mode, type);
 
 #if TARGET_ABI_OSF
   *cum += increment;
@@ -5635,10 +5635,10 @@ alpha_arg_partial_bytes (cumulative_args_t cum_v,
 
 #if TARGET_ABI_OPEN_VMS
   if (cum->num_args < 6
-      && 6 < cum->num_args + ALPHA_ARG_SIZE (mode, type, named))
+      && 6 < cum->num_args + ALPHA_ARG_SIZE (mode, type))
     words = 6 - cum->num_args;
 #elif TARGET_ABI_OSF
-  if (*cum < 6 && 6 < *cum + ALPHA_ARG_SIZE (mode, type, named))
+  if (*cum < 6 && 6 < *cum + ALPHA_ARG_SIZE (mode, type))
     words = 6 - *cum;
 #else
 #error Unhandled ABI
Index: config/alpha/alpha.h
===================================================================
--- config/alpha/alpha.h	(revision 229082)
+++ config/alpha/alpha.h	(working copy)
@@ -383,7 +383,7 @@ extern enum alpha_fp_trap_mode alpha_fptm;
    but can be less for certain modes in special long registers.  */
 
 #define HARD_REGNO_NREGS(REGNO, MODE)   \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
+  CEIL (GET_MODE_SIZE (MODE), UNITS_PER_WORD)
 
 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
    On Alpha, the integer registers can hold any mode.  The floating-point
@@ -674,13 +674,15 @@ extern int alpha_memory_latency;
 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
   (CUM) = 0
 
-/* Define intermediate macro to compute the size (in registers) of an argument
-   for the Alpha.  */
+/* Define intermediate macro to compute
+   the size (in registers) of an argument.  */
 
-#define ALPHA_ARG_SIZE(MODE, TYPE, NAMED)				\
+#define ALPHA_ARG_SIZE(MODE, TYPE)					\
   ((MODE) == TFmode || (MODE) == TCmode ? 1				\
-   : (((MODE) == BLKmode ? int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE)) \
-      + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)
+   : CEIL (((MODE) == BLKmode						\
+	    ? int_size_in_bytes (TYPE)					\
+	    : GET_MODE_SIZE (MODE)),					\
+	   UNITS_PER_WORD))
 
 /* Make (or fake) .linkage entry for function call.
    IS_LOCAL is 0 if name is used in call, 1 if name is used in definition.  */

                 reply	other threads:[~2015-10-20 15:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFULd4YPyW0kTzpkgqCmOA+OpOhea22=65t6kh=qDbd70RnPDg@mail.gmail.com' \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).