--- a/src/hotspot/os_cpu/linux_s390/atomic_linux_s390.hpp Thu Sep 28 11:02:55 2017 +0200
+++ b/src/hotspot/os_cpu/linux_s390/atomic_linux_s390.hpp Tue Sep 26 14:05:27 2017 +0200
@@ -192,219 +192,6 @@
}
-//------------
-// Atomic::inc
-//------------
-// These methods force the value in memory to be incremented (augmented by 1).
-// Both, memory value and increment, are treated as 32bit signed binary integers.
-// No overflow exceptions are recognized, and the condition code does not hold
-// information about the value in memory.
-//
-// The value in memory is updated by using a compare-and-swap instruction. The
-// instruction is retried as often as required.
-
-inline void Atomic::inc(volatile jint* dest) {
- unsigned int old, upd;
-
- if (VM_Version::has_LoadAndALUAtomicV1()) {
-// tty->print_cr("Atomic::inc called... dest @%p", dest);
- __asm__ __volatile__ (
- " LGHI 2,1 \n\t" // load increment
- " LA 3,%[mem] \n\t" // force data address into ARG2
-// " LAA %[upd],%[inc],%[mem] \n\t" // increment and get old value
-// " LAA 2,2,0(3) \n\t" // actually coded instruction
- " .byte 0xeb \n\t" // LAA main opcode
- " .byte 0x22 \n\t" // R1,R3
- " .byte 0x30 \n\t" // R2,disp1
- " .byte 0x00 \n\t" // disp2,disp3
- " .byte 0x00 \n\t" // disp4,disp5
- " .byte 0xf8 \n\t" // LAA minor opcode
- " AGHI 2,1 \n\t" // calc new value in register
- " LR %[upd],2 \n\t" // move to result register
- //---< outputs >---
- : [upd] "=&d" (upd) // write-only, updated counter value
- , [mem] "+Q" (*dest) // read/write, memory to be updated atomically
- //---< inputs >---
- :
-// : [inc] "a" (inc) // read-only.
- //---< clobbered >---
- : "cc", "r2", "r3", "memory"
- );
- } else {
- __asm__ __volatile__ (
- " LLGF %[old],%[mem] \n\t" // get old value
- "0: LA %[upd],1(,%[old]) \n\t" // calc result
- " CS %[old],%[upd],%[mem] \n\t" // try to xchg res with mem
- " JNE 0b \n\t" // no success? -> retry
- //---< outputs >---
- : [old] "=&a" (old) // write-only, old counter value
- , [upd] "=&d" (upd) // write-only, updated counter value
- , [mem] "+Q" (*dest) // read/write, memory to be updated atomically
- //---< inputs >---
- :
- //---< clobbered >---
- : "cc", "memory"
- );
- }
-}
-
-inline void Atomic::inc_ptr(volatile intptr_t* dest) {
- unsigned long old, upd;
-
- if (VM_Version::has_LoadAndALUAtomicV1()) {
- __asm__ __volatile__ (
- " LGHI 2,1 \n\t" // load increment
- " LA 3,%[mem] \n\t" // force data address into ARG2
-// " LAAG %[upd],%[inc],%[mem] \n\t" // increment and get old value
-// " LAAG 2,2,0(3) \n\t" // actually coded instruction
- " .byte 0xeb \n\t" // LAA main opcode
- " .byte 0x22 \n\t" // R1,R3
- " .byte 0x30 \n\t" // R2,disp1
- " .byte 0x00 \n\t" // disp2,disp3
- " .byte 0x00 \n\t" // disp4,disp5
- " .byte 0xe8 \n\t" // LAA minor opcode
- " AGHI 2,1 \n\t" // calc new value in register
- " LR %[upd],2 \n\t" // move to result register
- //---< outputs >---
- : [upd] "=&d" (upd) // write-only, updated counter value
- , [mem] "+Q" (*dest) // read/write, memory to be updated atomically
- //---< inputs >---
- :
-// : [inc] "a" (inc) // read-only.
- //---< clobbered >---
- : "cc", "r2", "r3", "memory"
- );
- } else {
- __asm__ __volatile__ (
- " LG %[old],%[mem] \n\t" // get old value
- "0: LA %[upd],1(,%[old]) \n\t" // calc result
- " CSG %[old],%[upd],%[mem] \n\t" // try to xchg res with mem
- " JNE 0b \n\t" // no success? -> retry
- //---< outputs >---
- : [old] "=&a" (old) // write-only, old counter value
- , [upd] "=&d" (upd) // write-only, updated counter value
- , [mem] "+Q" (*dest) // read/write, memory to be updated atomically
- //---< inputs >---
- :
- //---< clobbered >---
- : "cc", "memory"
- );
- }
-}
-
-inline void Atomic::inc_ptr(volatile void* dest) {
- inc_ptr((volatile intptr_t*)dest);
-}
-
-//------------
-// Atomic::dec
-//------------
-// These methods force the value in memory to be decremented (augmented by -1).
-// Both, memory value and decrement, are treated as 32bit signed binary integers.
-// No overflow exceptions are recognized, and the condition code does not hold
-// information about the value in memory.
-//
-// The value in memory is updated by using a compare-and-swap instruction. The
-// instruction is retried as often as required.
-
-inline void Atomic::dec(volatile jint* dest) {
- unsigned int old, upd;
-
- if (VM_Version::has_LoadAndALUAtomicV1()) {
- __asm__ __volatile__ (
- " LGHI 2,-1 \n\t" // load increment
- " LA 3,%[mem] \n\t" // force data address into ARG2
-// " LAA %[upd],%[inc],%[mem] \n\t" // increment and get old value
-// " LAA 2,2,0(3) \n\t" // actually coded instruction
- " .byte 0xeb \n\t" // LAA main opcode
- " .byte 0x22 \n\t" // R1,R3
- " .byte 0x30 \n\t" // R2,disp1
- " .byte 0x00 \n\t" // disp2,disp3
- " .byte 0x00 \n\t" // disp4,disp5
- " .byte 0xf8 \n\t" // LAA minor opcode
- " AGHI 2,-1 \n\t" // calc new value in register
- " LR %[upd],2 \n\t" // move to result register
- //---< outputs >---
- : [upd] "=&d" (upd) // write-only, updated counter value
- , [mem] "+Q" (*dest) // read/write, memory to be updated atomically
- //---< inputs >---
- :
-// : [inc] "a" (inc) // read-only.
- //---< clobbered >---
- : "cc", "r2", "r3", "memory"
- );
- } else {
- __asm__ __volatile__ (
- " LLGF %[old],%[mem] \n\t" // get old value
- // LAY not supported by inline assembler
- // "0: LAY %[upd],-1(,%[old]) \n\t" // calc result
- "0: LR %[upd],%[old] \n\t" // calc result
- " AHI %[upd],-1 \n\t"
- " CS %[old],%[upd],%[mem] \n\t" // try to xchg res with mem
- " JNE 0b \n\t" // no success? -> retry
- //---< outputs >---
- : [old] "=&a" (old) // write-only, old counter value
- , [upd] "=&d" (upd) // write-only, updated counter value
- , [mem] "+Q" (*dest) // read/write, memory to be updated atomically
- //---< inputs >---
- :
- //---< clobbered >---
- : "cc", "memory"
- );
- }
-}
-
-inline void Atomic::dec_ptr(volatile intptr_t* dest) {
- unsigned long old, upd;
-
- if (VM_Version::has_LoadAndALUAtomicV1()) {
- __asm__ __volatile__ (
- " LGHI 2,-1 \n\t" // load increment
- " LA 3,%[mem] \n\t" // force data address into ARG2
-// " LAAG %[upd],%[inc],%[mem] \n\t" // increment and get old value
-// " LAAG 2,2,0(3) \n\t" // actually coded instruction
- " .byte 0xeb \n\t" // LAA main opcode
- " .byte 0x22 \n\t" // R1,R3
- " .byte 0x30 \n\t" // R2,disp1
- " .byte 0x00 \n\t" // disp2,disp3
- " .byte 0x00 \n\t" // disp4,disp5
- " .byte 0xe8 \n\t" // LAA minor opcode
- " AGHI 2,-1 \n\t" // calc new value in register
- " LR %[upd],2 \n\t" // move to result register
- //---< outputs >---
- : [upd] "=&d" (upd) // write-only, updated counter value
- , [mem] "+Q" (*dest) // read/write, memory to be updated atomically
- //---< inputs >---
- :
-// : [inc] "a" (inc) // read-only.
- //---< clobbered >---
- : "cc", "r2", "r3", "memory"
- );
- } else {
- __asm__ __volatile__ (
- " LG %[old],%[mem] \n\t" // get old value
-// LAY not supported by inline assembler
-// "0: LAY %[upd],-1(,%[old]) \n\t" // calc result
- "0: LGR %[upd],%[old] \n\t" // calc result
- " AGHI %[upd],-1 \n\t"
- " CSG %[old],%[upd],%[mem] \n\t" // try to xchg res with mem
- " JNE 0b \n\t" // no success? -> retry
- //---< outputs >---
- : [old] "=&a" (old) // write-only, old counter value
- , [upd] "=&d" (upd) // write-only, updated counter value
- , [mem] "+Q" (*dest) // read/write, memory to be updated atomically
- //---< inputs >---
- :
- //---< clobbered >---
- : "cc", "memory"
- );
- }
-}
-
-inline void Atomic::dec_ptr(volatile void* dest) {
- dec_ptr((volatile intptr_t*)dest);
-}
-
//-------------
// Atomic::xchg
//-------------