annotate test/ellipsis/ellipsis.cc @ 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 85b7a117b807
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: test
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
5 File: test/ellipsis/ellipsis.cc
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6 Description:
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: 50
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 #include "config.h"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
29 #include "../../dyncall/dyncall.h"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
30 #include "../../dyncall/dyncall_value.h"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
31
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
32
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
33 #if defined(__SUNPRO_CC) || defined(__ANDROID__)
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
34 #include <stdarg.h>
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
35 #else
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
36 #include <cstdarg>
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
37 #endif
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
38
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
39 DCValue mValue[NARGS];
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
40
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
41 void clearValues() { for(int i = 0;i<NARGS;++i) mValue[i].L = 0xCAFEBABEDEADC0DEULL; }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
42
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
43 template<typename T> void g(T value, int pos);
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
44
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
45 template<> void g(DCchar value, int pos) { mValue[pos].c = value; }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
46 template<> void g(DCshort value, int pos) { mValue[pos].s = value; }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
47 template<> void g(DCint value, int pos) { mValue[pos].i = value; }
50
9bd3c5219505 - minor test code fix
cslag
parents: 0
diff changeset
48 template<> void g(DClong value, int pos) { mValue[pos].j = value; }
9bd3c5219505 - minor test code fix
cslag
parents: 0
diff changeset
49 template<> void g(DClonglong value, int pos) { mValue[pos].l = value; }
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
50 template<> void g(DCfloat value, int pos) { mValue[pos].f = value; }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
51 template<> void g(DCdouble value, int pos) { mValue[pos].d = value; }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
52 template<> void g(DCpointer value, int pos) { mValue[pos].p = value; }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
53
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
54 DCValue* getArg(int pos) { return &mValue[pos]; }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
55
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
56 int gID;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
57 int getId() { return gID; }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
58
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
59 extern "C" {
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
60
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
61 #define VF0(id,S) void S () {gID=id;}
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
62 #define VF1(id,A1,S) void S (A1 a1) {gID=id;g<A1>(a1,0);}
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
63 #define VF2(id,A1,A2,S) void S (A1 a1, ...) {va_list l;va_start(l,a1);gID=id;g<A1>(a1,0);g<A2>(va_arg(l,A2),1);va_end(l);}
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
64 #define VF3(id,A1,A2,A3,S) void S (A1 a1, ...) {va_list l;va_start(l,a1);gID=id;g<A1>(a1,0);g<A2>(va_arg(l,A2),1);g<A3>(va_arg(l,A3),2);va_end(l);}
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
65 #define VF4(id,A1,A2,A3,A4,S) void S (A1 a1, ...) {va_list l;va_start(l,a1);gID=id;g<A1>(a1,0);g<A2>(va_arg(l,A2),1);g<A3>(va_arg(l,A3),2);g<A4>(va_arg(l,A4),3);va_end(l);}
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
66 #define VF5(id,A1,A2,A3,A4,A5,S) void S (A1 a1, ...) {va_list l;va_start(l,a1);gID=id;g<A1>(a1,0);g<A2>(va_arg(l,A2),1);g<A3>(va_arg(l,A3),2);g<A4>(va_arg(l,A4),3);g<A5>(va_arg(l,A5),4);va_end(l);}
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
67 #define VF6(id,A1,A2,A3,A4,A5,A6,S) void S (A1 a1, ...) {va_list l;va_start(l,a1);gID=id;g<A1>(a1,0);g<A2>(va_arg(l,A2),1);g<A3>(va_arg(l,A3),2);g<A4>(va_arg(l,A4),3);g<A5>(va_arg(l,A5),4);g<A6>(va_arg(l,A6),5);va_end(l);}
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
68 #define VF7(id,A1,A2,A3,A4,A5,A6,A7,S) void S (A1 a1, ...) {va_list l;va_start(l,a1);gID=id;g<A1>(a1,0);g<A2>(va_arg(l,A2),1);g<A3>(va_arg(l,A3),2);g<A4>(va_arg(l,A4),3);g<A5>(va_arg(l,A5),4);g<A6>(va_arg(l,A6),5);g<A7>(va_arg(l,A7),6);va_end(l);}
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
69 #define VF8(id,A1,A2,A3,A4,A5,A6,A7,A8,S) void S (A1 a1, ...) {va_list l;va_start(l,a1);gID=id;g<A1>(a1,0);g<A2>(va_arg(l,A2),1);g<A3>(a3,2);g<A4>(a4,3);g<A5>(a5,4);g<A6>(a6,5);g<A7>(a7,6);g<A8>(a8,7);va_end(l);}
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
70 #define VF9(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,S) void S (A1 a1, ...) {va_list l;va_start(l,a1);gID=id;g<A1>(a1,0);g<A2>(va_arg(l,A2),1);g<A3>(a3,2);g<A4>(a4,3);g<A5>(a5,4);g<A6>(a6,5);g<A7>(a7,6);g<A8>(a8,7);g<A9>(a9,8);va_end(l);}
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
71 #define VF10(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,S) void S (A1 a1, ...) {va_list l;va_start(l,a1);gID=id;g<A1>(a1,0);g<A2>(va_arg(l,A2),1);g<A3>(a3,2);g<A4>(a4,3);g<A5>(a5,4);g<A6>(a6,5);g<A7>(a7,6);g<A8>(a8,7);g<A9>(a9,8);g<A10>(a10,9);va_end(l);}
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
72
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
73 #include "case.h"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
74
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
75 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
76
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
77 #undef VF0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
78 #undef VF1
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
79 #undef VF2
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
80 #undef VF3
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
81 #undef VF4
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
82 #undef VF5
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
83 #undef VF6
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
84 #undef VF7
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
85 #undef VF8
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
86 #undef VF9
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
87 #undef VF10
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
88
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
89 #define VF0(id,S) (void*)S,
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
90 #define VF1(id,A1,S) (void*)S,
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
91 #define VF2(id,A1,A2,S) (void*)S,
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
92 #define VF3(id,A1,A2,A3,S) (void*)S,
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
93 #define VF4(id,A1,A2,A3,A4,S) (void*)S,
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
94 #define VF5(id,A1,A2,A3,A4,A5,S) (void*)S,
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
95 #define VF6(id,A1,A2,A3,A4,A5,A6,S) (void*)S,
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
96 #define VF7(id,A1,A2,A3,A4,A5,A6,A7,S) (void*)S,
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
97 #define VF8(id,A1,A2,A3,A4,A5,A6,A7,A8,S) (void*)S,
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
98 #define VF9(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,S) (void*)S,
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
99 #define VF10(id,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,S) (void*)S,
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
100
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
101 DCpointer gFuncTable[] = {
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
102 #include "case.h"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
103 };
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
104
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
105 DCpointer getFunc(int x) {
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
106 return gFuncTable[x];
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
107 }