OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2079 LoadRegPlusOffsetToAt(src); | 2079 LoadRegPlusOffsetToAt(src); |
2080 GenInstrImmediate(LWC1, at, fd, 0); | 2080 GenInstrImmediate(LWC1, at, fd, 0); |
2081 } | 2081 } |
2082 } | 2082 } |
2083 | 2083 |
2084 | 2084 |
2085 void Assembler::ldc1(FPURegister fd, const MemOperand& src) { | 2085 void Assembler::ldc1(FPURegister fd, const MemOperand& src) { |
2086 // Workaround for non-8-byte alignment of HeapNumber, convert 64-bit | 2086 // Workaround for non-8-byte alignment of HeapNumber, convert 64-bit |
2087 // load to two 32-bit loads. | 2087 // load to two 32-bit loads. |
2088 DCHECK(!src.rm().is(at)); | 2088 DCHECK(!src.rm().is(at)); |
2089 if (IsFp64Mode()) { | 2089 if (IsFp32Mode()) { // fp32 mode. |
2090 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | |
2091 GenInstrImmediate(LWC1, src.rm(), fd, | |
2092 src.offset_ + Register::kMantissaOffset); | |
2093 GenInstrImmediate(LW, src.rm(), at, | |
2094 src.offset_ + Register::kExponentOffset); | |
2095 mthc1(at, fd); | |
2096 } else { // Offset > 16 bits, use multiple instructions to load. | |
2097 LoadRegPlusOffsetToAt(src); | |
2098 GenInstrImmediate(LWC1, at, fd, Register::kMantissaOffset); | |
2099 GenInstrImmediate(LW, at, at, Register::kExponentOffset); | |
2100 mthc1(at, fd); | |
2101 } | |
2102 } else { // fp32 mode. | |
2103 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | 2090 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { |
2104 GenInstrImmediate(LWC1, src.rm(), fd, | 2091 GenInstrImmediate(LWC1, src.rm(), fd, |
2105 src.offset_ + Register::kMantissaOffset); | 2092 src.offset_ + Register::kMantissaOffset); |
2106 FPURegister nextfpreg; | 2093 FPURegister nextfpreg; |
2107 nextfpreg.setcode(fd.code() + 1); | 2094 nextfpreg.setcode(fd.code() + 1); |
2108 GenInstrImmediate(LWC1, src.rm(), nextfpreg, | 2095 GenInstrImmediate(LWC1, src.rm(), nextfpreg, |
2109 src.offset_ + Register::kExponentOffset); | 2096 src.offset_ + Register::kExponentOffset); |
2110 } else { // Offset > 16 bits, use multiple instructions to load. | 2097 } else { // Offset > 16 bits, use multiple instructions to load. |
2111 LoadRegPlusOffsetToAt(src); | 2098 LoadRegPlusOffsetToAt(src); |
2112 GenInstrImmediate(LWC1, at, fd, Register::kMantissaOffset); | 2099 GenInstrImmediate(LWC1, at, fd, Register::kMantissaOffset); |
2113 FPURegister nextfpreg; | 2100 FPURegister nextfpreg; |
2114 nextfpreg.setcode(fd.code() + 1); | 2101 nextfpreg.setcode(fd.code() + 1); |
2115 GenInstrImmediate(LWC1, at, nextfpreg, Register::kExponentOffset); | 2102 GenInstrImmediate(LWC1, at, nextfpreg, Register::kExponentOffset); |
2116 } | 2103 } |
| 2104 } else { |
| 2105 DCHECK(IsFp64Mode() || IsFpxxMode()); |
| 2106 // Currently we support FPXX and FP64 on Mips32r2 and Mips32r6 |
| 2107 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); |
| 2108 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { |
| 2109 GenInstrImmediate(LWC1, src.rm(), fd, |
| 2110 src.offset_ + Register::kMantissaOffset); |
| 2111 GenInstrImmediate(LW, src.rm(), at, |
| 2112 src.offset_ + Register::kExponentOffset); |
| 2113 mthc1(at, fd); |
| 2114 } else { // Offset > 16 bits, use multiple instructions to load. |
| 2115 LoadRegPlusOffsetToAt(src); |
| 2116 GenInstrImmediate(LWC1, at, fd, Register::kMantissaOffset); |
| 2117 GenInstrImmediate(LW, at, at, Register::kExponentOffset); |
| 2118 mthc1(at, fd); |
| 2119 } |
2117 } | 2120 } |
2118 } | 2121 } |
2119 | 2122 |
2120 | 2123 |
2121 void Assembler::swc1(FPURegister fd, const MemOperand& src) { | 2124 void Assembler::swc1(FPURegister fd, const MemOperand& src) { |
2122 if (is_int16(src.offset_)) { | 2125 if (is_int16(src.offset_)) { |
2123 GenInstrImmediate(SWC1, src.rm(), fd, src.offset_); | 2126 GenInstrImmediate(SWC1, src.rm(), fd, src.offset_); |
2124 } else { // Offset > 16 bits, use multiple instructions to load. | 2127 } else { // Offset > 16 bits, use multiple instructions to load. |
2125 LoadRegPlusOffsetToAt(src); | 2128 LoadRegPlusOffsetToAt(src); |
2126 GenInstrImmediate(SWC1, at, fd, 0); | 2129 GenInstrImmediate(SWC1, at, fd, 0); |
2127 } | 2130 } |
2128 } | 2131 } |
2129 | 2132 |
2130 | 2133 |
2131 void Assembler::sdc1(FPURegister fd, const MemOperand& src) { | 2134 void Assembler::sdc1(FPURegister fd, const MemOperand& src) { |
2132 // Workaround for non-8-byte alignment of HeapNumber, convert 64-bit | 2135 // Workaround for non-8-byte alignment of HeapNumber, convert 64-bit |
2133 // store to two 32-bit stores. | 2136 // store to two 32-bit stores. |
2134 DCHECK(!src.rm().is(at)); | 2137 DCHECK(!src.rm().is(at)); |
2135 DCHECK(!src.rm().is(t8)); | 2138 DCHECK(!src.rm().is(t8)); |
2136 if (IsFp64Mode()) { | 2139 if (IsFp32Mode()) { // fp32 mode. |
2137 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | |
2138 GenInstrImmediate(SWC1, src.rm(), fd, | |
2139 src.offset_ + Register::kMantissaOffset); | |
2140 mfhc1(at, fd); | |
2141 GenInstrImmediate(SW, src.rm(), at, | |
2142 src.offset_ + Register::kExponentOffset); | |
2143 } else { // Offset > 16 bits, use multiple instructions to load. | |
2144 LoadRegPlusOffsetToAt(src); | |
2145 GenInstrImmediate(SWC1, at, fd, Register::kMantissaOffset); | |
2146 mfhc1(t8, fd); | |
2147 GenInstrImmediate(SW, at, t8, Register::kExponentOffset); | |
2148 } | |
2149 } else { // fp32 mode. | |
2150 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | 2140 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { |
2151 GenInstrImmediate(SWC1, src.rm(), fd, | 2141 GenInstrImmediate(SWC1, src.rm(), fd, |
2152 src.offset_ + Register::kMantissaOffset); | 2142 src.offset_ + Register::kMantissaOffset); |
2153 FPURegister nextfpreg; | 2143 FPURegister nextfpreg; |
2154 nextfpreg.setcode(fd.code() + 1); | 2144 nextfpreg.setcode(fd.code() + 1); |
2155 GenInstrImmediate(SWC1, src.rm(), nextfpreg, | 2145 GenInstrImmediate(SWC1, src.rm(), nextfpreg, |
2156 src.offset_ + Register::kExponentOffset); | 2146 src.offset_ + Register::kExponentOffset); |
2157 } else { // Offset > 16 bits, use multiple instructions to load. | 2147 } else { // Offset > 16 bits, use multiple instructions to load. |
2158 LoadRegPlusOffsetToAt(src); | 2148 LoadRegPlusOffsetToAt(src); |
2159 GenInstrImmediate(SWC1, at, fd, Register::kMantissaOffset); | 2149 GenInstrImmediate(SWC1, at, fd, Register::kMantissaOffset); |
2160 FPURegister nextfpreg; | 2150 FPURegister nextfpreg; |
2161 nextfpreg.setcode(fd.code() + 1); | 2151 nextfpreg.setcode(fd.code() + 1); |
2162 GenInstrImmediate(SWC1, at, nextfpreg, Register::kExponentOffset); | 2152 GenInstrImmediate(SWC1, at, nextfpreg, Register::kExponentOffset); |
2163 } | 2153 } |
| 2154 } else { |
| 2155 DCHECK(IsFp64Mode() || IsFpxxMode()); |
| 2156 // Currently we support FPXX and FP64 on Mips32r2 and Mips32r6 |
| 2157 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); |
| 2158 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { |
| 2159 GenInstrImmediate(SWC1, src.rm(), fd, |
| 2160 src.offset_ + Register::kMantissaOffset); |
| 2161 mfhc1(at, fd); |
| 2162 GenInstrImmediate(SW, src.rm(), at, |
| 2163 src.offset_ + Register::kExponentOffset); |
| 2164 } else { // Offset > 16 bits, use multiple instructions to load. |
| 2165 LoadRegPlusOffsetToAt(src); |
| 2166 GenInstrImmediate(SWC1, at, fd, Register::kMantissaOffset); |
| 2167 mfhc1(t8, fd); |
| 2168 GenInstrImmediate(SW, at, t8, Register::kExponentOffset); |
| 2169 } |
2164 } | 2170 } |
2165 } | 2171 } |
2166 | 2172 |
2167 | 2173 |
2168 void Assembler::mtc1(Register rt, FPURegister fs) { | 2174 void Assembler::mtc1(Register rt, FPURegister fs) { |
2169 GenInstrRegister(COP1, MTC1, rt, fs, f0); | 2175 GenInstrRegister(COP1, MTC1, rt, fs, f0); |
2170 } | 2176 } |
2171 | 2177 |
2172 | 2178 |
2173 void Assembler::mthc1(Register rt, FPURegister fs) { | 2179 void Assembler::mthc1(Register rt, FPURegister fs) { |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3045 | 3051 |
3046 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 3052 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
3047 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); | 3053 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); |
3048 } | 3054 } |
3049 } | 3055 } |
3050 | 3056 |
3051 } // namespace internal | 3057 } // namespace internal |
3052 } // namespace v8 | 3058 } // namespace v8 |
3053 | 3059 |
3054 #endif // V8_TARGET_ARCH_MIPS | 3060 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |