| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // http://www.agner.org/optimize/calling_conventions.pdf | 116 // http://www.agner.org/optimize/calling_conventions.pdf |
| 117 // or with gcc, run: "echo | gcc -E -dM -" | 117 // or with gcc, run: "echo | gcc -E -dM -" |
| 118 #if defined(_M_X64) || defined(__x86_64__) | 118 #if defined(_M_X64) || defined(__x86_64__) |
| 119 #define HOST_ARCH_X64 1 | 119 #define HOST_ARCH_X64 1 |
| 120 #define ARCH_IS_64_BIT 1 | 120 #define ARCH_IS_64_BIT 1 |
| 121 #define kFpuRegisterSize 16 | 121 #define kFpuRegisterSize 16 |
| 122 typedef simd128_value_t fpu_register_t; | 122 typedef simd128_value_t fpu_register_t; |
| 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 #if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS) | 126 #if defined(TARGET_ARCH_MIPS) |
| 127 #define kFpuRegisterSize 8 | 127 #define kFpuRegisterSize 8 |
| 128 typedef double fpu_register_t; | 128 typedef double fpu_register_t; |
| 129 #else | 129 #else |
| 130 #define kFpuRegisterSize 16 | 130 #define kFpuRegisterSize 16 |
| 131 typedef simd128_value_t fpu_register_t; | 131 typedef simd128_value_t fpu_register_t; |
| 132 #endif | 132 #endif |
| 133 #elif defined(__ARMEL__) | 133 #elif defined(__ARMEL__) |
| 134 #define HOST_ARCH_ARM 1 | 134 #define HOST_ARCH_ARM 1 |
| 135 #define ARCH_IS_32_BIT 1 | 135 #define ARCH_IS_32_BIT 1 |
| 136 #define kFpuRegisterSize 8 | 136 #define kFpuRegisterSize 16 |
| 137 typedef double fpu_register_t; | |
| 138 typedef struct { | 137 typedef struct { |
| 139 union { | 138 union { |
| 140 uint32_t u; | 139 uint32_t u; |
| 141 float f; | 140 float f; |
| 142 } data_[4]; | 141 } data_[4]; |
| 143 } simd_value_t; | 142 } simd_value_t; |
| 143 typedef simd_value_t fpu_register_t; |
| 144 #define simd_value_safe_load(addr) \ | 144 #define simd_value_safe_load(addr) \ |
| 145 (*reinterpret_cast<simd_value_t *>(addr)) | 145 (*reinterpret_cast<simd_value_t *>(addr)) |
| 146 #define simd_value_safe_store(addr, value) \ | 146 #define simd_value_safe_store(addr, value) \ |
| 147 do { \ | 147 do { \ |
| 148 reinterpret_cast<simd_value_t *>(addr)->data_[0] = value.data_[0]; \ | 148 reinterpret_cast<simd_value_t *>(addr)->data_[0] = value.data_[0]; \ |
| 149 reinterpret_cast<simd_value_t *>(addr)->data_[1] = value.data_[1]; \ | 149 reinterpret_cast<simd_value_t *>(addr)->data_[1] = value.data_[1]; \ |
| 150 reinterpret_cast<simd_value_t *>(addr)->data_[2] = value.data_[2]; \ | 150 reinterpret_cast<simd_value_t *>(addr)->data_[2] = value.data_[2]; \ |
| 151 reinterpret_cast<simd_value_t *>(addr)->data_[3] = value.data_[3]; \ | 151 reinterpret_cast<simd_value_t *>(addr)->data_[3] = value.data_[3]; \ |
| 152 } while (0) | 152 } while (0) |
| 153 | 153 |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 // N.B.: As the GCC manual states, "[s]ince non-static C++ methods | 469 // N.B.: As the GCC manual states, "[s]ince non-static C++ methods |
| 470 // have an implicit 'this' argument, the arguments of such methods | 470 // have an implicit 'this' argument, the arguments of such methods |
| 471 // should be counted from two, not one." | 471 // should be counted from two, not one." |
| 472 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ | 472 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ |
| 473 __attribute__((__format__(__printf__, string_index, first_to_check))) | 473 __attribute__((__format__(__printf__, string_index, first_to_check))) |
| 474 #else | 474 #else |
| 475 #define PRINTF_ATTRIBUTE(string_index, first_to_check) | 475 #define PRINTF_ATTRIBUTE(string_index, first_to_check) |
| 476 #endif | 476 #endif |
| 477 | 477 |
| 478 #endif // PLATFORM_GLOBALS_H_ | 478 #endif // PLATFORM_GLOBALS_H_ |
| OLD | NEW |