OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 PLATFORM_GLOBALS_H_ | 5 #ifndef PLATFORM_GLOBALS_H_ |
6 #define PLATFORM_GLOBALS_H_ | 6 #define PLATFORM_GLOBALS_H_ |
7 | 7 |
8 // __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to | 8 // __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to |
9 // enable platform independent printf format specifiers. | 9 // enable platform independent printf format specifiers. |
10 #ifndef __STDC_FORMAT_MACROS | 10 #ifndef __STDC_FORMAT_MACROS |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 #elif defined(_M_IX86) || defined(__i386__) | 123 #elif defined(_M_IX86) || defined(__i386__) |
124 #define HOST_ARCH_IA32 1 | 124 #define HOST_ARCH_IA32 1 |
125 #define ARCH_IS_32_BIT 1 | 125 #define ARCH_IS_32_BIT 1 |
126 #define kFpuRegisterSize 16 | 126 #define kFpuRegisterSize 16 |
127 typedef simd128_value_t fpu_register_t; | 127 typedef simd128_value_t fpu_register_t; |
128 #elif defined(__ARMEL__) | 128 #elif defined(__ARMEL__) |
129 #define HOST_ARCH_ARM 1 | 129 #define HOST_ARCH_ARM 1 |
130 #define ARCH_IS_32_BIT 1 | 130 #define ARCH_IS_32_BIT 1 |
131 #define kFpuRegisterSize 8 | 131 #define kFpuRegisterSize 8 |
132 typedef double fpu_register_t; | 132 typedef double fpu_register_t; |
| 133 typedef struct { |
| 134 union { |
| 135 uint32_t u; |
| 136 float f; |
| 137 } data_[4]; |
| 138 } simd_value_t; |
| 139 #define simd_value_safe_load(addr) \ |
| 140 (*reinterpret_cast<simd_value_t *>(addr)) |
| 141 #define simd_value_safe_store(addr, value) \ |
| 142 do { \ |
| 143 reinterpret_cast<simd_value_t *>(addr)->data_[0] = value.data_[0]; \ |
| 144 reinterpret_cast<simd_value_t *>(addr)->data_[1] = value.data_[1]; \ |
| 145 reinterpret_cast<simd_value_t *>(addr)->data_[2] = value.data_[2]; \ |
| 146 reinterpret_cast<simd_value_t *>(addr)->data_[3] = value.data_[3]; \ |
| 147 } while (0) |
| 148 |
133 #elif defined(__MIPSEL__) | 149 #elif defined(__MIPSEL__) |
134 #define HOST_ARCH_MIPS 1 | 150 #define HOST_ARCH_MIPS 1 |
135 #define ARCH_IS_32_BIT 1 | 151 #define ARCH_IS_32_BIT 1 |
136 #define kFpuRegisterSize 8 | 152 #define kFpuRegisterSize 8 |
137 typedef double fpu_register_t; | 153 typedef double fpu_register_t; |
138 #else | 154 #else |
139 #error Architecture was not detected as supported by Dart. | 155 #error Architecture was not detected as supported by Dart. |
140 #endif | 156 #endif |
141 | 157 |
142 // DART_FORCE_INLINE strongly hints to the compiler that a function should | 158 // DART_FORCE_INLINE strongly hints to the compiler that a function should |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 // N.B.: As the GCC manual states, "[s]ince non-static C++ methods | 464 // N.B.: As the GCC manual states, "[s]ince non-static C++ methods |
449 // have an implicit 'this' argument, the arguments of such methods | 465 // have an implicit 'this' argument, the arguments of such methods |
450 // should be counted from two, not one." | 466 // should be counted from two, not one." |
451 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ | 467 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ |
452 __attribute__((__format__(__printf__, string_index, first_to_check))) | 468 __attribute__((__format__(__printf__, string_index, first_to_check))) |
453 #else | 469 #else |
454 #define PRINTF_ATTRIBUTE(string_index, first_to_check) | 470 #define PRINTF_ATTRIBUTE(string_index, first_to_check) |
455 #endif | 471 #endif |
456 | 472 |
457 #endif // PLATFORM_GLOBALS_H_ | 473 #endif // PLATFORM_GLOBALS_H_ |
OLD | NEW |