public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem with memory alignment for 64 byte moves
@ 2010-12-03 18:41 Neil Hickey
  2010-12-03 19:34 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Neil Hickey @ 2010-12-03 18:41 UTC (permalink / raw)
  To: gcc

Hello everyone.

I'm porting gcc to a new architecture and I'm allowing use of movdi
instructions as the processor allows 8 byte loads. The processor
however requires 8 byte loads and stores to be naturally aligned, yet
gcc seems to be emitting loads and stores that are 4 byte aligned. How
can I make sure that gcc will only emit 8 byte loads and stores if it
knows the address, which can be in a register, is 8 byte aligned?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with memory alignment for 64 byte moves
  2010-12-03 18:41 Problem with memory alignment for 64 byte moves Neil Hickey
@ 2010-12-03 19:34 ` Ian Lance Taylor
  2010-12-16 14:54   ` Neil Hickey
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor @ 2010-12-03 19:34 UTC (permalink / raw)
  To: Neil Hickey; +Cc: gcc

Neil Hickey <neil@petapath.com> writes:

> I'm porting gcc to a new architecture and I'm allowing use of movdi
> instructions as the processor allows 8 byte loads. The processor
> however requires 8 byte loads and stores to be naturally aligned, yet
> gcc seems to be emitting loads and stores that are 4 byte aligned. How
> can I make sure that gcc will only emit 8 byte loads and stores if it
> knows the address, which can be in a register, is 8 byte aligned?

Define STRICT_ALIGNMENT to 1.

Make sure that BIGGEST_ALIGNMENT, BIGGEST_FIELD_ALIGNMENT,
MAX_STACK_ALIGNMENT, DATA_ALIGNMENT, etc. are correct.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with memory alignment for 64 byte moves
  2010-12-03 19:34 ` Ian Lance Taylor
@ 2010-12-16 14:54   ` Neil Hickey
  0 siblings, 0 replies; 3+ messages in thread
From: Neil Hickey @ 2010-12-16 14:54 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc

Hi Ian

Thanks for the response.

All of those flags are set correctly, though it is still emitting
loads and stores 4 byte aligned and not 8. I'm trying to get the
compiler to combine two 4 byte loads in to a single 8 byte load as it
is more efficient on this architecture, so I'm guessing because the
objects being loaded are actually 4 byte aligned, the compiler is
matching for this alignment.

There was a similar email about combining loads/stores which people
seemed to suggest wasn't possible. Is there any way to do this other
than writing a machine reorg pass which will split up loads and stores
it notices are misaligned?

On 3 December 2010 19:34, Ian Lance Taylor <iant@google.com> wrote:
> Neil Hickey <neil@petapath.com> writes:
>
>> I'm porting gcc to a new architecture and I'm allowing use of movdi
>> instructions as the processor allows 8 byte loads. The processor
>> however requires 8 byte loads and stores to be naturally aligned, yet
>> gcc seems to be emitting loads and stores that are 4 byte aligned. How
>> can I make sure that gcc will only emit 8 byte loads and stores if it
>> knows the address, which can be in a register, is 8 byte aligned?
>
> Define STRICT_ALIGNMENT to 1.
>
> Make sure that BIGGEST_ALIGNMENT, BIGGEST_FIELD_ALIGNMENT,
> MAX_STACK_ALIGNMENT, DATA_ALIGNMENT, etc. are correct.
>
> Ian
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-16 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-03 18:41 Problem with memory alignment for 64 byte moves Neil Hickey
2010-12-03 19:34 ` Ian Lance Taylor
2010-12-16 14:54   ` Neil Hickey

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).