Sean McGovern <[email protected]> writes:

> On Sun, Jul 3, 2011 at 12:52 PM, Ronald S. Bultje <[email protected]> wrote:
>> Hi,
>>
>> 2011/7/3 Måns Rullgård <[email protected]>:
>>> Daniel Kang <[email protected]> writes:
>>>
>>>> 2011/7/3 Måns Rullgård <[email protected]>
>>>>
>>>>> "Ronald S. Bultje" <[email protected]> writes:
>>>>>
>>>>> > Hi,
>>>>> >
>>>>> > 2011/7/3 Måns Rullgård <[email protected]>:
>>>>> >> The AES and DES functions currently require, but do not document it,
>>>>> >> 8-byte alignment for input and output buffers.  This is causing the AES
>>>>> >> test to fail on SPARC.
>>>>> >>
>>>>> >> What shall we do about this?  I can see two options:
>>>>> >>
>>>>> >> 1. Document the requirement and fix all internal uses to ensure it is
>>>>> >>   met (none currently do).
>>>>> >>
>>>>> >> 2. Change the crypto code to allow arbitrarily aligned buffers (easy).
>>>>> >
>>>>> > I prefer 1, but don't strongly object to 2.
>>>>>
>>>>> The performance impact of allowing unaligned buffers should be minimal,
>>>>> so I don't see much reason to place this extra burden on users.
>>>>
>>>> How minimal? Either way is fine with me though.
>>>
>>> I didn't measure it, but most of the time is spent in the actual
>>> algorithm, not in loading and storing data.
>>
>> Since realigning means copying in some cases (e.g. where data comes
>> from a bytestream), unaligned is fine.
>
> I hate to be a killjoy, but isn't this likely to fail on targets like
> PA-RISc and it's cousin IA64? On these platforms, unaligned accesses
> aren't just performance issues -- they're plain *wrong*.

There's always *some* way of reading unaligned data, if nothing else by
doing a byte at a time.  That's what we have intreadwrite.h for.

> Looking at FATE for those targets I notice for PA-RISC it's failing in
> aes -- not sure if it's the same SIGBUS.

Those are probably caused by the big endian bug that was fixed today.
In fact, most of them are back to green now.

> Not sure why that isn't failing for the IA64 FATE runs -- maybe the
> unaligned accesses are being fixed up in software?

I think only one Sparc config was hit by the alignment problem due to
different random choices by the compilers.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to