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 static const FpuMode kFpuMode = kFPXX; | 67 #if defined(_MIPS_ARCH_MIPS32R2) || defined(_MIPS_ARCH_MIPS32R6) |
| 68 static const FpuMode kFpuMode = kFPXX; |
68 #else | 69 #else |
69 static const FpuMode kFpuMode = kFP32; | 70 #error "FPXX is supported only on Mips32R2 and Mips32R6" |
| 71 #endif |
| 72 #else |
| 73 static const FpuMode kFpuMode = kFP32; |
70 #endif | 74 #endif |
71 | 75 |
72 #if(defined(__mips_hard_float) && __mips_hard_float != 0) | 76 #if(defined(__mips_hard_float) && __mips_hard_float != 0) |
73 // Use floating-point coprocessor instructions. This flag is raised when | 77 // Use floating-point coprocessor instructions. This flag is raised when |
74 // -mhard-float is passed to the compiler. | 78 // -mhard-float is passed to the compiler. |
75 const bool IsMipsSoftFloatABI = false; | 79 const bool IsMipsSoftFloatABI = false; |
76 #elif(defined(__mips_soft_float) && __mips_soft_float != 0) | 80 #elif(defined(__mips_soft_float) && __mips_soft_float != 0) |
77 // This flag is raised when -msoft-float is passed to the compiler. | 81 // This flag is raised when -msoft-float is passed to the compiler. |
78 // Although FPU is a base requirement for v8, soft-float ABI is used | 82 // Although FPU is a base requirement for v8, soft-float ABI is used |
79 // on soft-float systems with FPU kernel emulation. | 83 // on soft-float systems with FPU kernel emulation. |
80 const bool IsMipsSoftFloatABI = true; | 84 const bool IsMipsSoftFloatABI = true; |
81 #else | 85 #else |
82 const bool IsMipsSoftFloatABI = true; | 86 const bool IsMipsSoftFloatABI = true; |
83 #endif | 87 #endif |
84 | 88 |
85 #if defined(V8_TARGET_LITTLE_ENDIAN) | 89 #if defined(V8_TARGET_LITTLE_ENDIAN) |
86 const uint32_t kHoleNanUpper32Offset = 4; | 90 const uint32_t kHoleNanUpper32Offset = 4; |
87 const uint32_t kHoleNanLower32Offset = 0; | 91 const uint32_t kHoleNanLower32Offset = 0; |
88 #elif defined(V8_TARGET_BIG_ENDIAN) | 92 #elif defined(V8_TARGET_BIG_ENDIAN) |
89 const uint32_t kHoleNanUpper32Offset = 0; | 93 const uint32_t kHoleNanUpper32Offset = 0; |
90 const uint32_t kHoleNanLower32Offset = 4; | 94 const uint32_t kHoleNanLower32Offset = 4; |
91 #else | 95 #else |
92 #error Unknown endianness | 96 #error Unknown endianness |
93 #endif | 97 #endif |
94 | 98 |
95 #ifndef FPU_MODE_FPXX | 99 #define IsFp64Mode() (kFpuMode == kFP64) |
96 #define IsFp64Mode() \ | 100 #define IsFp32Mode() (kFpuMode == kFP32) |
97 (kFpuMode == kFP64) | 101 #define IsFpxxMode() (kFpuMode == kFPXX) |
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 |