This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to handle SCmode.
- From: Ian Lance Taylor <iant at google dot com>
- To: sumanth <sumanth dot gundapneni at redpinesignals dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 07 Jul 2009 07:30:15 -0700
- Subject: Re: How to handle SCmode.
- References: <4A535128.40906@redpinesignals.com>
sumanth <sumanth.gundapneni@redpinesignals.com> writes:
> int hard_regno_mode_ok (reg, mode)
> enum machine_mode mode;
> int reg;
> {
> int width = GET_MODE_SIZE(mode) * BITS_PER_UNIT;
> if (width == 32 || width == 16 || width == 8)
> {
> return 1;
> }
> return 0;
> }
This is too restrictive. gcc wants to be able to store larger values in
registers--in the case of SCmode, a 64-bit value. gcc will handle this
as a pair of consecutive registers, but you need to tell it that that is
OK. Typically you would say that a 64-bit value may be stored in any
even register number, or in any register.
Ian