summaryrefslogtreecommitdiffstats
path: root/src/corelib/arch/x86_64/qatomic_sun.s
diff options
context:
space:
mode:
authorQt by Nokia <qt-info@nokia.com>2011-04-27 12:05:43 +0200
committeraxis <qt-info@nokia.com>2011-04-27 12:05:43 +0200
commit38be0d13830efd2d98281c645c3a60afe05ffece (patch)
tree6ea73f3ec77f7d153333779883e8120f82820abe /src/corelib/arch/x86_64/qatomic_sun.s
Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12
Diffstat (limited to 'src/corelib/arch/x86_64/qatomic_sun.s')
-rw-r--r--src/corelib/arch/x86_64/qatomic_sun.s91
1 files changed, 91 insertions, 0 deletions
diff --git a/src/corelib/arch/x86_64/qatomic_sun.s b/src/corelib/arch/x86_64/qatomic_sun.s
new file mode 100644
index 0000000000..37969e61cb
--- /dev/null
+++ b/src/corelib/arch/x86_64/qatomic_sun.s
@@ -0,0 +1,91 @@
+ .code64
+
+ .globl q_atomic_increment
+ .type q_atomic_increment,@function
+ .section .text, "ax"
+ .align 16
+q_atomic_increment:
+ lock
+ incl (%rdi)
+ setne %al
+ ret
+ .size q_atomic_increment,.-q_atomic_increment
+
+ .globl q_atomic_decrement
+ .type q_atomic_decrement,@function
+ .section .text, "ax"
+ .align 16
+q_atomic_decrement:
+ lock
+ decl (%rdi)
+ setne %al
+ ret
+ .size q_atomic_decrement,.-q_atomic_decrement
+
+ .globl q_atomic_test_and_set_int
+ .type q_atomic_test_and_set_int, @function
+ .section .text, "ax"
+ .align 16
+q_atomic_test_and_set_int:
+ movl %esi,%eax
+ lock
+ cmpxchgl %edx,(%rdi)
+ movl $0,%eax
+ sete %al
+ ret
+ .size q_atomic_test_and_set_int, . - q_atomic_test_and_set_int
+
+ .globl q_atomic_set_int
+ .type q_atomic_set_int,@function
+ .section .text, "ax"
+ .align 16
+q_atomic_set_int:
+ xchgl %esi,(%rdi)
+ movl %esi,%eax
+ ret
+ .size q_atomic_set_int,.-q_atomic_set_int
+
+ .globl q_atomic_fetch_and_add_int
+ .type q_atomic_fetch_and_add_int,@function
+ .section .text, "ax"
+ .align 16
+q_atomic_fetch_and_add_int:
+ lock
+ xaddl %esi,(%rdi)
+ movl %esi, %eax
+ ret
+ .size q_atomic_fetch_and_add_int,.-q_atomic_fetch_and_add_int
+
+ .globl q_atomic_test_and_set_ptr
+ .type q_atomic_test_and_set_ptr, @function
+ .section .text, "ax"
+ .align 16
+q_atomic_test_and_set_ptr:
+ movq %rsi,%rax
+ lock
+ cmpxchgq %rdx,(%rdi)
+ movq $0, %rax
+ sete %al
+ ret
+ .size q_atomic_test_and_set_ptr, . - q_atomic_test_and_set_ptr
+
+ .globl q_atomic_set_ptr
+ .type q_atomic_set_ptr,@function
+ .section .text, "ax"
+ .align 16
+q_atomic_set_ptr:
+ xchgq %rsi,(%rdi)
+ movq %rsi,%rax
+ ret
+ .size q_atomic_set_ptr,.-q_atomic_set_ptr
+
+ .globl q_atomic_fetch_and_add_ptr
+ .type q_atomic_fetch_and_add_ptr,@function
+ .section .text, "ax"
+ .align 16
+q_atomic_fetch_and_add_ptr:
+ lock
+ xaddq %rsi,(%rdi)
+ movq %rsi,%rax
+ ret
+ .size q_atomic_fetch_and_add_ptr,.-q_atomic_fetch_and_add_ptr