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][s390] Replace lll_futex_* assembly code withINTERNAL_SYSCALL


On Thu, Dec 20, 2012 at 02:19:53PM -0500, Carlos O'Donell wrote:
> >-    __result > -4096UL;							      \
> >+    __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp),		      \
> >+			      __lll_private_flag (FUTEX_CMP_REQUEUE, private),\
> >+			      (nr_wake), (nr_move), (mutex), (val));	      \
> >+    INTERNAL_SYSCALL_ERROR_P (__ret, __err);				      \
> 
> OK.
> 
> What generates better code?
> 
> __result > -4096UL; or ((unsigned long) (val) >= -4095UL)?
> 
> Is the compiler smart enough to generate the same code?
> 

For S-390, it is the same C code:

#define INTERNAL_SYSCALL_ERROR_P(val, err)                                    \
  ((unsigned int) (val) >= 0xfffff001u)

so the compiler should generate the same code.

Siddhesh


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