summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/z_Linux_asm.s
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/runtime/src/z_Linux_asm.s')
-rw-r--r--openmp/runtime/src/z_Linux_asm.s142
1 files changed, 22 insertions, 120 deletions
diff --git a/openmp/runtime/src/z_Linux_asm.s b/openmp/runtime/src/z_Linux_asm.s
index 11fd0238226..c9a5526525b 100644
--- a/openmp/runtime/src/z_Linux_asm.s
+++ b/openmp/runtime/src/z_Linux_asm.s
@@ -21,7 +21,6 @@
#if KMP_ARCH_X86 || KMP_ARCH_X86_64
# if KMP_MIC
-//
// the 'delay r16/r32/r64' should be used instead of the 'pause'.
// The delay operation has the effect of removing the current thread from
// the round-robin HT mechanism, and therefore speeds up the issue rate of
@@ -70,9 +69,10 @@
KMP_PREFIX_UNDERSCORE($0):
.endmacro
# else // KMP_OS_DARWIN
-# define KMP_PREFIX_UNDERSCORE(x) x // no extra underscore for Linux* OS symbols
+# define KMP_PREFIX_UNDERSCORE(x) x //no extra underscore for Linux* OS symbols
// Format labels so that they don't override function names in gdb's backtraces
-// MIC assembler doesn't accept .L syntax, the L works fine there (as well as on OS X*)
+// MIC assembler doesn't accept .L syntax, the L works fine there (as well as
+// on OS X*)
# if KMP_MIC
# define KMP_LABEL(x) L_##x // local label
# else
@@ -163,12 +163,10 @@ KMP_PREFIX_UNDERSCORE(\proc):
#ifdef KMP_GOMP_COMPAT
-//
// Support for unnamed common blocks.
//
// Because the symbol ".gomp_critical_user_" contains a ".", we have to
// put this stuff in assembly.
-//
# if KMP_ARCH_X86
# if KMP_OS_DARWIN
@@ -221,14 +219,12 @@ __kmp_unnamed_critical_addr:
// microtasking routines specifically written for IA-32 architecture
// running Linux* OS
// -----------------------------------------------------------------------
-//
.ident "Intel Corporation"
.data
ALIGN 4
// void
// __kmp_x86_pause( void );
-//
.text
PROC __kmp_x86_pause
@@ -238,10 +234,9 @@ __kmp_unnamed_critical_addr:
DEBUG_INFO __kmp_x86_pause
-//
// void
// __kmp_x86_cpuid( int mode, int mode2, void *cpuid_buffer );
-//
+
PROC __kmp_x86_cpuid
pushl %ebp
@@ -253,7 +248,7 @@ __kmp_unnamed_critical_addr:
movl 8(%ebp), %eax
movl 12(%ebp), %ecx
- cpuid // Query the CPUID for the current processor
+ cpuid // Query the CPUID for the current processor
movl 16(%ebp), %edi
movl %eax, 0(%edi)
@@ -275,10 +270,8 @@ __kmp_unnamed_critical_addr:
# if !KMP_ASM_INTRINS
//------------------------------------------------------------------------
-//
// kmp_int32
// __kmp_test_then_add32( volatile kmp_int32 *p, kmp_int32 d );
-//
PROC __kmp_test_then_add32
@@ -291,7 +284,6 @@ __kmp_unnamed_critical_addr:
DEBUG_INFO __kmp_test_then_add32
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_xchg_fixed8
//
// kmp_int32
@@ -302,7 +294,6 @@ __kmp_unnamed_critical_addr:
// d: 8(%esp)
//
// return: %al
-
PROC __kmp_xchg_fixed8
movl 4(%esp), %ecx // "p"
@@ -316,7 +307,6 @@ __kmp_unnamed_critical_addr:
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_xchg_fixed16
//
// kmp_int16
@@ -326,7 +316,6 @@ __kmp_unnamed_critical_addr:
// p: 4(%esp)
// d: 8(%esp)
// return: %ax
-
PROC __kmp_xchg_fixed16
movl 4(%esp), %ecx // "p"
@@ -340,7 +329,6 @@ __kmp_unnamed_critical_addr:
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_xchg_fixed32
//
// kmp_int32
@@ -351,7 +339,6 @@ __kmp_unnamed_critical_addr:
// d: 8(%esp)
//
// return: %eax
-
PROC __kmp_xchg_fixed32
movl 4(%esp), %ecx // "p"
@@ -364,11 +351,8 @@ __kmp_unnamed_critical_addr:
DEBUG_INFO __kmp_xchg_fixed32
-//
// kmp_int8
// __kmp_compare_and_store8( volatile kmp_int8 *p, kmp_int8 cv, kmp_int8 sv );
-//
-
PROC __kmp_compare_and_store8
movl 4(%esp), %ecx
@@ -382,11 +366,8 @@ __kmp_unnamed_critical_addr:
DEBUG_INFO __kmp_compare_and_store8
-//
// kmp_int16
-// __kmp_compare_and_store16( volatile kmp_int16 *p, kmp_int16 cv, kmp_int16 sv );
-//
-
+// __kmp_compare_and_store16(volatile kmp_int16 *p, kmp_int16 cv, kmp_int16 sv);
PROC __kmp_compare_and_store16
movl 4(%esp), %ecx
@@ -400,11 +381,8 @@ __kmp_unnamed_critical_addr:
DEBUG_INFO __kmp_compare_and_store16
-//
// kmp_int32
-// __kmp_compare_and_store32( volatile kmp_int32 *p, kmp_int32 cv, kmp_int32 sv );
-//
-
+// __kmp_compare_and_store32(volatile kmp_int32 *p, kmp_int32 cv, kmp_int32 sv);
PROC __kmp_compare_and_store32
movl 4(%esp), %ecx
@@ -412,16 +390,14 @@ __kmp_unnamed_critical_addr:
movl 12(%esp), %edx
lock
cmpxchgl %edx,(%ecx)
- sete %al // if %eax == (%ecx) set %al = 1 else set %al = 0
- and $1, %eax // sign extend previous instruction
+ sete %al // if %eax == (%ecx) set %al = 1 else set %al = 0
+ and $1, %eax // sign extend previous instruction
ret
DEBUG_INFO __kmp_compare_and_store32
-//
// kmp_int32
-// __kmp_compare_and_store64( volatile kmp_int64 *p, kmp_int64 cv, kmp_int64 sv );
-//
+// __kmp_compare_and_store64(volatile kmp_int64 *p, kmp_int64 cv, kmp_int64 s );
PROC __kmp_compare_and_store64
pushl %ebp
@@ -435,8 +411,8 @@ __kmp_unnamed_critical_addr:
movl 24(%ebp), %ecx // "sv" high order word
lock
cmpxchg8b (%edi)
- sete %al // if %edx:eax == (%edi) set %al = 1 else set %al = 0
- and $1, %eax // sign extend previous instruction
+ sete %al // if %edx:eax == (%edi) set %al = 1 else set %al = 0
+ and $1, %eax // sign extend previous instruction
popl %edi
popl %ebx
movl %ebp, %esp
@@ -445,11 +421,8 @@ __kmp_unnamed_critical_addr:
DEBUG_INFO __kmp_compare_and_store64
-//
// kmp_int8
-// __kmp_compare_and_store_ret8( volatile kmp_int8 *p, kmp_int8 cv, kmp_int8 sv );
-//
-
+// __kmp_compare_and_store_ret8(volatile kmp_int8 *p, kmp_int8 cv, kmp_int8 sv);
PROC __kmp_compare_and_store_ret8
movl 4(%esp), %ecx
@@ -461,11 +434,9 @@ __kmp_unnamed_critical_addr:
DEBUG_INFO __kmp_compare_and_store_ret8
-//
// kmp_int16
-// __kmp_compare_and_store_ret16( volatile kmp_int16 *p, kmp_int16 cv, kmp_int16 sv );
-//
-
+// __kmp_compare_and_store_ret16(volatile kmp_int16 *p, kmp_int16 cv,
+// kmp_int16 sv);
PROC __kmp_compare_and_store_ret16
movl 4(%esp), %ecx
@@ -477,11 +448,9 @@ __kmp_unnamed_critical_addr:
DEBUG_INFO __kmp_compare_and_store_ret16
-//
// kmp_int32
-// __kmp_compare_and_store_ret32( volatile kmp_int32 *p, kmp_int32 cv, kmp_int32 sv );
-//
-
+// __kmp_compare_and_store_ret32(volatile kmp_int32 *p, kmp_int32 cv,
+// kmp_int32 sv);
PROC __kmp_compare_and_store_ret32
movl 4(%esp), %ecx
@@ -493,10 +462,9 @@ __kmp_unnamed_critical_addr:
DEBUG_INFO __kmp_compare_and_store_ret32
-//
// kmp_int64
-// __kmp_compare_and_store_ret64( volatile kmp_int64 *p, kmp_int64 cv, kmp_int64 sv );
-//
+// __kmp_compare_and_store_ret64(volatile kmp_int64 *p, kmp_int64 cv,
+// kmp_int64 sv);
PROC __kmp_compare_and_store_ret64
pushl %ebp
@@ -520,7 +488,6 @@ __kmp_unnamed_critical_addr:
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_xchg_real32
//
// kmp_real32
@@ -531,8 +498,6 @@ __kmp_unnamed_critical_addr:
// data: 8(%esp)
//
// return: %eax
-
-
PROC __kmp_xchg_real32
pushl %ebp
@@ -565,7 +530,6 @@ __kmp_unnamed_critical_addr:
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_load_x87_fpu_control_word
//
// void
@@ -573,8 +537,6 @@ __kmp_unnamed_critical_addr:
//
// parameters:
// p: 4(%esp)
-//
-
PROC __kmp_load_x87_fpu_control_word
movl 4(%esp), %eax
@@ -585,7 +547,6 @@ __kmp_unnamed_critical_addr:
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_store_x87_fpu_control_word
//
// void
@@ -593,8 +554,6 @@ __kmp_unnamed_critical_addr:
//
// parameters:
// p: 4(%esp)
-//
-
PROC __kmp_store_x87_fpu_control_word
movl 4(%esp), %eax
@@ -605,14 +564,10 @@ __kmp_unnamed_critical_addr:
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_clear_x87_fpu_status_word
//
// void
// __kmp_clear_x87_fpu_status_word();
-//
-//
-
PROC __kmp_clear_x87_fpu_status_word
fnclex
@@ -622,7 +577,6 @@ __kmp_unnamed_critical_addr:
//------------------------------------------------------------------------
-//
// typedef void (*microtask_t)( int *gtid, int *tid, ... );
//
// int
@@ -714,7 +668,6 @@ KMP_LABEL(invoke_3):
DEBUG_INFO __kmp_hardware_timestamp
// -- End __kmp_hardware_timestamp
-// -----------------------------------------------------------------------
#endif /* KMP_ARCH_X86 */
@@ -732,9 +685,9 @@ KMP_LABEL(invoke_3):
.data
ALIGN 4
-// To prevent getting our code into .data section .text added to every routine definition for x86_64.
+// To prevent getting our code into .data section .text added to every routine
+// definition for x86_64.
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_x86_cpuid
//
// void
@@ -744,7 +697,6 @@ KMP_LABEL(invoke_3):
// mode: %edi
// mode2: %esi
// cpuid_buffer: %rdx
-
.text
PROC __kmp_x86_cpuid
@@ -774,7 +726,6 @@ KMP_LABEL(invoke_3):
# if !KMP_ASM_INTRINS
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_test_then_add32
//
// kmp_int32
@@ -785,7 +736,6 @@ KMP_LABEL(invoke_3):
// d: %esi
//
// return: %eax
-
.text
PROC __kmp_test_then_add32
@@ -798,7 +748,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_test_then_add64
//
// kmp_int64
@@ -808,7 +757,6 @@ KMP_LABEL(invoke_3):
// p: %rdi
// d: %rsi
// return: %rax
-
.text
PROC __kmp_test_then_add64
@@ -821,7 +769,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_xchg_fixed8
//
// kmp_int32
@@ -832,7 +779,6 @@ KMP_LABEL(invoke_3):
// d: %sil
//
// return: %al
-
.text
PROC __kmp_xchg_fixed8
@@ -846,7 +792,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_xchg_fixed16
//
// kmp_int16
@@ -856,7 +801,6 @@ KMP_LABEL(invoke_3):
// p: %rdi
// d: %si
// return: %ax
-
.text
PROC __kmp_xchg_fixed16
@@ -870,7 +814,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_xchg_fixed32
//
// kmp_int32
@@ -881,7 +824,6 @@ KMP_LABEL(invoke_3):
// d: %esi
//
// return: %eax
-
.text
PROC __kmp_xchg_fixed32
@@ -895,7 +837,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_xchg_fixed64
//
// kmp_int64
@@ -905,7 +846,6 @@ KMP_LABEL(invoke_3):
// p: %rdi
// d: %rsi
// return: %rax
-
.text
PROC __kmp_xchg_fixed64
@@ -919,7 +859,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_compare_and_store8
//
// kmp_int8
@@ -931,7 +870,6 @@ KMP_LABEL(invoke_3):
// sv: %edx
//
// return: %eax
-
.text
PROC __kmp_compare_and_store8
@@ -946,7 +884,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_compare_and_store16
//
// kmp_int16
@@ -958,7 +895,6 @@ KMP_LABEL(invoke_3):
// sv: %dx
//
// return: %eax
-
.text
PROC __kmp_compare_and_store16
@@ -973,7 +909,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_compare_and_store32
//
// kmp_int32
@@ -985,7 +920,6 @@ KMP_LABEL(invoke_3):
// sv: %edx
//
// return: %eax
-
.text
PROC __kmp_compare_and_store32
@@ -1000,7 +934,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_compare_and_store64
//
// kmp_int32
@@ -1011,7 +944,6 @@ KMP_LABEL(invoke_3):
// cv: %rsi
// sv: %rdx
// return: %eax
-
.text
PROC __kmp_compare_and_store64
@@ -1025,7 +957,6 @@ KMP_LABEL(invoke_3):
DEBUG_INFO __kmp_compare_and_store64
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_compare_and_store_ret8
//
// kmp_int8
@@ -1037,7 +968,6 @@ KMP_LABEL(invoke_3):
// sv: %edx
//
// return: %eax
-
.text
PROC __kmp_compare_and_store_ret8
@@ -1050,7 +980,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_compare_and_store_ret16
//
// kmp_int16
@@ -1062,7 +991,6 @@ KMP_LABEL(invoke_3):
// sv: %dx
//
// return: %eax
-
.text
PROC __kmp_compare_and_store_ret16
@@ -1075,7 +1003,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_compare_and_store_ret32
//
// kmp_int32
@@ -1087,7 +1014,6 @@ KMP_LABEL(invoke_3):
// sv: %edx
//
// return: %eax
-
.text
PROC __kmp_compare_and_store_ret32
@@ -1100,7 +1026,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_compare_and_store_ret64
//
// kmp_int64
@@ -1111,7 +1036,6 @@ KMP_LABEL(invoke_3):
// cv: %rsi
// sv: %rdx
// return: %eax
-
.text
PROC __kmp_compare_and_store_ret64
@@ -1130,7 +1054,6 @@ KMP_LABEL(invoke_3):
# if !KMP_ASM_INTRINS
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_xchg_real32
//
// kmp_real32
@@ -1141,7 +1064,6 @@ KMP_LABEL(invoke_3):
// data: %xmm0 (lower 4 bytes)
//
// return: %xmm0 (lower 4 bytes)
-
.text
PROC __kmp_xchg_real32
@@ -1158,7 +1080,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_xchg_real64
//
// kmp_real64
@@ -1168,8 +1089,6 @@ KMP_LABEL(invoke_3):
// addr: %rdi
// data: %xmm0 (lower 8 bytes)
// return: %xmm0 (lower 8 bytes)
-//
-
.text
PROC __kmp_xchg_real64
@@ -1190,7 +1109,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_load_x87_fpu_control_word
//
// void
@@ -1198,8 +1116,6 @@ KMP_LABEL(invoke_3):
//
// parameters:
// p: %rdi
-//
-
.text
PROC __kmp_load_x87_fpu_control_word
@@ -1210,7 +1126,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_store_x87_fpu_control_word
//
// void
@@ -1218,8 +1133,6 @@ KMP_LABEL(invoke_3):
//
// parameters:
// p: %rdi
-//
-
.text
PROC __kmp_store_x87_fpu_control_word
@@ -1230,14 +1143,10 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_clear_x87_fpu_status_word
//
// void
// __kmp_clear_x87_fpu_status_word();
-//
-//
-
.text
PROC __kmp_clear_x87_fpu_status_word
@@ -1256,7 +1165,6 @@ KMP_LABEL(invoke_3):
//------------------------------------------------------------------------
-//
// typedef void (*microtask_t)( int *gtid, int *tid, ... );
//
// int
@@ -1267,8 +1175,7 @@ KMP_LABEL(invoke_3):
// return 1;
// }
//
-// note:
-// at call to pkfn must have %rsp 128-byte aligned for compiler
+// note: at call to pkfn must have %rsp 128-byte aligned for compiler
//
// parameters:
// %rdi: pkfn
@@ -1291,8 +1198,6 @@ KMP_LABEL(invoke_3):
// %rbx: used to hold pkfn address, and zero constant, callee-save
//
// return: %eax (always 1/TRUE)
-//
-
__gtid = -16
__tid = -24
@@ -1442,13 +1347,10 @@ KMP_LABEL(kmp_1_exit):
// -- End __kmp_hardware_timestamp
//------------------------------------------------------------------------
-//
// FUNCTION __kmp_bsr32
//
// int
// __kmp_bsr32( int );
-//
-
.text
PROC __kmp_bsr32
OpenPOWER on IntegriCloud