On 13 June 2016 at 23:38, Richard Henderson <r...@twiddle.net> wrote:
> On 06/13/2016 03:28 PM, Peter Maydell wrote:
>> glibc's syscall() takes the system parameter as an int and
>> does a sign-extending move into x0 with an uxtw.
>> safe_syscall() takes a long, so it's already 64 bits.
>
>
> Well, uxtw is a zero-extending move.  So...

Yeah 'sign-extending' was a thinko. But the point is
that for syscall() the input is 32 bits and the
value it feeds to the kernel is 64 bits, hence the
extension. For safe_syscall() the input is 64 bits
and the value fed to the kernel is also 64 bits,
so the most 'natural' thing is just to move a
64 bit value (saves the reader looking up whether
mov wX, wY clears the high half or not, if nothing else).

thanks
-- PMM

Reply via email to