diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2012-03-17 09:22:29 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2012-05-27 07:30:57 -0700 |
commit | d6b7701af03a7251eae41d1a8120a57d9bc8ad5c (patch) | |
tree | 84e192937361e0b5780985530123add9bd1cb3f7 | |
parent | 9e6e3d4262f22c1e174860cbf51c3880a1523c9f (diff) | |
download | glibc-d6b7701af03a7251eae41d1a8120a57d9bc8ad5c.tar.gz glibc-d6b7701af03a7251eae41d1a8120a57d9bc8ad5c.tar.xz glibc-d6b7701af03a7251eae41d1a8120a57d9bc8ad5c.zip |
Replace MOVE_LP/ADD_LP/SUB_LP/CMP_LP with LP_OP
2012-03-17 H.J. Lu <hongjiu.lu@intel.com> * sysdeps/x86_64/sysdep.h (MOVE_LP): Removed. (ADD_LP): Likewise. (SUB_LP): Likewise. (CMP_LP): Likewise. (LP_OP): New. * sysdeps/x86_64/x32/sysdep.h (MOVE_LP): Removed. (ADD_LP): Likewise. (SUB_LP): Likewise. (CMP_LP): Likewise. (LP_OP): New. nptl/ 2012-03-17 H.J. Lu <hongjiu.lu@intel.com> * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Replace ADD_LP, CMP_LP, MOVE_LP, SUB_LP with LP_OP(add), LP_OP(cmp), LP_OP(mov), LP_OP(sub). * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
-rw-r--r-- | ChangeLog.x32 | 14 | ||||
-rw-r--r-- | nptl/ChangeLog.x32 | 13 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S | 2 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S | 10 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S | 6 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S | 32 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S | 28 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S | 2 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S | 12 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S | 6 | ||||
-rw-r--r-- | sysdeps/x86_64/sysdep.h | 16 | ||||
-rw-r--r-- | sysdeps/x86_64/x32/sysdep.h | 17 |
12 files changed, 86 insertions, 72 deletions
diff --git a/ChangeLog.x32 b/ChangeLog.x32 index 6e769ced89..88e6cd921b 100644 --- a/ChangeLog.x32 +++ b/ChangeLog.x32 @@ -1,3 +1,17 @@ +2012-03-17 H.J. Lu <hongjiu.lu@intel.com> + + * sysdeps/x86_64/sysdep.h (MOVE_LP): Removed. + (ADD_LP): Likewise. + (SUB_LP): Likewise. + (CMP_LP): Likewise. + (LP_OP): New. + + * sysdeps/x86_64/x32/sysdep.h (MOVE_LP): Removed. + (ADD_LP): Likewise. + (SUB_LP): Likewise. + (CMP_LP): Likewise. + (LP_OP): New. + 2012-03-16 H.J. Lu <hongjiu.lu@intel.com> * sysdeps/unix/sysv/linux/x86_64/sysdep.h (PTR_MANGLE): Use diff --git a/nptl/ChangeLog.x32 b/nptl/ChangeLog.x32 index 15cb69e71a..19a15a0f88 100644 --- a/nptl/ChangeLog.x32 +++ b/nptl/ChangeLog.x32 @@ -1,3 +1,16 @@ +2012-03-17 H.J. Lu <hongjiu.lu@intel.com> + + * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Replace ADD_LP, + CMP_LP, MOVE_LP, SUB_LP with LP_OP(add), LP_OP(cmp), LP_OP(mov), + LP_OP(sub). + * sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise. + 2012-03-14 H.J. Lu <hongjiu.lu@intel.com> * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Use CMP_LP diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S b/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S index fe33f6968d..a0dce33d07 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S @@ -73,7 +73,7 @@ ENTRY(__pthread_enable_asynccancel) 3: subq $8, %rsp cfi_adjust_cfa_offset(8) - MOVE_LP $TCB_PTHREAD_CANCELED, %fs:RESULT + LP_OP(mov) $TCB_PTHREAD_CANCELED, %fs:RESULT lock orl $TCB_EXITING_BITMASK, %fs:CANCELHANDLING mov %fs:CLEANUP_JMP_BUF, %RDI_LP diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S index 5c89c04d3f..61d450fd84 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S @@ -67,7 +67,7 @@ __pthread_cond_broadcast: decl cond_lock-cond_futex(%rdi) jne 7f -8: CMP_LP $-1, %R8_LP +8: cmp $-1, %R8_LP je 9f /* Do not use requeue for pshared condvars. */ @@ -129,7 +129,7 @@ __pthread_cond_broadcast: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -141,7 +141,7 @@ __pthread_cond_broadcast: /* Unlock in loop requires wakeup. */ 5: addq $cond_lock-cond_futex, %rdi - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -150,7 +150,7 @@ __pthread_cond_broadcast: /* Unlock in loop requires wakeup. */ 7: addq $cond_lock-cond_futex, %rdi - CMP_LP $-1, %R8_LP + cmp $-1, %R8_LP movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -159,7 +159,7 @@ __pthread_cond_broadcast: jmp 8b 9: /* The futex requeue functionality is not available. */ - CMP_LP $-1, %R8_LP + cmp $-1, %R8_LP movl $0x7fffffff, %edx #ifdef __ASSUME_PRIVATE_FUTEX movl $FUTEX_WAKE, %eax diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S index 9f05d28646..c750115ef5 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S @@ -56,7 +56,7 @@ __pthread_cond_signal: addl $1, (%rdi) /* Wake up one thread. */ - CMP_LP $-1, dep_mutex(%r8) + LP_OP(cmp) $-1, dep_mutex(%r8) movl $FUTEX_WAKE_OP, %esi movl $1, %edx movl $SYS_futex, %eax @@ -135,7 +135,7 @@ __pthread_cond_signal: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -151,7 +151,7 @@ __pthread_cond_signal: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S index 048d0cefb4..b50576bf2f 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S @@ -90,7 +90,7 @@ __pthread_cond_timedwait: +--------------------------+ */ - CMP_LP $-1, dep_mutex(%rdi) + LP_OP(cmp) $-1, dep_mutex(%rdi) /* Prepare structure passed to cancellation handler. */ movq %rdi, 8(%rsp) @@ -164,7 +164,7 @@ __pthread_cond_timedwait: movq %r13, %r10 movl $FUTEX_WAIT_BITSET, %esi - CMP_LP $-1, dep_mutex(%rdi) + LP_OP(cmp) $-1, dep_mutex(%rdi) je 60f mov dep_mutex(%rdi), %R8_LP @@ -269,7 +269,7 @@ __pthread_cond_timedwait: jne 55f addq $cond_nwaiters, %rdi - CMP_LP $-1, dep_mutex-cond_nwaiters(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_nwaiters(%rdi) movl $1, %edx #ifdef __ASSUME_PRIVATE_FUTEX movl $FUTEX_WAKE, %eax @@ -332,7 +332,7 @@ __pthread_cond_timedwait: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -344,7 +344,7 @@ __pthread_cond_timedwait: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -356,7 +356,7 @@ __pthread_cond_timedwait: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -371,7 +371,7 @@ __pthread_cond_timedwait: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -392,7 +392,7 @@ __pthread_cond_timedwait: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -509,7 +509,7 @@ __pthread_cond_timedwait: movl %eax, (%rsp) leaq 32(%rsp), %r10 - CMP_LP $-1, dep_mutex(%rdi) + LP_OP(cmp) $-1, dep_mutex(%rdi) movq %r12, %rdx # ifdef __ASSUME_PRIVATE_FUTEX movl $FUTEX_WAIT, %eax @@ -569,7 +569,7 @@ __pthread_cond_timedwait: # if cond_lock != 0 addq $cond_lock, %rdi # endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -581,7 +581,7 @@ __pthread_cond_timedwait: # if cond_lock != 0 addq $cond_lock, %rdi # endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -593,7 +593,7 @@ __pthread_cond_timedwait: # if cond_lock != 0 addq $cond_lock, %rdi # endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -676,7 +676,7 @@ __condvar_cleanup2: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -709,7 +709,7 @@ __condvar_cleanup2: andl $~((1 << nwaiters_shift) - 1), %eax jne 4f - CMP_LP $-1, dep_mutex(%rdi) + LP_OP(cmp) $-1, dep_mutex(%rdi) leaq cond_nwaiters(%rdi), %rdi movl $1, %edx #ifdef __ASSUME_PRIVATE_FUTEX @@ -737,7 +737,7 @@ __condvar_cleanup2: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -747,7 +747,7 @@ __condvar_cleanup2: 2: testq %r12, %r12 jnz 5f addq $cond_futex, %rdi - CMP_LP $-1, dep_mutex-cond_futex(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_futex(%rdi) movl $0x7fffffff, %edx #ifdef __ASSUME_PRIVATE_FUTEX movl $FUTEX_WAKE, %eax diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S index 9fb8cf1b46..e28a0a722b 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S @@ -66,7 +66,7 @@ __pthread_cond_wait: +--------------------------+ */ - CMP_LP $-1, dep_mutex(%rdi) + LP_OP(cmp) $-1, dep_mutex(%rdi) /* Prepare structure passed to cancellation handler. */ movq %rdi, 8(%rsp) @@ -121,7 +121,7 @@ __pthread_cond_wait: movl %eax, (%rsp) xorq %r10, %r10 - CMP_LP $-1, dep_mutex(%rdi) + LP_OP(cmp) $-1, dep_mutex(%rdi) leaq cond_futex(%rdi), %rdi movl $FUTEX_WAIT, %esi je 60f @@ -207,7 +207,7 @@ __pthread_cond_wait: jne 17f addq $cond_nwaiters, %rdi - CMP_LP $-1, dep_mutex-cond_nwaiters(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_nwaiters(%rdi) movl $1, %edx #ifdef __ASSUME_PRIVATE_FUTEX movl $FUTEX_WAKE, %eax @@ -256,7 +256,7 @@ __pthread_cond_wait: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -268,7 +268,7 @@ __pthread_cond_wait: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -284,7 +284,7 @@ __pthread_cond_wait: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -299,7 +299,7 @@ __pthread_cond_wait: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -320,7 +320,7 @@ __pthread_cond_wait: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -349,7 +349,7 @@ __pthread_cond_wait: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -375,7 +375,7 @@ __pthread_cond_wait: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -435,7 +435,7 @@ __condvar_cleanup1: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -468,7 +468,7 @@ __condvar_cleanup1: andl $~((1 << nwaiters_shift) - 1), %eax jne 4f - CMP_LP $-1, dep_mutex(%rdi) + LP_OP(cmp) $-1, dep_mutex(%rdi) leaq cond_nwaiters(%rdi), %rdi movl $1, %edx #ifdef __ASSUME_PRIVATE_FUTEX @@ -496,7 +496,7 @@ __condvar_cleanup1: #if cond_lock != 0 addq $cond_lock, %rdi #endif - CMP_LP $-1, dep_mutex-cond_lock(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_lock(%rdi) movl $LLL_PRIVATE, %eax movl $LLL_SHARED, %esi cmovne %eax, %esi @@ -507,7 +507,7 @@ __condvar_cleanup1: 2: testl %ecx, %ecx jnz 5f addq $cond_futex, %rdi - CMP_LP $-1, dep_mutex-cond_futex(%rdi) + LP_OP(cmp) $-1, dep_mutex-cond_futex(%rdi) movl $0x7fffffff, %edx #ifdef __ASSUME_PRIVATE_FUTEX movl $FUTEX_WAKE, %eax diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S index 99f4ec0088..df68319085 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S @@ -46,7 +46,7 @@ sem_post: #endif jnz 0b - CMP_LP $0, NWAITERS(%rdi) + LP_OP(cmp) $0, NWAITERS(%rdi) je 2f movl $SYS_futex, %eax diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S index 78c7c0ce28..80d44c397b 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S @@ -84,7 +84,7 @@ sem_timedwait: movq %rsi, %r10 LOCK - ADD_LP $1, NWAITERS(%rdi) + LP_OP(add) $1, NWAITERS(%rdi) .LcleanupSTART: 13: call __pthread_enable_asynccancel @@ -135,7 +135,7 @@ sem_timedwait: xorl %eax, %eax 15: LOCK - SUB_LP $1, NWAITERS(%rdi) + LP_OP(sub) $1, NWAITERS(%rdi) leaq 8(%rsp), %rsp cfi_adjust_cfa_offset(-8) @@ -190,7 +190,7 @@ sem_timedwait: movq %rsi, %r13 LOCK - ADD_LP $1, NWAITERS(%r12) + LP_OP(add) $1, NWAITERS(%r12) 7: xorl %esi, %esi movq %rsp,%rdi @@ -267,7 +267,7 @@ sem_timedwait: xorl %eax, %eax 45: LOCK - SUB_LP $1, NWAITERS(%r12) + LP_OP(sub) $1, NWAITERS(%r12) addq $STACKFRAME, %rsp cfi_adjust_cfa_offset(-STACKFRAME) @@ -305,7 +305,7 @@ sem_timedwait_cleanup: movq (%rsp), %rdi LOCK - SUB_LP $1, NWAITERS(%rdi) + LP_OP(sub) $1, NWAITERS(%rdi) movq %rax, %rdi .LcallUR: call _Unwind_Resume@PLT @@ -325,7 +325,7 @@ sem_timedwait_cleanup2: cfi_rel_offset(%r14, STACKFRAME) LOCK - SUB_LP $1, NWAITERS(%r12) + LP_OP(sub) $1, NWAITERS(%r12) movq %rax, %rdi movq STACKFRAME(%rsp), %r14 movq STACKFRAME+8(%rsp), %r13 diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S index a13fffdcc2..9d12b4248d 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S @@ -67,7 +67,7 @@ sem_wait: cfi_adjust_cfa_offset(8) LOCK - ADD_LP $1, NWAITERS(%rdi) + LP_OP(add) $1, NWAITERS(%rdi) .LcleanupSTART: 6: call __pthread_enable_asynccancel @@ -116,7 +116,7 @@ sem_wait: xorl %eax, %eax 9: LOCK - SUB_LP $1, NWAITERS(%rdi) + LP_OP(sub) $1, NWAITERS(%rdi) leaq 8(%rsp), %rsp cfi_adjust_cfa_offset(-8) @@ -137,7 +137,7 @@ sem_wait: sem_wait_cleanup: movq (%rsp), %rdi LOCK - SUB_LP $1, NWAITERS(%rdi) + LP_OP(sub) $1, NWAITERS(%rdi) movq %rax, %rdi .LcallUR: call _Unwind_Resume@PLT diff --git a/sysdeps/x86_64/sysdep.h b/sysdeps/x86_64/sysdep.h index b9da91591f..c0116da118 100644 --- a/sysdeps/x86_64/sysdep.h +++ b/sysdeps/x86_64/sysdep.h @@ -119,17 +119,8 @@ lose: \ /* Long and pointer size in bytes. */ #define LP_SIZE 8 -/* Instruction to move long and pointer. */ -#define MOVE_LP movq - -/* Instruction to add long and pointer. */ -#define ADD_LP addq - -/* Instruction to substract long and pointer. */ -#define SUB_LP subq - -/* Instruction to compare against long and pointer. */ -#define CMP_LP cmpq +/* Instruction to operate on long and pointer. */ +#define LP_OP(insn) insn##q /* Assembler address directive. */ #define ASM_ADDR .quad @@ -160,6 +151,9 @@ lose: \ /* Assembler address directive. */ #define ASM_ADDR ".quad" +/* Instruction to operate on long and pointer. */ +#define LP_OP(insn) #insn "q" + /* Registers to hold long and pointer. */ #define RAX_LP "rax" #define RBP_LP "rbp" diff --git a/sysdeps/x86_64/x32/sysdep.h b/sysdeps/x86_64/x32/sysdep.h index 0bb21f8a35..d8c87d92ed 100644 --- a/sysdeps/x86_64/x32/sysdep.h +++ b/sysdeps/x86_64/x32/sysdep.h @@ -17,8 +17,9 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#undef ASM_ADDR #undef LP_SIZE +#undef LP_OP +#undef ASM_ADDR #undef RAX_LP #undef RBP_LP @@ -41,17 +42,7 @@ # define LP_SIZE 4 -# undef MOVE_LP -# define MOVE_LP movl - -# undef ADD_LP -# define ADD_LP addl - -# undef SUB_LP -# define SUB_LP subl - -# undef CMP_LP -# define CMP_LP cmpl +# define LP_OP(insn) insn##l # define ASM_ADDR .long @@ -76,6 +67,8 @@ # define LP_SIZE "4" +# define LP_OP(insn) #insn "l" + # define ASM_ADDR ".long" # define RAX_LP "eax" |