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 2081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2092 src.offset_ + Register::kMantissaOffset); | 2092 src.offset_ + Register::kMantissaOffset); |
2093 GenInstrImmediate(LW, src.rm(), at, | 2093 GenInstrImmediate(LW, src.rm(), at, |
2094 src.offset_ + Register::kExponentOffset); | 2094 src.offset_ + Register::kExponentOffset); |
2095 mthc1(at, fd); | 2095 mthc1(at, fd); |
2096 } else { // Offset > 16 bits, use multiple instructions to load. | 2096 } else { // Offset > 16 bits, use multiple instructions to load. |
2097 LoadRegPlusOffsetToAt(src); | 2097 LoadRegPlusOffsetToAt(src); |
2098 GenInstrImmediate(LWC1, at, fd, Register::kMantissaOffset); | 2098 GenInstrImmediate(LWC1, at, fd, Register::kMantissaOffset); |
2099 GenInstrImmediate(LW, at, at, Register::kExponentOffset); | 2099 GenInstrImmediate(LW, at, at, Register::kExponentOffset); |
2100 mthc1(at, fd); | 2100 mthc1(at, fd); |
2101 } | 2101 } |
2102 } else { // fp32 mode. | 2102 } else if (IsFp32Mode()) { // fp32 mode. |
2103 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | 2103 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { |
2104 GenInstrImmediate(LWC1, src.rm(), fd, | 2104 GenInstrImmediate(LWC1, src.rm(), fd, |
2105 src.offset_ + Register::kMantissaOffset); | 2105 src.offset_ + Register::kMantissaOffset); |
2106 FPURegister nextfpreg; | 2106 FPURegister nextfpreg; |
2107 nextfpreg.setcode(fd.code() + 1); | 2107 nextfpreg.setcode(fd.code() + 1); |
2108 GenInstrImmediate(LWC1, src.rm(), nextfpreg, | 2108 GenInstrImmediate(LWC1, src.rm(), nextfpreg, |
2109 src.offset_ + Register::kExponentOffset); | 2109 src.offset_ + Register::kExponentOffset); |
2110 } else { // Offset > 16 bits, use multiple instructions to load. | 2110 } else { // Offset > 16 bits, use multiple instructions to load. |
2111 LoadRegPlusOffsetToAt(src); | 2111 LoadRegPlusOffsetToAt(src); |
2112 GenInstrImmediate(LWC1, at, fd, Register::kMantissaOffset); | 2112 GenInstrImmediate(LWC1, at, fd, Register::kMantissaOffset); |
2113 FPURegister nextfpreg; | 2113 FPURegister nextfpreg; |
2114 nextfpreg.setcode(fd.code() + 1); | 2114 nextfpreg.setcode(fd.code() + 1); |
2115 GenInstrImmediate(LWC1, at, nextfpreg, Register::kExponentOffset); | 2115 GenInstrImmediate(LWC1, at, nextfpreg, Register::kExponentOffset); |
2116 } | 2116 } |
2117 } else { | |
Paul Lind
2016/02/01 04:27:36
As far as I can see this block is same as fp64 cas
| |
2118 DCHECK(IsFpxxMode()); | |
2119 // Currently we support FPXX on Mips32r2 and Mips32r6 | |
2120 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); | |
2121 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | |
2122 GenInstrImmediate(LWC1, src.rm(), fd, | |
2123 src.offset_ + Register::kMantissaOffset); | |
2124 GenInstrImmediate(LW, src.rm(), at, | |
2125 src.offset_ + Register::kExponentOffset); | |
2126 mthc1(at, fd); | |
2127 } else { // Offset > 16 bits, use multiple instructions to load. | |
2128 LoadRegPlusOffsetToAt(src); | |
2129 GenInstrImmediate(LWC1, at, fd, Register::kMantissaOffset); | |
2130 GenInstrImmediate(LW, at, at, Register::kExponentOffset); | |
2131 mthc1(at, fd); | |
2132 } | |
2117 } | 2133 } |
2118 } | 2134 } |
2119 | 2135 |
2120 | 2136 |
2121 void Assembler::swc1(FPURegister fd, const MemOperand& src) { | 2137 void Assembler::swc1(FPURegister fd, const MemOperand& src) { |
2122 if (is_int16(src.offset_)) { | 2138 if (is_int16(src.offset_)) { |
2123 GenInstrImmediate(SWC1, src.rm(), fd, src.offset_); | 2139 GenInstrImmediate(SWC1, src.rm(), fd, src.offset_); |
2124 } else { // Offset > 16 bits, use multiple instructions to load. | 2140 } else { // Offset > 16 bits, use multiple instructions to load. |
2125 LoadRegPlusOffsetToAt(src); | 2141 LoadRegPlusOffsetToAt(src); |
2126 GenInstrImmediate(SWC1, at, fd, 0); | 2142 GenInstrImmediate(SWC1, at, fd, 0); |
(...skipping 12 matching lines...) Expand all Loading... | |
2139 src.offset_ + Register::kMantissaOffset); | 2155 src.offset_ + Register::kMantissaOffset); |
2140 mfhc1(at, fd); | 2156 mfhc1(at, fd); |
2141 GenInstrImmediate(SW, src.rm(), at, | 2157 GenInstrImmediate(SW, src.rm(), at, |
2142 src.offset_ + Register::kExponentOffset); | 2158 src.offset_ + Register::kExponentOffset); |
2143 } else { // Offset > 16 bits, use multiple instructions to load. | 2159 } else { // Offset > 16 bits, use multiple instructions to load. |
2144 LoadRegPlusOffsetToAt(src); | 2160 LoadRegPlusOffsetToAt(src); |
2145 GenInstrImmediate(SWC1, at, fd, Register::kMantissaOffset); | 2161 GenInstrImmediate(SWC1, at, fd, Register::kMantissaOffset); |
2146 mfhc1(t8, fd); | 2162 mfhc1(t8, fd); |
2147 GenInstrImmediate(SW, at, t8, Register::kExponentOffset); | 2163 GenInstrImmediate(SW, at, t8, Register::kExponentOffset); |
2148 } | 2164 } |
2149 } else { // fp32 mode. | 2165 } else if (IsFp32Mode()) { // fp32 mode. |
2150 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | 2166 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { |
2151 GenInstrImmediate(SWC1, src.rm(), fd, | 2167 GenInstrImmediate(SWC1, src.rm(), fd, |
2152 src.offset_ + Register::kMantissaOffset); | 2168 src.offset_ + Register::kMantissaOffset); |
2153 FPURegister nextfpreg; | 2169 FPURegister nextfpreg; |
2154 nextfpreg.setcode(fd.code() + 1); | 2170 nextfpreg.setcode(fd.code() + 1); |
2155 GenInstrImmediate(SWC1, src.rm(), nextfpreg, | 2171 GenInstrImmediate(SWC1, src.rm(), nextfpreg, |
2156 src.offset_ + Register::kExponentOffset); | 2172 src.offset_ + Register::kExponentOffset); |
2157 } else { // Offset > 16 bits, use multiple instructions to load. | 2173 } else { // Offset > 16 bits, use multiple instructions to load. |
2158 LoadRegPlusOffsetToAt(src); | 2174 LoadRegPlusOffsetToAt(src); |
2159 GenInstrImmediate(SWC1, at, fd, Register::kMantissaOffset); | 2175 GenInstrImmediate(SWC1, at, fd, Register::kMantissaOffset); |
2160 FPURegister nextfpreg; | 2176 FPURegister nextfpreg; |
2161 nextfpreg.setcode(fd.code() + 1); | 2177 nextfpreg.setcode(fd.code() + 1); |
2162 GenInstrImmediate(SWC1, at, nextfpreg, Register::kExponentOffset); | 2178 GenInstrImmediate(SWC1, at, nextfpreg, Register::kExponentOffset); |
2163 } | 2179 } |
2180 } else { | |
2181 DCHECK(IsFpxxMode()); | |
2182 // Currently we support FPXX on Mips32r2 and Mips32r6 | |
2183 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); | |
2184 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | |
2185 GenInstrImmediate(SWC1, src.rm(), fd, | |
2186 src.offset_ + Register::kMantissaOffset); | |
2187 mfhc1(at, fd); | |
2188 GenInstrImmediate(SW, src.rm(), at, | |
2189 src.offset_ + Register::kExponentOffset); | |
2190 } else { // Offset > 16 bits, use multiple instructions to load. | |
2191 LoadRegPlusOffsetToAt(src); | |
2192 GenInstrImmediate(SWC1, at, fd, Register::kMantissaOffset); | |
2193 mfhc1(t8, fd); | |
2194 GenInstrImmediate(SW, at, t8, Register::kExponentOffset); | |
2195 } | |
2164 } | 2196 } |
2165 } | 2197 } |
2166 | 2198 |
2167 | 2199 |
2168 void Assembler::mtc1(Register rt, FPURegister fs) { | 2200 void Assembler::mtc1(Register rt, FPURegister fs) { |
2169 GenInstrRegister(COP1, MTC1, rt, fs, f0); | 2201 GenInstrRegister(COP1, MTC1, rt, fs, f0); |
2170 } | 2202 } |
2171 | 2203 |
2172 | 2204 |
2173 void Assembler::mthc1(Register rt, FPURegister fs) { | 2205 void Assembler::mthc1(Register rt, FPURegister fs) { |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3045 | 3077 |
3046 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 3078 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
3047 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); | 3079 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); |
3048 } | 3080 } |
3049 } | 3081 } |
3050 | 3082 |
3051 } // namespace internal | 3083 } // namespace internal |
3052 } // namespace v8 | 3084 } // namespace v8 |
3053 | 3085 |
3054 #endif // V8_TARGET_ARCH_MIPS | 3086 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |