Port-powerpc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: powerpc gcc alignment problem



> So, if unaligned accesses are in fact slower than aligned ones, why
> is doing strict alignment a performance penalty?

Because they might not be _much_ slower. If it takes you three
instructions to emulate an unaligned load (load first half into
register 1, load second half into register 2, merge and shift
registers 1 and 2 into register 3), and only two to do the unaligned
load itself, you're better off generating the unaligned access.

-- Dan



Home | Main Index | Thread Index | Old Index