From: Richard Henderson <rth@redhat.com>
To: Mohamed Shafi <shafitvm@gmail.com>
Cc: GCC <gcc@gcc.gnu.org>
Subject: Re: How to split 40bit data types load/store?
Date: Mon, 14 Sep 2009 14:59:00 -0000 [thread overview]
Message-ID: <4AAE5A2D.6090605@redhat.com> (raw)
In-Reply-To: <ba0bd44d0909140724w66e5fb8cy891c51a145c9cfeb@mail.gmail.com>
On 09/14/2009 07:24 AM, Mohamed Shafi wrote:
> Hello all,
>
> I am doing a port for a 32bit target in GCC 4.4.0. I have to support a
> 40bit data (_Accum) in the port. The target has 40bit registers which
> is a GPR and works as 32bit reg in other modes. The load and store for
> _Accum happens in two step. The lower 32bit in one instruction and the
> upper 8bit in the next instruction. I want to split the instruction
> after reload. I tired to have a pattern (for load) like this:
>
> (define_insn "fn_load_ext_sa"
> [(set (unspec:SA [(match_operand:DA 0 "register_operand" "")]
> UNSPEC_FN_EXT)
> (match_operand:SA 1 "memory_operand" ""))]
>
> (define_insn "fn_load_sa"
> [(set (unspec:SA [(match_operand:DA 0 "register_operand" "")]
> UNSPEC_FN)
> (match_operand:SA 1 "memory_operand" ""))]
Unspec on the left-hand-side isn't something that's supposed to happen,
and is more than likely the cause of your problems. Try moving the
unspec to the right-hand-side like:
(set (reg:SI reg) (mem:SI addr))
(set (reg:SA reg)
(unspec:SA [(reg:SI reg) (mem:QI addr)]
UNSPEC_ACCUM_INSERT))
and
(set (mem:SI addr) (reg:SI reg))
(set (mem:QI addr)
(unspec:QI [(reg:SA reg)]
UNSPEC_ACCUM_EXTRACT))
Note that after reload it's perfectly acceptable for a hard register to
appear with the different SI and SAmodes.
It's probably not too hard to define this with zero_extract sequences
instead of unspecs, but given that these only appear after reload, it
may not be worth the effort.
r~
next prev parent reply other threads:[~2009-09-14 14:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-14 14:24 Mohamed Shafi
2009-09-14 14:59 ` Richard Henderson [this message]
2009-10-05 14:03 ` Mohamed Shafi
2009-10-06 3:10 ` Richard Henderson
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=4AAE5A2D.6090605@redhat.com \
--to=rth@redhat.com \
--cc=gcc@gcc.gnu.org \
--cc=shafitvm@gmail.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).