1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-28 05:21:27 +03:00
postgres/src/backend/port/tas/solaris_x86.s
Bruce Momjian 128bed948f Rewrite Solaris compiler tas() assembly routines, merge i386 and x86_64
assembler files, renamed as solaris_x86.s.

Theo Schlossnagle
2006-04-27 22:28:42 +00:00

33 lines
780 B
ArmAsm

/=======================================================================
/ solaris_i386.s -- compare and swap for solaris_i386
/=======================================================================
/ Fortunately the Sun compiler understands cpp conditionals
.file "tas.s"
#if defined(__amd64)
.code64
#endif
.globl pg_atomic_cas
.type pg_atomic_cas, @function
.section .text, "ax"
.align 16
pg_atomic_cas:
#if defined(__amd64)
movl %edx,%eax
lock
cmpxchgl %esi,(%rdi)
#else
movl 4(%esp), %edx
movl 8(%esp), %ecx
movl 12(%esp), %eax
lock
cmpxchgl %ecx, (%edx)
#endif
ret
.size pg_atomic_cas, . - pg_atomic_cas