OLD | NEW |
1 //===- subzero/crosstest/test_calling_conv.cpp - Implementation for tests -===// | 1 //===- subzero/crosstest/test_calling_conv.cpp - Implementation for tests -===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines the test functions used to check that Subzero | 10 // This file defines the test functions used to check that Subzero |
(...skipping 18 matching lines...) Expand all Loading... |
29 void caller_vvvvv(void) { | 29 void caller_vvvvv(void) { |
30 v4si32 arg1 = {0, 1, 2, 3}; | 30 v4si32 arg1 = {0, 1, 2, 3}; |
31 v4si32 arg2 = {4, 5, 6, 7}; | 31 v4si32 arg2 = {4, 5, 6, 7}; |
32 v4si32 arg3 = {8, 9, 10, 11}; | 32 v4si32 arg3 = {8, 9, 10, 11}; |
33 v4si32 arg4 = {12, 13, 14, 15}; | 33 v4si32 arg4 = {12, 13, 14, 15}; |
34 v4si32 arg5 = {16, 17, 18, 19}; | 34 v4si32 arg5 = {16, 17, 18, 19}; |
35 | 35 |
36 CALL_AS_TYPE(callee_vvvvv_Ty, Callee)(arg1, arg2, arg3, arg4, arg5); | 36 CALL_AS_TYPE(callee_vvvvv_Ty, Callee)(arg1, arg2, arg3, arg4, arg5); |
37 } | 37 } |
38 | 38 |
39 void caller_vlvlivfvdviv(void) { | 39 void caller_vlvilvfvdviv(void) { |
40 v4f32 arg1 = {0, 1, 2, 3}; | 40 v4f32 arg1 = {0, 1, 2, 3}; |
41 int64 arg2 = 4; | 41 int64 arg2 = 4; |
42 v4f32 arg3 = {6, 7, 8, 9}; | 42 v4f32 arg3 = {6, 7, 8, 9}; |
43 int64 arg4 = 10; | 43 int arg4 = 10; |
44 int arg5 = 11; | 44 int64 arg5 = 11; |
45 v4f32 arg6 = {12, 13, 14, 15}; | 45 v4f32 arg6 = {12, 13, 14, 15}; |
46 float arg7 = 16; | 46 float arg7 = 16; |
47 v4f32 arg8 = {17, 18, 19, 20}; | 47 v4f32 arg8 = {17, 18, 19, 20}; |
48 double arg9 = 21; | 48 double arg9 = 21; |
49 v4f32 arg10 = {22, 23, 24, 25}; | 49 v4f32 arg10 = {22, 23, 24, 25}; |
50 int arg11 = 26; | 50 int arg11 = 26; |
51 v4f32 arg12 = {27, 28, 29, 30}; | 51 v4f32 arg12 = {27, 28, 29, 30}; |
52 | 52 |
53 CALL_AS_TYPE(callee_vlvlivfvdviv_Ty, Callee)(arg1, arg2, arg3, arg4, arg5, | 53 CALL_AS_TYPE(callee_vlvilvfvdviv_Ty, Callee)(arg1, arg2, arg3, arg4, arg5, |
54 arg6, arg7, arg8, arg9, arg10, | 54 arg6, arg7, arg8, arg9, arg10, |
55 arg11, arg12); | 55 arg11, arg12); |
56 } | 56 } |
57 | 57 |
58 #define HANDLE_ARG(ARGNUM) \ | 58 #define HANDLE_ARG(ARGNUM) \ |
59 case ARGNUM: \ | 59 case ARGNUM: \ |
60 memcpy(&Buf[0], &arg##ARGNUM, sizeof(arg##ARGNUM)); \ | 60 memcpy(&Buf[0], &arg##ARGNUM, sizeof(arg##ARGNUM)); \ |
61 break; | 61 break; |
62 | 62 |
63 void __attribute__((noinline)) callee_i(int arg1) { | 63 void __attribute__((noinline)) callee_i(int arg1) { |
64 switch (ArgNum) { HANDLE_ARG(1); } | 64 switch (ArgNum) { HANDLE_ARG(1); } |
65 } | 65 } |
66 | 66 |
67 void __attribute__((noinline)) | 67 void __attribute__((noinline)) |
68 callee_vvvvv(v4si32 arg1, v4si32 arg2, v4si32 arg3, v4si32 arg4, v4si32 arg5) { | 68 callee_vvvvv(v4si32 arg1, v4si32 arg2, v4si32 arg3, v4si32 arg4, v4si32 arg5) { |
| 69 #ifndef ARM32 |
| 70 // TODO(jpp): remove this once vector support is implemented. |
69 switch (ArgNum) { | 71 switch (ArgNum) { |
70 HANDLE_ARG(1); | 72 HANDLE_ARG(1); |
71 HANDLE_ARG(2); | 73 HANDLE_ARG(2); |
72 HANDLE_ARG(3); | 74 HANDLE_ARG(3); |
73 HANDLE_ARG(4); | 75 HANDLE_ARG(4); |
74 HANDLE_ARG(5); | 76 HANDLE_ARG(5); |
75 } | 77 } |
| 78 #endif // ARM32 |
76 } | 79 } |
77 | 80 |
78 void __attribute__((noinline)) | 81 void __attribute__((noinline)) |
79 callee_vlvlivfvdviv(v4f32 arg1, int64 arg2, v4f32 arg3, int64 arg4, int arg5, | 82 callee_vlvilvfvdviv(v4f32 arg1, int64 arg2, v4f32 arg3, int arg4, int64 arg5, |
80 v4f32 arg6, float arg7, v4f32 arg8, double arg9, | 83 v4f32 arg6, float arg7, v4f32 arg8, double arg9, |
81 v4f32 arg10, int arg11, v4f32 arg12) { | 84 v4f32 arg10, int arg11, v4f32 arg12) { |
82 switch (ArgNum) { | 85 switch (ArgNum) { |
| 86 #ifndef ARM32 |
| 87 // TODO(jpp): remove this once vector support is implemented. |
83 HANDLE_ARG(1); | 88 HANDLE_ARG(1); |
| 89 HANDLE_ARG(3); |
| 90 HANDLE_ARG(6); |
| 91 HANDLE_ARG(8); |
| 92 HANDLE_ARG(10); |
| 93 HANDLE_ARG(12); |
| 94 #endif // ARM32 |
84 HANDLE_ARG(2); | 95 HANDLE_ARG(2); |
85 HANDLE_ARG(3); | |
86 HANDLE_ARG(4); | 96 HANDLE_ARG(4); |
87 HANDLE_ARG(5); | 97 HANDLE_ARG(5); |
88 HANDLE_ARG(6); | |
89 HANDLE_ARG(7); | 98 HANDLE_ARG(7); |
90 HANDLE_ARG(8); | |
91 HANDLE_ARG(9); | 99 HANDLE_ARG(9); |
92 HANDLE_ARG(10); | |
93 HANDLE_ARG(11); | 100 HANDLE_ARG(11); |
94 HANDLE_ARG(12); | |
95 } | 101 } |
96 } | 102 } |
OLD | NEW |