public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: gcc-patches@gcc.gnu.org
Cc: dje.gcc@gmail.com, Segher Boessenkool <segher@kernel.crashing.org>
Subject: [PATCH 4/5] rs6000: Introducing rs6000_abi_word_mode
Date: Thu, 15 Jan 2015 04:36:00 -0000	[thread overview]
Message-ID: <ce28d6c4e31d83020e1428aeedb7c5215e58107d.1421282067.git.segher@kernel.crashing.org> (raw)
In-Reply-To: <a0366c6b956020e6762b6b78a73b20aba5ec1408.1421282067.git.segher@kernel.crashing.org>
In-Reply-To: <a0366c6b956020e6762b6b78a73b20aba5ec1408.1421282067.git.segher@kernel.crashing.org>

Some hooks return word_mode by default, which is incorrect for -m32
-mpowerpc64.  This patch creates a new function rs6000_abi_word_mode
to implement these hooks, and does so.

This fixes 163 testuite FAILs.

[ David already OKed this fixed version, but sending it again is easier
  for me.  Lazy, etc. ]


2015-01-14  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/
	* config/rs6000/rs6000.c (TARGET_LIBGCC_CMP_RETURN_MODE,
	TARGET_LIBGCC_SHIFT_COUNT_MODE, TARGET_UNWIND_WORD_MODE): Implement
	as ...
	(rs6000_abi_word_mode): New function.

---
 gcc/config/rs6000/rs6000.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index afced72..6c91f3c 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -1669,6 +1669,13 @@ static const struct attribute_spec rs6000_attribute_table[] =
 
 #undef TARGET_ATOMIC_ASSIGN_EXPAND_FENV
 #define TARGET_ATOMIC_ASSIGN_EXPAND_FENV rs6000_atomic_assign_expand_fenv
+
+#undef TARGET_LIBGCC_CMP_RETURN_MODE
+#define TARGET_LIBGCC_CMP_RETURN_MODE rs6000_abi_word_mode
+#undef TARGET_LIBGCC_SHIFT_COUNT_MODE
+#define TARGET_LIBGCC_SHIFT_COUNT_MODE rs6000_abi_word_mode
+#undef TARGET_UNWIND_WORD_MODE
+#define TARGET_UNWIND_WORD_MODE rs6000_abi_word_mode
 \f
 
 /* Processor table.  */
@@ -9299,6 +9306,15 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
     }
 }
 \f
+/* The mode the ABI uses for a word.  This is not the same as word_mode
+   for -m32 -mpowerpc64.  This is used to implement various target hooks.  */
+
+static machine_mode
+rs6000_abi_word_mode (void)
+{
+  return TARGET_32BIT ? SImode : DImode;
+}
+
 /* On rs6000, function arguments are promoted, as are function return
    values.  */
 
-- 
1.8.1.4

  parent reply	other threads:[~2015-01-15  1:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15  1:19 [PATCH 1/5] rs6000: Fix PROMOTE_MODE for -m32 -mpowerpc64 Segher Boessenkool
2015-01-15  1:47 ` [PATCH 3/5] rs6000: Fix va_start handling for -m32 -mpowerpc64 ABI_V4 Segher Boessenkool
2015-01-15  4:53   ` David Edelsohn
2015-01-15  3:51 ` [PATCH 2/5] rs6000: Fix TARGET_PROMOTE_FUNCTION_MODE Segher Boessenkool
2015-01-15  4:43   ` David Edelsohn
2015-01-15  4:36 ` Segher Boessenkool [this message]
2015-01-15  5:00   ` [PATCH 4/5] rs6000: Introducing rs6000_abi_word_mode David Edelsohn
2015-01-15  4:37 ` [PATCH 5/5] rs6000: Do not allow TImode with -m32 -mpowerpc64 Segher Boessenkool
2015-01-15 16:18   ` David Edelsohn
2015-01-16 16:58     ` Segher Boessenkool
2015-01-15  4:39 ` [PATCH 1/5] rs6000: Fix PROMOTE_MODE for " David Edelsohn

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=ce28d6c4e31d83020e1428aeedb7c5215e58107d.1421282067.git.segher@kernel.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@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).