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

Side by Side Diff: runtime/vm/unit_test.h

Issue 2452453002: Support unaligned integer loads on ARM and MIPS. (Closed)
Patch Set: review Created 4 years, 1 month 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 | « runtime/vm/kernel_to_il.cc ('k') | tests/language/vm/unaligned_access_literal_index_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef RUNTIME_VM_UNIT_TEST_H_ 5 #ifndef RUNTIME_VM_UNIT_TEST_H_
6 #define RUNTIME_VM_UNIT_TEST_H_ 6 #define RUNTIME_VM_UNIT_TEST_H_
7 7
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 9
10 #include "platform/globals.h" 10 #include "platform/globals.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 #define EXECUTE_TEST_CODE_INT64_LL(name, entry, long_arg0, long_arg1) \ 167 #define EXECUTE_TEST_CODE_INT64_LL(name, entry, long_arg0, long_arg1) \
168 reinterpret_cast<name>(entry)(long_arg0, long_arg1) 168 reinterpret_cast<name>(entry)(long_arg0, long_arg1)
169 #define EXECUTE_TEST_CODE_FLOAT(name, entry) reinterpret_cast<name>(entry)() 169 #define EXECUTE_TEST_CODE_FLOAT(name, entry) reinterpret_cast<name>(entry)()
170 #define EXECUTE_TEST_CODE_DOUBLE(name, entry) reinterpret_cast<name>(entry)() 170 #define EXECUTE_TEST_CODE_DOUBLE(name, entry) reinterpret_cast<name>(entry)()
171 #define EXECUTE_TEST_CODE_INT32_F(name, entry, float_arg) \ 171 #define EXECUTE_TEST_CODE_INT32_F(name, entry, float_arg) \
172 reinterpret_cast<name>(entry)(float_arg) 172 reinterpret_cast<name>(entry)(float_arg)
173 #define EXECUTE_TEST_CODE_INT32_D(name, entry, double_arg) \ 173 #define EXECUTE_TEST_CODE_INT32_D(name, entry, double_arg) \
174 reinterpret_cast<name>(entry)(double_arg) 174 reinterpret_cast<name>(entry)(double_arg)
175 #define EXECUTE_TEST_CODE_INTPTR_INTPTR(name, entry, pointer_arg) \ 175 #define EXECUTE_TEST_CODE_INTPTR_INTPTR(name, entry, pointer_arg) \
176 reinterpret_cast<name>(entry)(pointer_arg) 176 reinterpret_cast<name>(entry)(pointer_arg)
177 #define EXECUTE_TEST_CODE_INT32_INTPTR(name, entry, pointer_arg) \
178 reinterpret_cast<name>(entry)(pointer_arg)
177 #else 179 #else
178 // Not running on ARM or MIPS hardware, call simulator to execute code. 180 // Not running on ARM or MIPS hardware, call simulator to execute code.
179 #if defined(ARCH_IS_64_BIT) 181 #if defined(ARCH_IS_64_BIT)
180 // TODO(zra): Supply more macros for 64-bit as tests are added for ARM64.
181 #define EXECUTE_TEST_CODE_INT64(name, entry) \ 182 #define EXECUTE_TEST_CODE_INT64(name, entry) \
182 static_cast<int64_t>(Simulator::Current()->Call( \ 183 static_cast<int64_t>(Simulator::Current()->Call( \
183 bit_cast<int64_t, uword>(entry), 0, 0, 0, 0)) 184 bit_cast<int64_t, uword>(entry), 0, 0, 0, 0))
184 #define EXECUTE_TEST_CODE_DOUBLE(name, entry) \ 185 #define EXECUTE_TEST_CODE_DOUBLE(name, entry) \
185 bit_cast<double, int64_t>(Simulator::Current()->Call( \ 186 bit_cast<double, int64_t>(Simulator::Current()->Call( \
186 bit_cast<int64_t, uword>(entry), 0, 0, 0, 0, true)) 187 bit_cast<int64_t, uword>(entry), 0, 0, 0, 0, true))
187 #define EXECUTE_TEST_CODE_INTPTR_INTPTR(name, entry, pointer_arg) \ 188 #define EXECUTE_TEST_CODE_INTPTR_INTPTR(name, entry, pointer_arg) \
188 static_cast<intptr_t>(Simulator::Current()->Call( \ 189 static_cast<intptr_t>(Simulator::Current()->Call( \
189 bit_cast<int64_t, uword>(entry), \ 190 bit_cast<int64_t, uword>(entry), \
190 bit_cast<int64_t, intptr_t>(pointer_arg), \ 191 bit_cast<int64_t, intptr_t>(pointer_arg), \
191 0, 0, 0)) 192 0, 0, 0))
193 #define EXECUTE_TEST_CODE_INT32_INTPTR(name, entry, pointer_arg) \
194 static_cast<int32_t>(Simulator::Current()->Call( \
195 bit_cast<int64_t, uword>(entry), \
196 bit_cast<int64_t, intptr_t>(pointer_arg), \
197 0, 0, 0))
192 #else 198 #else
193 #define EXECUTE_TEST_CODE_INT32(name, entry) \ 199 #define EXECUTE_TEST_CODE_INT32(name, entry) \
194 static_cast<int32_t>(Simulator::Current()->Call( \ 200 static_cast<int32_t>(Simulator::Current()->Call( \
195 bit_cast<int32_t, uword>(entry), 0, 0, 0, 0)) 201 bit_cast<int32_t, uword>(entry), 0, 0, 0, 0))
196 #define EXECUTE_TEST_CODE_DOUBLE(name, entry) \ 202 #define EXECUTE_TEST_CODE_DOUBLE(name, entry) \
197 bit_cast<double, int64_t>(Simulator::Current()->Call( \ 203 bit_cast<double, int64_t>(Simulator::Current()->Call( \
198 bit_cast<int32_t, uword>(entry), 0, 0, 0, 0, true)) 204 bit_cast<int32_t, uword>(entry), 0, 0, 0, 0, true))
199 #define EXECUTE_TEST_CODE_INTPTR_INTPTR(name, entry, pointer_arg) \ 205 #define EXECUTE_TEST_CODE_INTPTR_INTPTR(name, entry, pointer_arg) \
200 static_cast<intptr_t>(Simulator::Current()->Call( \ 206 static_cast<intptr_t>(Simulator::Current()->Call( \
201 bit_cast<int32_t, uword>(entry), \ 207 bit_cast<int32_t, uword>(entry), \
202 bit_cast<int32_t, intptr_t>(pointer_arg), \ 208 bit_cast<int32_t, intptr_t>(pointer_arg), \
203 0, 0, 0)) 209 0, 0, 0))
210 #define EXECUTE_TEST_CODE_INT32_INTPTR(name, entry, pointer_arg) \
211 static_cast<int32_t>(Simulator::Current()->Call( \
212 bit_cast<int32_t, uword>(entry), \
213 bit_cast<int32_t, intptr_t>(pointer_arg), \
214 0, 0, 0))
204 #endif // defined(ARCH_IS_64_BIT) 215 #endif // defined(ARCH_IS_64_BIT)
205 #define EXECUTE_TEST_CODE_INT64_LL(name, entry, long_arg0, long_arg1) \ 216 #define EXECUTE_TEST_CODE_INT64_LL(name, entry, long_arg0, long_arg1) \
206 static_cast<int64_t>(Simulator::Current()->Call( \ 217 static_cast<int64_t>(Simulator::Current()->Call( \
207 bit_cast<int32_t, uword>(entry), \ 218 bit_cast<int32_t, uword>(entry), \
208 Utils::Low32Bits(long_arg0), \ 219 Utils::Low32Bits(long_arg0), \
209 Utils::High32Bits(long_arg0), \ 220 Utils::High32Bits(long_arg0), \
210 Utils::Low32Bits(long_arg1), \ 221 Utils::Low32Bits(long_arg1), \
211 Utils::High32Bits(long_arg1))) 222 Utils::High32Bits(long_arg1)))
212 #define EXECUTE_TEST_CODE_FLOAT(name, entry) \ 223 #define EXECUTE_TEST_CODE_FLOAT(name, entry) \
213 bit_cast<float, int32_t>(Simulator::Current()->Call( \ 224 bit_cast<float, int32_t>(Simulator::Current()->Call( \
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 } 624 }
614 625
615 private: 626 private:
616 T* flag_; 627 T* flag_;
617 T original_value_; 628 T original_value_;
618 }; 629 };
619 630
620 } // namespace dart 631 } // namespace dart
621 632
622 #endif // RUNTIME_VM_UNIT_TEST_H_ 633 #endif // RUNTIME_VM_UNIT_TEST_H_
OLDNEW
« no previous file with comments | « runtime/vm/kernel_to_il.cc ('k') | tests/language/vm/unaligned_access_literal_index_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698