annotate dyncall/dyncall_call.S @ 357:d982a00c2177

- PPC64 asm syntax fix, specifying explicitly comparison mode for cmpi (newer toolchains complain, older ones took optional field of instruction which happened to be same value)
author Tassilo Philipp
date Tue, 25 Feb 2020 18:16:13 +0100
parents d55f9d508074
children 0c8838766866
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
1 /*
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
2
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
3 Package: dyncall
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
4 Library: dyncall
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
5 File: dyncall/dyncall_call.S
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6 Description: assembly call kernel, auto-selected by gcc / Plan9 build system
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
7 License:
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
8
281
f5577f6bf97a - file header cleanups for release
Tassilo Philipp
parents: 269
diff changeset
9 Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
10 Tassilo Philipp <tphilipp@potion-studios.com>
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
11
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
12 Permission to use, copy, modify, and distribute this software for any
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
13 purpose with or without fee is hereby granted, provided that the above
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
14 copyright notice and this permission notice appear in all copies.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
15
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
16 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
17 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
18 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
19 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
20 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
21 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
22 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
23
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
24 */
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
25
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
26
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
27 #include "dyncall_macros.h"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
28
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
29 /* Plan9 */
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
30 #if defined(DC__OS_Plan9)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
31 # if defined(DC__Arch_Intel_x86)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
32 # include "dyncall_call_x86_8a.s"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
33 # else
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
34 # error Unsupported Architecture on Plan9.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
35 # endif
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
36 #elif defined(DC__C_MSVC)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
37 # if defined(DC__OS_Win32)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
38 # include "dyncall_call_x86_generic_masm.asm"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
39 # elif defined(DC__OS_Win64)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
40 # include "dyncall_call_x64_generic_masm.asm"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
41 # endif
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
42 #else
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
43 # if defined(DC__Arch_Intel_x86)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
44 # include "dyncall_call_x86.S"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
45 # elif defined(DC__Arch_AMD64)
165
572aff021627 - file name/layout cleanup, removed "-att" from x64 .S filenames, as unnecessary and also misleading
cslag
parents: 0
diff changeset
46 # include "dyncall_call_x64.S"
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
47 # elif defined(DC__Arch_ARM_ARM)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
48 # if defined(DC__ABI_ARM_HF)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
49 # include "dyncall_call_arm32_arm_armhf.S"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
50 # else
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
51 # include "dyncall_call_arm32_arm.S"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
52 # endif
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
53 # elif defined(DC__Arch_ARM_THUMB)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
54 # if defined(DC__OS_Darwin)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
55 # include "dyncall_call_arm32_thumb_apple.s"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
56 # else
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
57 # if defined(DC__ABI_ARM_HF)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
58 # include "dyncall_call_arm32_thumb_armhf.S"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
59 # else
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
60 # include "dyncall_call_arm32_thumb_gas.s"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
61 # endif
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
62 # endif
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
63 # elif defined(DC__Arch_ARM64)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
64 # include "dyncall_call_arm64.S"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
65 # elif defined(DC__Arch_PPC32)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
66 # include "dyncall_call_ppc32.S"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
67 # elif defined(DC__Arch_PPC64)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
68 # include "dyncall_call_ppc64.S"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
69 # elif defined(DC__Arch_MIPS) || defined(DC__Arch_MIPS64)
302
d55f9d508074 - mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents: 281
diff changeset
70 # if defined(DC__ABI_MIPS_O32)
d55f9d508074 - mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents: 281
diff changeset
71 # include "dyncall_call_mips_o32.S"
d55f9d508074 - mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents: 281
diff changeset
72 # elif defined(DC__ABI_MIPS_N64)
d55f9d508074 - mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents: 281
diff changeset
73 # include "dyncall_call_mips_n64.S"
d55f9d508074 - mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents: 281
diff changeset
74 # elif defined(DC__ABI_MIPS_N32)
d55f9d508074 - mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents: 281
diff changeset
75 # include "dyncall_call_mips_n32.S"
d55f9d508074 - mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents: 281
diff changeset
76 # else
d55f9d508074 - mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents: 281
diff changeset
77 # include "dyncall_call_mips_eabi_gas.s"
d55f9d508074 - mips softfloat support for o32 callconv (calls and callbacks, little and big endian)
Tassilo Philipp
parents: 281
diff changeset
78 # endif
179
b11b0735b09f - renamings: sparc_v9 -> sparc64
cslag
parents: 178
diff changeset
79 # elif defined(DC__Arch_Sparc64)
192
cf8134a20759 - b/c no preproc needed, changed some files from .S -> .s
Tassilo Philipp
parents: 179
diff changeset
80 # include "dyncall_call_sparc64.s"
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
81 # elif defined(DC__Arch_Sparc)
192
cf8134a20759 - b/c no preproc needed, changed some files from .S -> .s
Tassilo Philipp
parents: 179
diff changeset
82 # include "dyncall_call_sparc.s"
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
83 # else
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
84 # error Unsupported Architecture.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
85 # endif
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
86 #endif
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
87
268
03f0b683918a - reintroduced .note.GNU-stack section, as mentioned in prev commit
Tassilo Philipp
parents: 192
diff changeset
88
03f0b683918a - reintroduced .note.GNU-stack section, as mentioned in prev commit
Tassilo Philipp
parents: 192
diff changeset
89 /* Use .note.GNU-stack to explicitly indicate a non-exec stack, b/c of bad */
03f0b683918a - reintroduced .note.GNU-stack section, as mentioned in prev commit
Tassilo Philipp
parents: 192
diff changeset
90 /* default behaviour when translating handwritten assembly files (needed on */
269
3581366858a6 - cleanups
Tassilo Philipp
parents: 268
diff changeset
91 /* GNU platforms, Android and FreeBSD, as tests have shown). */
268
03f0b683918a - reintroduced .note.GNU-stack section, as mentioned in prev commit
Tassilo Philipp
parents: 192
diff changeset
92 #if (defined(DC__C_CLANG) || defined(DC__C_GNU)) && defined(__ELF__) && (defined(DC__OS_Linux) || defined(DC__OS_FreeBSD))
03f0b683918a - reintroduced .note.GNU-stack section, as mentioned in prev commit
Tassilo Philipp
parents: 192
diff changeset
93 .section .note.GNU-stack,"",%progbits
03f0b683918a - reintroduced .note.GNU-stack section, as mentioned in prev commit
Tassilo Philipp
parents: 192
diff changeset
94 #endif
03f0b683918a - reintroduced .note.GNU-stack section, as mentioned in prev commit
Tassilo Philipp
parents: 192
diff changeset
95