From: Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com>
To: <gcc-patches@gcc.gnu.org>
Cc: <Claudiu.Zissulescu@synopsys.com>, <gnu@amylaar.uk>,
<Francois.Bedard@synopsys.com>, <jeremy.bennett@embecosm.com>
Subject: [PATCH 2/6] [ARC] Fix FPX/FPUDA code gen when compiling for big-endian.
Date: Mon, 18 Apr 2016 14:35:00 -0000 [thread overview]
Message-ID: <1460990028-5718-3-git-send-email-claziss@synopsys.com> (raw)
In-Reply-To: <1460990028-5718-1-git-send-email-claziss@synopsys.com>
OK to apply?
Claudiu
gcc/
2016-04-18 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.c (arc_process_double_reg_moves): Fix for
big-endian compilation.
* config/arc/arc.md (addf3): Likewise.
(subdf3): Likewise.
(muldf3): Likewise.
---
gcc/config/arc/arc.c | 12 ++++++++----
gcc/config/arc/arc.md | 18 +++++++++---------
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index d60db50..f4bef3e 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -8647,8 +8647,10 @@ arc_process_double_reg_moves (rtx *operands)
{
/* When we have 'mov D, r' or 'mov D, D' then get the target
register pair for use with LR insn. */
- rtx destHigh = simplify_gen_subreg(SImode, dest, DFmode, 4);
- rtx destLow = simplify_gen_subreg(SImode, dest, DFmode, 0);
+ rtx destHigh = simplify_gen_subreg (SImode, dest, DFmode,
+ TARGET_BIG_ENDIAN ? 0 : 4);
+ rtx destLow = simplify_gen_subreg (SImode, dest, DFmode,
+ TARGET_BIG_ENDIAN ? 4 : 0);
/* Produce the two LR insns to get the high and low parts. */
emit_insn (gen_rtx_SET (destHigh,
@@ -8665,8 +8667,10 @@ arc_process_double_reg_moves (rtx *operands)
{
/* When we have 'mov r, D' or 'mov D, D' and we have access to the
LR insn get the target register pair. */
- rtx srcHigh = simplify_gen_subreg(SImode, src, DFmode, 4);
- rtx srcLow = simplify_gen_subreg(SImode, src, DFmode, 0);
+ rtx srcHigh = simplify_gen_subreg (SImode, src, DFmode,
+ TARGET_BIG_ENDIAN ? 0 : 4);
+ rtx srcLow = simplify_gen_subreg (SImode, src, DFmode,
+ TARGET_BIG_ENDIAN ? 4 : 0);
emit_insn (gen_rtx_UNSPEC_VOLATILE (Pmode,
gen_rtvec (3, dest, srcHigh, srcLow),
diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md
index 9766547..74530b1 100644
--- a/gcc/config/arc/arc.md
+++ b/gcc/config/arc/arc.md
@@ -5681,9 +5681,9 @@
{
if (GET_CODE (operands[2]) == CONST_DOUBLE)
{
- rtx high, low, tmp;
- split_double (operands[2], &low, &high);
- tmp = force_reg (SImode, high);
+ rtx first, second, tmp;
+ split_double (operands[2], &first, &second);
+ tmp = force_reg (SImode, TARGET_BIG_ENDIAN ? first : second);
emit_insn (gen_adddf3_insn (operands[0], operands[1],
operands[2], tmp, const0_rtx));
}
@@ -5718,10 +5718,10 @@
if ((GET_CODE (operands[1]) == CONST_DOUBLE)
|| GET_CODE (operands[2]) == CONST_DOUBLE)
{
- rtx high, low, tmp;
+ rtx first, second, tmp;
int const_index = ((GET_CODE (operands[1]) == CONST_DOUBLE) ? 1 : 2);
- split_double (operands[const_index], &low, &high);
- tmp = force_reg (SImode, high);
+ split_double (operands[const_index], &first, &second);
+ tmp = force_reg (SImode, TARGET_BIG_ENDIAN ? first : second);
emit_insn (gen_subdf3_insn (operands[0], operands[1],
operands[2], tmp, const0_rtx));
}
@@ -5753,9 +5753,9 @@
{
if (GET_CODE (operands[2]) == CONST_DOUBLE)
{
- rtx high, low, tmp;
- split_double (operands[2], &low, &high);
- tmp = force_reg (SImode, high);
+ rtx first, second, tmp;
+ split_double (operands[2], &first, &second);
+ tmp = force_reg (SImode, TARGET_BIG_ENDIAN ? first : second);
emit_insn (gen_muldf3_insn (operands[0], operands[1],
operands[2], tmp, const0_rtx));
}
--
1.9.1
next prev parent reply other threads:[~2016-04-18 14:35 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-18 14:35 [PATCH 0/6] [ARC] Various fixes Claudiu Zissulescu
2016-04-18 14:35 ` [PATCH 4/6] [ARC] Handle FPX NaN within optimized floating point library Claudiu Zissulescu
2016-04-28 11:27 ` Joern Wolfgang Rennecke
2016-04-28 11:35 ` Claudiu Zissulescu
2016-04-28 11:41 ` Joern Wolfgang Rennecke
2016-04-28 11:43 ` Claudiu Zissulescu
2016-04-28 14:12 ` Claudiu Zissulescu
2016-04-28 15:03 ` Joern Wolfgang Rennecke
2016-04-29 10:18 ` [PATCH] " Claudiu Zissulescu
2016-04-29 10:23 ` Joern Wolfgang Rennecke
2016-04-29 10:27 ` Joern Wolfgang Rennecke
2016-04-29 10:31 ` Claudiu Zissulescu
2016-04-29 10:37 ` Joern Wolfgang Rennecke
2016-04-29 10:47 ` Claudiu Zissulescu
2016-04-18 14:35 ` [PATCH 6/6] [ARC] Various instruction pattern fixes Claudiu Zissulescu
2016-04-18 18:26 ` Claudiu Zissulescu
2016-04-28 12:31 ` Joern Wolfgang Rennecke
2016-05-02 11:21 ` Claudiu Zissulescu
2016-04-18 14:35 ` Claudiu Zissulescu [this message]
2016-04-28 10:29 ` [PATCH 2/6] [ARC] Fix FPX/FPUDA code gen when compiling for big-endian Joern Wolfgang Rennecke
2016-04-28 12:54 ` Claudiu Zissulescu
2016-04-18 14:35 ` [PATCH 3/6] [ARC] Pass mfpuda to assembler Claudiu Zissulescu
2016-04-28 10:30 ` Joern Wolfgang Rennecke
2016-04-28 13:10 ` Claudiu Zissulescu
2016-04-18 14:35 ` [PATCH 1/6] [ARC] Don't use drsub* instructions when selecting fpuda Claudiu Zissulescu
2016-04-28 10:05 ` Joern Wolfgang Rennecke
2016-04-28 12:16 ` Claudiu Zissulescu
2016-04-18 14:35 ` [PATCH 5/6] [ARC] Fix unwanted match for sign extend 16-bit constant Claudiu Zissulescu
2016-04-28 11:47 ` Joern Wolfgang Rennecke
2016-04-28 17:12 ` [PATCH] " Claudiu Zissulescu
2016-04-28 17:46 ` Joern Wolfgang Rennecke
2016-04-28 20:31 ` Claudiu Zissulescu
2016-04-28 20:57 ` Joern Wolfgang Rennecke
2016-04-29 8:41 ` Claudiu Zissulescu
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=1460990028-5718-3-git-send-email-claziss@synopsys.com \
--to=claudiu.zissulescu@synopsys.com \
--cc=Francois.Bedard@synopsys.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gnu@amylaar.uk \
--cc=jeremy.bennett@embecosm.com \
/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).