Chromium Code Reviews| 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_ARM) |
|
regis
2013/07/12 22:16:01
It looks like TARGET_ARCH_ARM is not special anymo
zra
2013/07/12 23:22:18
Done.
| |
| 127 #define kFpuRegisterSize 16 | |
| 128 typedef simd128_value_t fpu_register_t; | |
| 129 #elif defined(TARGET_ARCH_MIPS) | |
| 127 #define kFpuRegisterSize 8 | 130 #define kFpuRegisterSize 8 |
| 128 typedef double fpu_register_t; | 131 typedef double fpu_register_t; |
| 129 #else | 132 #else |
| 130 #define kFpuRegisterSize 16 | 133 #define kFpuRegisterSize 16 |
| 131 typedef simd128_value_t fpu_register_t; | 134 typedef simd128_value_t fpu_register_t; |
| 132 #endif | 135 #endif |
| 133 #elif defined(__ARMEL__) | 136 #elif defined(__ARMEL__) |
| 134 #define HOST_ARCH_ARM 1 | 137 #define HOST_ARCH_ARM 1 |
| 135 #define ARCH_IS_32_BIT 1 | 138 #define ARCH_IS_32_BIT 1 |
| 136 #define kFpuRegisterSize 8 | 139 #define kFpuRegisterSize 16 |
| 137 typedef double fpu_register_t; | |
| 138 typedef struct { | 140 typedef struct { |
| 139 union { | 141 union { |
| 140 uint32_t u; | 142 uint32_t u; |
| 141 float f; | 143 float f; |
| 142 } data_[4]; | 144 } data_[4]; |
| 143 } simd_value_t; | 145 } simd_value_t; |
| 146 typedef simd_value_t fpu_register_t; | |
| 144 #define simd_value_safe_load(addr) \ | 147 #define simd_value_safe_load(addr) \ |
| 145 (*reinterpret_cast<simd_value_t *>(addr)) | 148 (*reinterpret_cast<simd_value_t *>(addr)) |
| 146 #define simd_value_safe_store(addr, value) \ | 149 #define simd_value_safe_store(addr, value) \ |
| 147 do { \ | 150 do { \ |
| 148 reinterpret_cast<simd_value_t *>(addr)->data_[0] = value.data_[0]; \ | 151 reinterpret_cast<simd_value_t *>(addr)->data_[0] = value.data_[0]; \ |
| 149 reinterpret_cast<simd_value_t *>(addr)->data_[1] = value.data_[1]; \ | 152 reinterpret_cast<simd_value_t *>(addr)->data_[1] = value.data_[1]; \ |
| 150 reinterpret_cast<simd_value_t *>(addr)->data_[2] = value.data_[2]; \ | 153 reinterpret_cast<simd_value_t *>(addr)->data_[2] = value.data_[2]; \ |
| 151 reinterpret_cast<simd_value_t *>(addr)->data_[3] = value.data_[3]; \ | 154 reinterpret_cast<simd_value_t *>(addr)->data_[3] = value.data_[3]; \ |
| 152 } while (0) | 155 } while (0) |
| 153 | 156 |
| (...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 | 472 // N.B.: As the GCC manual states, "[s]ince non-static C++ methods |
| 470 // have an implicit 'this' argument, the arguments of such methods | 473 // have an implicit 'this' argument, the arguments of such methods |
| 471 // should be counted from two, not one." | 474 // should be counted from two, not one." |
| 472 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ | 475 #define PRINTF_ATTRIBUTE(string_index, first_to_check) \ |
| 473 __attribute__((__format__(__printf__, string_index, first_to_check))) | 476 __attribute__((__format__(__printf__, string_index, first_to_check))) |
| 474 #else | 477 #else |
| 475 #define PRINTF_ATTRIBUTE(string_index, first_to_check) | 478 #define PRINTF_ATTRIBUTE(string_index, first_to_check) |
| 476 #endif | 479 #endif |
| 477 | 480 |
| 478 #endif // PLATFORM_GLOBALS_H_ | 481 #endif // PLATFORM_GLOBALS_H_ |
| OLD | NEW |