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 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2098 src.offset_ + Register::kMantissaOffset); | 2098 src.offset_ + Register::kMantissaOffset); |
2099 GenInstrImmediate(LW, src.rm(), at, | 2099 GenInstrImmediate(LW, src.rm(), at, |
2100 src.offset_ + Register::kExponentOffset); | 2100 src.offset_ + Register::kExponentOffset); |
2101 mthc1(at, fd); | 2101 mthc1(at, fd); |
2102 } else { // Offset > 16 bits, use multiple instructions to load. | 2102 } else { // Offset > 16 bits, use multiple instructions to load. |
2103 LoadRegPlusOffsetToAt(src); | 2103 LoadRegPlusOffsetToAt(src); |
2104 GenInstrImmediate(LWC1, at, fd, Register::kMantissaOffset); | 2104 GenInstrImmediate(LWC1, at, fd, Register::kMantissaOffset); |
2105 GenInstrImmediate(LW, at, at, Register::kExponentOffset); | 2105 GenInstrImmediate(LW, at, at, Register::kExponentOffset); |
2106 mthc1(at, fd); | 2106 mthc1(at, fd); |
2107 } | 2107 } |
2108 } else { // fp32 mode. | 2108 } else if (IsFp32Mode()) { // fp32 mode. |
2109 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | 2109 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { |
2110 GenInstrImmediate(LWC1, src.rm(), fd, | 2110 GenInstrImmediate(LWC1, src.rm(), fd, |
2111 src.offset_ + Register::kMantissaOffset); | 2111 src.offset_ + Register::kMantissaOffset); |
2112 FPURegister nextfpreg; | 2112 FPURegister nextfpreg; |
2113 nextfpreg.setcode(fd.code() + 1); | 2113 nextfpreg.setcode(fd.code() + 1); |
2114 GenInstrImmediate(LWC1, src.rm(), nextfpreg, | 2114 GenInstrImmediate(LWC1, src.rm(), nextfpreg, |
2115 src.offset_ + Register::kExponentOffset); | 2115 src.offset_ + Register::kExponentOffset); |
2116 } else { // Offset > 16 bits, use multiple instructions to load. | 2116 } else { // Offset > 16 bits, use multiple instructions to load. |
2117 LoadRegPlusOffsetToAt(src); | 2117 LoadRegPlusOffsetToAt(src); |
2118 GenInstrImmediate(LWC1, at, fd, Register::kMantissaOffset); | 2118 GenInstrImmediate(LWC1, at, fd, Register::kMantissaOffset); |
2119 FPURegister nextfpreg; | 2119 FPURegister nextfpreg; |
2120 nextfpreg.setcode(fd.code() + 1); | 2120 nextfpreg.setcode(fd.code() + 1); |
2121 GenInstrImmediate(LWC1, at, nextfpreg, Register::kExponentOffset); | 2121 GenInstrImmediate(LWC1, at, nextfpreg, Register::kExponentOffset); |
2122 } | 2122 } |
2123 } else { | |
2124 DCHECK(IsFpxxMode()); | |
2125 // Currently we support FPXX on Mips32r2 and Mips32r6 | |
2126 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); | |
2127 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | |
2128 GenInstrImmediate(LWC1, src.rm(), fd, | |
2129 src.offset_ + Register::kMantissaOffset); | |
2130 GenInstrImmediate(LW, src.rm(), at, | |
2131 src.offset_ + Register::kExponentOffset); | |
2132 mthc1(at, fd); | |
balazs.kilvady
2016/01/27 11:50:08
Why we use GenInstrImmediate() for LW and LWC1 if
ivica.bogosavljevic
2016/01/27 12:49:34
Good point. I just copied the above code. I will r
| |
2133 } else { // Offset > 16 bits, use multiple instructions to load. | |
2134 LoadRegPlusOffsetToAt(src); | |
2135 GenInstrImmediate(LWC1, at, fd, Register::kMantissaOffset); | |
2136 GenInstrImmediate(LW, at, at, Register::kExponentOffset); | |
2137 mthc1(at, fd); | |
2138 } | |
2123 } | 2139 } |
2124 } | 2140 } |
2125 | 2141 |
2126 | 2142 |
2127 void Assembler::swc1(FPURegister fd, const MemOperand& src) { | 2143 void Assembler::swc1(FPURegister fd, const MemOperand& src) { |
2128 if (is_int16(src.offset_)) { | 2144 if (is_int16(src.offset_)) { |
2129 GenInstrImmediate(SWC1, src.rm(), fd, src.offset_); | 2145 GenInstrImmediate(SWC1, src.rm(), fd, src.offset_); |
2130 } else { // Offset > 16 bits, use multiple instructions to load. | 2146 } else { // Offset > 16 bits, use multiple instructions to load. |
2131 LoadRegPlusOffsetToAt(src); | 2147 LoadRegPlusOffsetToAt(src); |
2132 GenInstrImmediate(SWC1, at, fd, 0); | 2148 GenInstrImmediate(SWC1, at, fd, 0); |
(...skipping 12 matching lines...) Expand all Loading... | |
2145 src.offset_ + Register::kMantissaOffset); | 2161 src.offset_ + Register::kMantissaOffset); |
2146 mfhc1(at, fd); | 2162 mfhc1(at, fd); |
2147 GenInstrImmediate(SW, src.rm(), at, | 2163 GenInstrImmediate(SW, src.rm(), at, |
2148 src.offset_ + Register::kExponentOffset); | 2164 src.offset_ + Register::kExponentOffset); |
2149 } else { // Offset > 16 bits, use multiple instructions to load. | 2165 } else { // Offset > 16 bits, use multiple instructions to load. |
2150 LoadRegPlusOffsetToAt(src); | 2166 LoadRegPlusOffsetToAt(src); |
2151 GenInstrImmediate(SWC1, at, fd, Register::kMantissaOffset); | 2167 GenInstrImmediate(SWC1, at, fd, Register::kMantissaOffset); |
2152 mfhc1(t8, fd); | 2168 mfhc1(t8, fd); |
2153 GenInstrImmediate(SW, at, t8, Register::kExponentOffset); | 2169 GenInstrImmediate(SW, at, t8, Register::kExponentOffset); |
2154 } | 2170 } |
2155 } else { // fp32 mode. | 2171 } else if (IsFp32Mode()) { // fp32 mode. |
2156 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | 2172 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { |
2157 GenInstrImmediate(SWC1, src.rm(), fd, | 2173 GenInstrImmediate(SWC1, src.rm(), fd, |
2158 src.offset_ + Register::kMantissaOffset); | 2174 src.offset_ + Register::kMantissaOffset); |
2159 FPURegister nextfpreg; | 2175 FPURegister nextfpreg; |
2160 nextfpreg.setcode(fd.code() + 1); | 2176 nextfpreg.setcode(fd.code() + 1); |
2161 GenInstrImmediate(SWC1, src.rm(), nextfpreg, | 2177 GenInstrImmediate(SWC1, src.rm(), nextfpreg, |
2162 src.offset_ + Register::kExponentOffset); | 2178 src.offset_ + Register::kExponentOffset); |
2163 } else { // Offset > 16 bits, use multiple instructions to load. | 2179 } else { // Offset > 16 bits, use multiple instructions to load. |
2164 LoadRegPlusOffsetToAt(src); | 2180 LoadRegPlusOffsetToAt(src); |
2165 GenInstrImmediate(SWC1, at, fd, Register::kMantissaOffset); | 2181 GenInstrImmediate(SWC1, at, fd, Register::kMantissaOffset); |
2166 FPURegister nextfpreg; | 2182 FPURegister nextfpreg; |
2167 nextfpreg.setcode(fd.code() + 1); | 2183 nextfpreg.setcode(fd.code() + 1); |
2168 GenInstrImmediate(SWC1, at, nextfpreg, Register::kExponentOffset); | 2184 GenInstrImmediate(SWC1, at, nextfpreg, Register::kExponentOffset); |
2169 } | 2185 } |
2186 } else { | |
2187 DCHECK(IsFpxxMode()); | |
2188 // Currently we support FPXX on Mips32r2 and Mips32r6 | |
2189 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); | |
2190 if (is_int16(src.offset_) && is_int16(src.offset_ + kIntSize)) { | |
2191 GenInstrImmediate(SWC1, src.rm(), fd, | |
2192 src.offset_ + Register::kMantissaOffset); | |
2193 mfhc1(at, fd); | |
2194 GenInstrImmediate(SW, src.rm(), at, | |
2195 src.offset_ + Register::kExponentOffset); | |
2196 } else { // Offset > 16 bits, use multiple instructions to load. | |
2197 LoadRegPlusOffsetToAt(src); | |
2198 GenInstrImmediate(SWC1, at, fd, Register::kMantissaOffset); | |
2199 mfhc1(t8, fd); | |
2200 GenInstrImmediate(SW, at, t8, Register::kExponentOffset); | |
2201 } | |
2170 } | 2202 } |
2171 } | 2203 } |
2172 | 2204 |
2173 | 2205 |
2174 void Assembler::mtc1(Register rt, FPURegister fs) { | 2206 void Assembler::mtc1(Register rt, FPURegister fs) { |
2175 GenInstrRegister(COP1, MTC1, rt, fs, f0); | 2207 GenInstrRegister(COP1, MTC1, rt, fs, f0); |
2176 } | 2208 } |
2177 | 2209 |
2178 | 2210 |
2179 void Assembler::mthc1(Register rt, FPURegister fs) { | 2211 void Assembler::mthc1(Register rt, FPURegister fs) { |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3051 | 3083 |
3052 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 3084 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
3053 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); | 3085 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); |
3054 } | 3086 } |
3055 } | 3087 } |
3056 | 3088 |
3057 } // namespace internal | 3089 } // namespace internal |
3058 } // namespace v8 | 3090 } // namespace v8 |
3059 | 3091 |
3060 #endif // V8_TARGET_ARCH_MIPS | 3092 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |