[PATCH] ppc64: fix semtimedop compat syscall

David S. Miller davem at davemloft.net
Mon Apr 25 12:45:22 EST 2005


On Wed, 23 Mar 2005 07:19:31 +1100
Paul Mackerras <paulus at samba.org> wrote:

> Arnd Bergmann writes:
> 
> > One problem is that sign extension can not be expressed in architecture
> > independent C code.
> 
> On which architectures does (long)(int) x not give the desired result?

It all depends upon what the processor ABI says about incoming arguments,
specifically whether the caller is expected to sign extend them or not.

If the caller is expected to sign extend, then "(long) (int) x" will get
optimized away by the compiler.



More information about the Linuxppc64-dev mailing list