This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] powerpc: Use aligned stores in memset


On Tue, Sep 12, 2017 at 10:37 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Tue, 12 Sep 2017, Zack Weinberg wrote:
>>
>> mem* are required to behave as-if they access memory as an array of
>> unsigned char.  Therefore it is valid to give them arbitrarily
>> (un)aligned pointers.  The C abstract machine doesn't specifically
>> contemplate the possibility of a CPU that can do unaligned word reads
>> but maybe not to all memory addresses, but I would argue that if there
>> is such a CPU, then mem* are obliged to cope with it.
>
> Only if there is a way, within the standard, in which you might obtain a
> pointer to such memory.

Perhaps it is only a matter of QoI, but I would argue that if there is
_any_ way to obtain such a pointer, considering the entire operating
system, then mem* can and should cope with it.

> I think device memory with
> special access requirements should be considered to be defined as
> volatile.  (So any access from C code should use volatile-qualified
> lvalues.)

I know you know that's violently disputed.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]