Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: crosstest/test_calling_conv.cpp

Issue 1273153002: Subzero. Native 64-bit int arithmetic on x86-64. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fixes tests & make format Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « crosstest/test_calling_conv.h ('k') | crosstest/test_calling_conv_main.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 // generates code compatible with the calling convention used by 11 // generates code compatible with the calling convention used by
12 // llc. "Caller" functions test the handling of out-args, and "callee" 12 // llc. "Caller" functions test the handling of out-args, and "callee"
13 // functions test the handling of in-args. 13 // functions test the handling of in-args.
14 // 14 //
15 //===----------------------------------------------------------------------===// 15 //===----------------------------------------------------------------------===//
16 16
17 #include <cstring> 17 #include <cstring>
18 18
19 #include "test_calling_conv.h" 19 #include "test_calling_conv.h"
20 #include "xdefs.h"
20 21
21 #define CALL_AS_TYPE(Ty, Func) (reinterpret_cast<Ty *>(Func)) 22 #define CALL_AS_TYPE(Ty, Func) (reinterpret_cast<Ty *>(Func))
22 23
23 void caller_i(void) { 24 void caller_i(void) {
24 int arg1 = 0x12345678; 25 int arg1 = 0x12345678;
25 CALL_AS_TYPE(callee_i_Ty, Callee)(arg1); 26 CALL_AS_TYPE(callee_i_Ty, Callee)(arg1);
26 } 27 }
27 28
28 void caller_vvvvv(void) { 29 void caller_vvvvv(void) {
29 v4si32 arg1 = {0, 1, 2, 3}; 30 v4si32 arg1 = {0, 1, 2, 3};
30 v4si32 arg2 = {4, 5, 6, 7}; 31 v4si32 arg2 = {4, 5, 6, 7};
31 v4si32 arg3 = {8, 9, 10, 11}; 32 v4si32 arg3 = {8, 9, 10, 11};
32 v4si32 arg4 = {12, 13, 14, 15}; 33 v4si32 arg4 = {12, 13, 14, 15};
33 v4si32 arg5 = {16, 17, 18, 19}; 34 v4si32 arg5 = {16, 17, 18, 19};
34 35
35 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);
36 } 37 }
37 38
38 void caller_vlvlivfvdviv(void) { 39 void caller_vlvlivfvdviv(void) {
39 v4f32 arg1 = {0, 1, 2, 3}; 40 v4f32 arg1 = {0, 1, 2, 3};
40 int64_t arg2 = 4; 41 int64 arg2 = 4;
41 v4f32 arg3 = {6, 7, 8, 9}; 42 v4f32 arg3 = {6, 7, 8, 9};
42 int64_t arg4 = 10; 43 int64 arg4 = 10;
43 int arg5 = 11; 44 int arg5 = 11;
44 v4f32 arg6 = {12, 13, 14, 15}; 45 v4f32 arg6 = {12, 13, 14, 15};
45 float arg7 = 16; 46 float arg7 = 16;
46 v4f32 arg8 = {17, 18, 19, 20}; 47 v4f32 arg8 = {17, 18, 19, 20};
47 double arg9 = 21; 48 double arg9 = 21;
48 v4f32 arg10 = {22, 23, 24, 25}; 49 v4f32 arg10 = {22, 23, 24, 25};
49 int arg11 = 26; 50 int arg11 = 26;
50 v4f32 arg12 = {27, 28, 29, 30}; 51 v4f32 arg12 = {27, 28, 29, 30};
51 52
52 CALL_AS_TYPE(callee_vlvlivfvdviv_Ty, Callee)(arg1, arg2, arg3, arg4, arg5, 53 CALL_AS_TYPE(callee_vlvlivfvdviv_Ty, Callee)(arg1, arg2, arg3, arg4, arg5,
(...skipping 15 matching lines...) Expand all
68 switch (ArgNum) { 69 switch (ArgNum) {
69 HANDLE_ARG(1); 70 HANDLE_ARG(1);
70 HANDLE_ARG(2); 71 HANDLE_ARG(2);
71 HANDLE_ARG(3); 72 HANDLE_ARG(3);
72 HANDLE_ARG(4); 73 HANDLE_ARG(4);
73 HANDLE_ARG(5); 74 HANDLE_ARG(5);
74 } 75 }
75 } 76 }
76 77
77 void __attribute__((noinline)) 78 void __attribute__((noinline))
78 callee_vlvlivfvdviv(v4f32 arg1, int64_t arg2, v4f32 arg3, int64_t arg4, 79 callee_vlvlivfvdviv(v4f32 arg1, int64 arg2, v4f32 arg3, int64 arg4, int arg5,
79 int arg5, v4f32 arg6, float arg7, v4f32 arg8, double arg9, 80 v4f32 arg6, float arg7, v4f32 arg8, double arg9,
80 v4f32 arg10, int arg11, v4f32 arg12) { 81 v4f32 arg10, int arg11, v4f32 arg12) {
81 switch (ArgNum) { 82 switch (ArgNum) {
82 HANDLE_ARG(1); 83 HANDLE_ARG(1);
83 HANDLE_ARG(2); 84 HANDLE_ARG(2);
84 HANDLE_ARG(3); 85 HANDLE_ARG(3);
85 HANDLE_ARG(4); 86 HANDLE_ARG(4);
86 HANDLE_ARG(5); 87 HANDLE_ARG(5);
87 HANDLE_ARG(6); 88 HANDLE_ARG(6);
88 HANDLE_ARG(7); 89 HANDLE_ARG(7);
89 HANDLE_ARG(8); 90 HANDLE_ARG(8);
90 HANDLE_ARG(9); 91 HANDLE_ARG(9);
91 HANDLE_ARG(10); 92 HANDLE_ARG(10);
92 HANDLE_ARG(11); 93 HANDLE_ARG(11);
93 HANDLE_ARG(12); 94 HANDLE_ARG(12);
94 } 95 }
95 } 96 }
OLDNEW
« no previous file with comments | « crosstest/test_calling_conv.h ('k') | crosstest/test_calling_conv_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698