annotate dyncall/dyncall_value.h @ 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 f5577f6bf97a
children
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_value.h
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6 Description: Value variant type
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: 179
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 /*
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
28
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
29 dyncall value variant
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
30
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
31 a value variant union-type that carries all supported dyncall types.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
32
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
33 REVISION
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
34 2007/12/11 initial
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
35
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
36 */
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
37
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
38 #ifndef DYNCALL_VALUE_H
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
39 #define DYNCALL_VALUE_H
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
40
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
41 #include "dyncall_types.h"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
42
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
43 #ifdef __cplusplus
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
44 extern "C" {
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
45 #endif
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
46
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
47 typedef union DCValue_ DCValue;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
48
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
49 union DCValue_
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
50 {
126
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
51 /* dyncallback assembly pulls value directly from DCValue structs, without */
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
52 /* knowledge about types used, so lay it out as needed at compile time, here */
157
49549739228c - sparc callback asm and args code (still some stack alignment issues, currently)
cslag
parents: 134
diff changeset
53 #if defined(DC__Endian_BIG) && (defined(DC__Arch_PPC32) || defined(DC__Arch_MIPS) || defined(DC__Arch_Sparc))
126
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
54 DCbool B;
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
55 struct { DCchar c_pad[3]; DCchar c; };
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
56 struct { DCuchar C_pad[3]; DCuchar C; };
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
57 struct { DCshort s_pad; DCshort s; };
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
58 struct { DCshort S_pad; DCshort S; };
126
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
59 DCint i;
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
60 DCuint I;
179
b11b0735b09f - renamings: sparc_v9 -> sparc64
cslag
parents: 157
diff changeset
61 #elif defined(DC__Endian_BIG) && (defined(DC__Arch_PPC64) || defined(DC__Arch_MIPS64) || defined(DC__Arch_Sparc64))
7
7ca57dbefed4 - ppc64 update from Masanori
cslag
parents: 0
diff changeset
62 struct { DCbool B_pad; DCbool B; };
7ca57dbefed4 - ppc64 update from Masanori
cslag
parents: 0
diff changeset
63 struct { DCchar c_pad[7]; DCchar c; };
7ca57dbefed4 - ppc64 update from Masanori
cslag
parents: 0
diff changeset
64 struct { DCuchar C_pad[7]; DCuchar C; };
7ca57dbefed4 - ppc64 update from Masanori
cslag
parents: 0
diff changeset
65 struct { DCshort s_pad[3]; DCshort s; };
7ca57dbefed4 - ppc64 update from Masanori
cslag
parents: 0
diff changeset
66 struct { DCshort S_pad[3]; DCshort S; };
7ca57dbefed4 - ppc64 update from Masanori
cslag
parents: 0
diff changeset
67 struct { DCint i_pad; DCint i; };
7ca57dbefed4 - ppc64 update from Masanori
cslag
parents: 0
diff changeset
68 struct { DCint I_pad; DCuint I; };
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
69 #else
126
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
70 DCbool B;
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
71 DCchar c;
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
72 DCuchar C;
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
73 DCshort s;
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
74 DCushort S;
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
75 DCint i;
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
76 DCuint I;
7
7ca57dbefed4 - ppc64 update from Masanori
cslag
parents: 0
diff changeset
77 #endif
126
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
78 DClong j;
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
79 DCulong J;
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
80 DClonglong l;
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
81 DCulonglong L;
134
59d758760688 - mips o32 callback fixes for big endian platforms
cslag
parents: 126
diff changeset
82 /* floats on mips are right justified in fp-registers on big endian targets, as they aren't promoted */
59d758760688 - mips o32 callback fixes for big endian platforms
cslag
parents: 126
diff changeset
83 #if defined(DC__Endian_BIG) && (defined(DC__Arch_MIPS) || defined(DC__Arch_MIPS64))
126
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
84 struct { DCfloat f_pad; DCfloat f; };
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
85 #else
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
86 DCfloat f;
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
87 #endif
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
88 DCdouble d;
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
89 DCpointer p;
be08b699dca5 - mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
cslag
parents: 124
diff changeset
90 DCstring Z;
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
91 };
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
92
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
93 #ifdef __cplusplus
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
94 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
95 #endif
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
96
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
97 #endif /* DYNCALL_VALUE_H */
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
98