OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_MIPS_CONSTANTS_H_ | 5 #ifndef V8_MIPS_CONSTANTS_H_ |
6 #define V8_MIPS_CONSTANTS_H_ | 6 #define V8_MIPS_CONSTANTS_H_ |
7 #include "src/globals.h" | 7 #include "src/globals.h" |
8 // UNIMPLEMENTED_ macro for MIPS. | 8 // UNIMPLEMENTED_ macro for MIPS. |
9 #ifdef DEBUG | 9 #ifdef DEBUG |
10 #define UNIMPLEMENTED_MIPS() \ | 10 #define UNIMPLEMENTED_MIPS() \ |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 kFP32, | 57 kFP32, |
58 kFP64, | 58 kFP64, |
59 kFPXX | 59 kFPXX |
60 }; | 60 }; |
61 | 61 |
62 #if defined(FPU_MODE_FP32) | 62 #if defined(FPU_MODE_FP32) |
63 static const FpuMode kFpuMode = kFP32; | 63 static const FpuMode kFpuMode = kFP32; |
64 #elif defined(FPU_MODE_FP64) | 64 #elif defined(FPU_MODE_FP64) |
65 static const FpuMode kFpuMode = kFP64; | 65 static const FpuMode kFpuMode = kFP64; |
66 #elif defined(FPU_MODE_FPXX) | 66 #elif defined(FPU_MODE_FPXX) |
67 #if defined(_MIPS_ARCH_MIPS32R2) || defined(_MIPS_ARCH_MIPS32R6) | 67 static const FpuMode kFpuMode = kFPXX; |
68 static const FpuMode kFpuMode = kFPXX; | |
69 #else | 68 #else |
70 #error "FPXX is supported only on Mips32R2 and Mips32R6" | 69 static const FpuMode kFpuMode = kFP32; |
71 #endif | |
72 #else | |
73 static const FpuMode kFpuMode = kFP32; | |
74 #endif | 70 #endif |
75 | 71 |
76 #if(defined(__mips_hard_float) && __mips_hard_float != 0) | 72 #if(defined(__mips_hard_float) && __mips_hard_float != 0) |
77 // Use floating-point coprocessor instructions. This flag is raised when | 73 // Use floating-point coprocessor instructions. This flag is raised when |
78 // -mhard-float is passed to the compiler. | 74 // -mhard-float is passed to the compiler. |
79 const bool IsMipsSoftFloatABI = false; | 75 const bool IsMipsSoftFloatABI = false; |
80 #elif(defined(__mips_soft_float) && __mips_soft_float != 0) | 76 #elif(defined(__mips_soft_float) && __mips_soft_float != 0) |
81 // This flag is raised when -msoft-float is passed to the compiler. | 77 // This flag is raised when -msoft-float is passed to the compiler. |
82 // Although FPU is a base requirement for v8, soft-float ABI is used | 78 // Although FPU is a base requirement for v8, soft-float ABI is used |
83 // on soft-float systems with FPU kernel emulation. | 79 // on soft-float systems with FPU kernel emulation. |
84 const bool IsMipsSoftFloatABI = true; | 80 const bool IsMipsSoftFloatABI = true; |
85 #else | 81 #else |
86 const bool IsMipsSoftFloatABI = true; | 82 const bool IsMipsSoftFloatABI = true; |
87 #endif | 83 #endif |
88 | 84 |
89 #if defined(V8_TARGET_LITTLE_ENDIAN) | 85 #if defined(V8_TARGET_LITTLE_ENDIAN) |
90 const uint32_t kHoleNanUpper32Offset = 4; | 86 const uint32_t kHoleNanUpper32Offset = 4; |
91 const uint32_t kHoleNanLower32Offset = 0; | 87 const uint32_t kHoleNanLower32Offset = 0; |
92 #elif defined(V8_TARGET_BIG_ENDIAN) | 88 #elif defined(V8_TARGET_BIG_ENDIAN) |
93 const uint32_t kHoleNanUpper32Offset = 0; | 89 const uint32_t kHoleNanUpper32Offset = 0; |
94 const uint32_t kHoleNanLower32Offset = 4; | 90 const uint32_t kHoleNanLower32Offset = 4; |
95 #else | 91 #else |
96 #error Unknown endianness | 92 #error Unknown endianness |
97 #endif | 93 #endif |
98 | 94 |
99 #define IsFp64Mode() (kFpuMode == kFP64) | 95 #ifndef FPU_MODE_FPXX |
100 #define IsFp32Mode() (kFpuMode == kFP32) | 96 #define IsFp64Mode() \ |
101 #define IsFpxxMode() (kFpuMode == kFPXX) | 97 (kFpuMode == kFP64) |
| 98 #else |
| 99 #define IsFp64Mode() \ |
| 100 (CpuFeatures::IsSupported(FP64FPU)) |
| 101 #endif |
102 | 102 |
103 #ifndef _MIPS_ARCH_MIPS32RX | 103 #ifndef _MIPS_ARCH_MIPS32RX |
104 #define IsMipsArchVariant(check) \ | 104 #define IsMipsArchVariant(check) \ |
105 (kArchVariant == check) | 105 (kArchVariant == check) |
106 #else | 106 #else |
107 #define IsMipsArchVariant(check) \ | 107 #define IsMipsArchVariant(check) \ |
108 (CpuFeatures::IsSupported(static_cast<CpuFeature>(check))) | 108 (CpuFeatures::IsSupported(static_cast<CpuFeature>(check))) |
109 #endif | 109 #endif |
110 | 110 |
111 | 111 |
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 } | 1217 } |
1218 } | 1218 } |
1219 } | 1219 } |
1220 | 1220 |
1221 #undef OpcodeToBitNumber | 1221 #undef OpcodeToBitNumber |
1222 #undef FunctionFieldToBitNumber | 1222 #undef FunctionFieldToBitNumber |
1223 } // namespace internal | 1223 } // namespace internal |
1224 } // namespace v8 | 1224 } // namespace v8 |
1225 | 1225 |
1226 #endif // #ifndef V8_MIPS_CONSTANTS_H_ | 1226 #endif // #ifndef V8_MIPS_CONSTANTS_H_ |
OLD | NEW |