OLD | NEW |
1 | 1 |
2 // Copyright 2012 the V8 project authors. All rights reserved. | 2 // Copyright 2012 the V8 project authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #if V8_TARGET_ARCH_MIPS | 8 #if V8_TARGET_ARCH_MIPS |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 2076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2087 bool MacroAssembler::BranchShortHelperR6(int32_t offset, Label* L, | 2087 bool MacroAssembler::BranchShortHelperR6(int32_t offset, Label* L, |
2088 Condition cond, Register rs, | 2088 Condition cond, Register rs, |
2089 const Operand& rt) { | 2089 const Operand& rt) { |
2090 DCHECK(L == nullptr || offset == 0); | 2090 DCHECK(L == nullptr || offset == 0); |
2091 Register scratch = rs.is(at) ? t8 : at; | 2091 Register scratch = rs.is(at) ? t8 : at; |
2092 OffsetSize bits = OffsetSize::kOffset16; | 2092 OffsetSize bits = OffsetSize::kOffset16; |
2093 | 2093 |
2094 // Be careful to always use shifted_branch_offset only just before the | 2094 // Be careful to always use shifted_branch_offset only just before the |
2095 // branch instruction, as the location will be remember for patching the | 2095 // branch instruction, as the location will be remember for patching the |
2096 // target. | 2096 // target. |
2097 BlockTrampolinePoolScope block_trampoline_pool(this); | 2097 { |
2098 switch (cond) { | 2098 BlockTrampolinePoolScope block_trampoline_pool(this); |
2099 case cc_always: | 2099 switch (cond) { |
2100 bits = OffsetSize::kOffset26; | 2100 case cc_always: |
2101 if (!is_near(L, bits)) return false; | |
2102 offset = GetOffset(offset, L, bits); | |
2103 bc(offset); | |
2104 break; | |
2105 case eq: | |
2106 if (rs.code() == rt.rm_.reg_code) { | |
2107 // Pre R6 beq is used here to make the code patchable. Otherwise bc | |
2108 // should be used which has no condition field so is not patchable. | |
2109 bits = OffsetSize::kOffset16; | |
2110 if (!is_near(L, bits)) return false; | |
2111 scratch = GetRtAsRegisterHelper(rt, scratch); | |
2112 offset = GetOffset(offset, L, bits); | |
2113 beq(rs, scratch, offset); | |
2114 nop(); | |
2115 } else if (IsZero(rt)) { | |
2116 bits = OffsetSize::kOffset21; | |
2117 if (!is_near(L, bits)) return false; | |
2118 offset = GetOffset(offset, L, bits); | |
2119 beqzc(rs, offset); | |
2120 } else { | |
2121 // We don't want any other register but scratch clobbered. | |
2122 bits = OffsetSize::kOffset16; | |
2123 if (!is_near(L, bits)) return false; | |
2124 scratch = GetRtAsRegisterHelper(rt, scratch); | |
2125 offset = GetOffset(offset, L, bits); | |
2126 beqc(rs, scratch, offset); | |
2127 } | |
2128 break; | |
2129 case ne: | |
2130 if (rs.code() == rt.rm_.reg_code) { | |
2131 // Pre R6 bne is used here to make the code patchable. Otherwise we | |
2132 // should not generate any instruction. | |
2133 bits = OffsetSize::kOffset16; | |
2134 if (!is_near(L, bits)) return false; | |
2135 scratch = GetRtAsRegisterHelper(rt, scratch); | |
2136 offset = GetOffset(offset, L, bits); | |
2137 bne(rs, scratch, offset); | |
2138 nop(); | |
2139 } else if (IsZero(rt)) { | |
2140 bits = OffsetSize::kOffset21; | |
2141 if (!is_near(L, bits)) return false; | |
2142 offset = GetOffset(offset, L, bits); | |
2143 bnezc(rs, offset); | |
2144 } else { | |
2145 // We don't want any other register but scratch clobbered. | |
2146 bits = OffsetSize::kOffset16; | |
2147 if (!is_near(L, bits)) return false; | |
2148 scratch = GetRtAsRegisterHelper(rt, scratch); | |
2149 offset = GetOffset(offset, L, bits); | |
2150 bnec(rs, scratch, offset); | |
2151 } | |
2152 break; | |
2153 | |
2154 // Signed comparison. | |
2155 case greater: | |
2156 // rs > rt | |
2157 if (rs.code() == rt.rm_.reg_code) { | |
2158 break; // No code needs to be emitted. | |
2159 } else if (rs.is(zero_reg)) { | |
2160 bits = OffsetSize::kOffset16; | |
2161 if (!is_near(L, bits)) return false; | |
2162 scratch = GetRtAsRegisterHelper(rt, scratch); | |
2163 offset = GetOffset(offset, L, bits); | |
2164 bltzc(scratch, offset); | |
2165 } else if (IsZero(rt)) { | |
2166 bits = OffsetSize::kOffset16; | |
2167 if (!is_near(L, bits)) return false; | |
2168 offset = GetOffset(offset, L, bits); | |
2169 bgtzc(rs, offset); | |
2170 } else { | |
2171 bits = OffsetSize::kOffset16; | |
2172 if (!is_near(L, bits)) return false; | |
2173 scratch = GetRtAsRegisterHelper(rt, scratch); | |
2174 DCHECK(!rs.is(scratch)); | |
2175 offset = GetOffset(offset, L, bits); | |
2176 bltc(scratch, rs, offset); | |
2177 } | |
2178 break; | |
2179 case greater_equal: | |
2180 // rs >= rt | |
2181 if (rs.code() == rt.rm_.reg_code) { | |
2182 bits = OffsetSize::kOffset26; | 2101 bits = OffsetSize::kOffset26; |
2183 if (!is_near(L, bits)) return false; | 2102 if (!is_near(L, bits)) return false; |
2184 offset = GetOffset(offset, L, bits); | 2103 offset = GetOffset(offset, L, bits); |
2185 bc(offset); | 2104 bc(offset); |
2186 } else if (rs.is(zero_reg)) { | 2105 break; |
2187 bits = OffsetSize::kOffset16; | 2106 case eq: |
2188 if (!is_near(L, bits)) return false; | 2107 if (rs.code() == rt.rm_.reg_code) { |
2189 scratch = GetRtAsRegisterHelper(rt, scratch); | 2108 // Pre R6 beq is used here to make the code patchable. Otherwise bc |
2190 offset = GetOffset(offset, L, bits); | 2109 // should be used which has no condition field so is not patchable. |
2191 blezc(scratch, offset); | 2110 bits = OffsetSize::kOffset16; |
2192 } else if (IsZero(rt)) { | 2111 if (!is_near(L, bits)) return false; |
2193 bits = OffsetSize::kOffset16; | 2112 scratch = GetRtAsRegisterHelper(rt, scratch); |
2194 if (!is_near(L, bits)) return false; | 2113 offset = GetOffset(offset, L, bits); |
2195 offset = GetOffset(offset, L, bits); | 2114 beq(rs, scratch, offset); |
2196 bgezc(rs, offset); | 2115 nop(); |
2197 } else { | 2116 } else if (IsZero(rt)) { |
2198 bits = OffsetSize::kOffset16; | 2117 bits = OffsetSize::kOffset21; |
2199 if (!is_near(L, bits)) return false; | 2118 if (!is_near(L, bits)) return false; |
2200 scratch = GetRtAsRegisterHelper(rt, scratch); | 2119 offset = GetOffset(offset, L, bits); |
2201 DCHECK(!rs.is(scratch)); | 2120 beqzc(rs, offset); |
2202 offset = GetOffset(offset, L, bits); | 2121 } else { |
2203 bgec(rs, scratch, offset); | 2122 // We don't want any other register but scratch clobbered. |
2204 } | 2123 bits = OffsetSize::kOffset16; |
2205 break; | 2124 if (!is_near(L, bits)) return false; |
2206 case less: | 2125 scratch = GetRtAsRegisterHelper(rt, scratch); |
2207 // rs < rt | 2126 offset = GetOffset(offset, L, bits); |
2208 if (rs.code() == rt.rm_.reg_code) { | 2127 beqc(rs, scratch, offset); |
2209 break; // No code needs to be emitted. | 2128 } |
2210 } else if (rs.is(zero_reg)) { | 2129 break; |
2211 bits = OffsetSize::kOffset16; | 2130 case ne: |
2212 if (!is_near(L, bits)) return false; | 2131 if (rs.code() == rt.rm_.reg_code) { |
2213 scratch = GetRtAsRegisterHelper(rt, scratch); | 2132 // Pre R6 bne is used here to make the code patchable. Otherwise we |
2214 offset = GetOffset(offset, L, bits); | 2133 // should not generate any instruction. |
2215 bgtzc(scratch, offset); | 2134 bits = OffsetSize::kOffset16; |
2216 } else if (IsZero(rt)) { | 2135 if (!is_near(L, bits)) return false; |
2217 bits = OffsetSize::kOffset16; | 2136 scratch = GetRtAsRegisterHelper(rt, scratch); |
2218 if (!is_near(L, bits)) return false; | 2137 offset = GetOffset(offset, L, bits); |
2219 offset = GetOffset(offset, L, bits); | 2138 bne(rs, scratch, offset); |
2220 bltzc(rs, offset); | 2139 nop(); |
2221 } else { | 2140 } else if (IsZero(rt)) { |
2222 bits = OffsetSize::kOffset16; | 2141 bits = OffsetSize::kOffset21; |
2223 if (!is_near(L, bits)) return false; | 2142 if (!is_near(L, bits)) return false; |
2224 scratch = GetRtAsRegisterHelper(rt, scratch); | 2143 offset = GetOffset(offset, L, bits); |
2225 DCHECK(!rs.is(scratch)); | 2144 bnezc(rs, offset); |
2226 offset = GetOffset(offset, L, bits); | 2145 } else { |
2227 bltc(rs, scratch, offset); | 2146 // We don't want any other register but scratch clobbered. |
2228 } | 2147 bits = OffsetSize::kOffset16; |
2229 break; | 2148 if (!is_near(L, bits)) return false; |
2230 case less_equal: | 2149 scratch = GetRtAsRegisterHelper(rt, scratch); |
2231 // rs <= rt | 2150 offset = GetOffset(offset, L, bits); |
2232 if (rs.code() == rt.rm_.reg_code) { | 2151 bnec(rs, scratch, offset); |
2233 bits = OffsetSize::kOffset26; | 2152 } |
2234 if (!is_near(L, bits)) return false; | 2153 break; |
2235 offset = GetOffset(offset, L, bits); | |
2236 bc(offset); | |
2237 } else if (rs.is(zero_reg)) { | |
2238 bits = OffsetSize::kOffset16; | |
2239 if (!is_near(L, bits)) return false; | |
2240 scratch = GetRtAsRegisterHelper(rt, scratch); | |
2241 offset = GetOffset(offset, L, bits); | |
2242 bgezc(scratch, offset); | |
2243 } else if (IsZero(rt)) { | |
2244 bits = OffsetSize::kOffset16; | |
2245 if (!is_near(L, bits)) return false; | |
2246 offset = GetOffset(offset, L, bits); | |
2247 blezc(rs, offset); | |
2248 } else { | |
2249 bits = OffsetSize::kOffset16; | |
2250 if (!is_near(L, bits)) return false; | |
2251 scratch = GetRtAsRegisterHelper(rt, scratch); | |
2252 DCHECK(!rs.is(scratch)); | |
2253 offset = GetOffset(offset, L, bits); | |
2254 bgec(scratch, rs, offset); | |
2255 } | |
2256 break; | |
2257 | 2154 |
2258 // Unsigned comparison. | 2155 // Signed comparison. |
2259 case Ugreater: | 2156 case greater: |
2260 // rs > rt | 2157 // rs > rt |
2261 if (rs.code() == rt.rm_.reg_code) { | 2158 if (rs.code() == rt.rm_.reg_code) { |
2262 break; // No code needs to be emitted. | 2159 break; // No code needs to be emitted. |
2263 } else if (rs.is(zero_reg)) { | 2160 } else if (rs.is(zero_reg)) { |
2264 bits = OffsetSize::kOffset21; | 2161 bits = OffsetSize::kOffset16; |
2265 if (!is_near(L, bits)) return false; | 2162 if (!is_near(L, bits)) return false; |
2266 scratch = GetRtAsRegisterHelper(rt, scratch); | 2163 scratch = GetRtAsRegisterHelper(rt, scratch); |
2267 offset = GetOffset(offset, L, bits); | 2164 offset = GetOffset(offset, L, bits); |
2268 bnezc(scratch, offset); | 2165 bltzc(scratch, offset); |
2269 } else if (IsZero(rt)) { | 2166 } else if (IsZero(rt)) { |
2270 bits = OffsetSize::kOffset21; | 2167 bits = OffsetSize::kOffset16; |
2271 if (!is_near(L, bits)) return false; | 2168 if (!is_near(L, bits)) return false; |
2272 offset = GetOffset(offset, L, bits); | 2169 offset = GetOffset(offset, L, bits); |
2273 bnezc(rs, offset); | 2170 bgtzc(rs, offset); |
2274 } else { | 2171 } else { |
2275 bits = OffsetSize::kOffset16; | 2172 bits = OffsetSize::kOffset16; |
2276 if (!is_near(L, bits)) return false; | 2173 if (!is_near(L, bits)) return false; |
2277 scratch = GetRtAsRegisterHelper(rt, scratch); | 2174 scratch = GetRtAsRegisterHelper(rt, scratch); |
2278 DCHECK(!rs.is(scratch)); | 2175 DCHECK(!rs.is(scratch)); |
2279 offset = GetOffset(offset, L, bits); | 2176 offset = GetOffset(offset, L, bits); |
2280 bltuc(scratch, rs, offset); | 2177 bltc(scratch, rs, offset); |
2281 } | 2178 } |
2282 break; | 2179 break; |
2283 case Ugreater_equal: | 2180 case greater_equal: |
2284 // rs >= rt | 2181 // rs >= rt |
2285 if (rs.code() == rt.rm_.reg_code) { | 2182 if (rs.code() == rt.rm_.reg_code) { |
2286 bits = OffsetSize::kOffset26; | 2183 bits = OffsetSize::kOffset26; |
2287 if (!is_near(L, bits)) return false; | 2184 if (!is_near(L, bits)) return false; |
2288 offset = GetOffset(offset, L, bits); | 2185 offset = GetOffset(offset, L, bits); |
2289 bc(offset); | 2186 bc(offset); |
2290 } else if (rs.is(zero_reg)) { | 2187 } else if (rs.is(zero_reg)) { |
2291 bits = OffsetSize::kOffset21; | 2188 bits = OffsetSize::kOffset16; |
2292 if (!is_near(L, bits)) return false; | 2189 if (!is_near(L, bits)) return false; |
2293 scratch = GetRtAsRegisterHelper(rt, scratch); | 2190 scratch = GetRtAsRegisterHelper(rt, scratch); |
2294 offset = GetOffset(offset, L, bits); | 2191 offset = GetOffset(offset, L, bits); |
2295 beqzc(scratch, offset); | 2192 blezc(scratch, offset); |
2296 } else if (IsZero(rt)) { | 2193 } else if (IsZero(rt)) { |
2297 bits = OffsetSize::kOffset26; | 2194 bits = OffsetSize::kOffset16; |
2298 if (!is_near(L, bits)) return false; | 2195 if (!is_near(L, bits)) return false; |
2299 offset = GetOffset(offset, L, bits); | 2196 offset = GetOffset(offset, L, bits); |
2300 bc(offset); | 2197 bgezc(rs, offset); |
2301 } else { | 2198 } else { |
2302 bits = OffsetSize::kOffset16; | 2199 bits = OffsetSize::kOffset16; |
2303 if (!is_near(L, bits)) return false; | 2200 if (!is_near(L, bits)) return false; |
2304 scratch = GetRtAsRegisterHelper(rt, scratch); | 2201 scratch = GetRtAsRegisterHelper(rt, scratch); |
2305 DCHECK(!rs.is(scratch)); | 2202 DCHECK(!rs.is(scratch)); |
2306 offset = GetOffset(offset, L, bits); | 2203 offset = GetOffset(offset, L, bits); |
2307 bgeuc(rs, scratch, offset); | 2204 bgec(rs, scratch, offset); |
2308 } | 2205 } |
2309 break; | 2206 break; |
2310 case Uless: | 2207 case less: |
2311 // rs < rt | 2208 // rs < rt |
2312 if (rs.code() == rt.rm_.reg_code) { | 2209 if (rs.code() == rt.rm_.reg_code) { |
2313 break; // No code needs to be emitted. | 2210 break; // No code needs to be emitted. |
2314 } else if (rs.is(zero_reg)) { | 2211 } else if (rs.is(zero_reg)) { |
2315 bits = OffsetSize::kOffset21; | 2212 bits = OffsetSize::kOffset16; |
2316 if (!is_near(L, bits)) return false; | 2213 if (!is_near(L, bits)) return false; |
2317 scratch = GetRtAsRegisterHelper(rt, scratch); | 2214 scratch = GetRtAsRegisterHelper(rt, scratch); |
2318 offset = GetOffset(offset, L, bits); | 2215 offset = GetOffset(offset, L, bits); |
2319 bnezc(scratch, offset); | 2216 bgtzc(scratch, offset); |
2320 } else if (IsZero(rt)) { | 2217 } else if (IsZero(rt)) { |
2321 break; // No code needs to be emitted. | 2218 bits = OffsetSize::kOffset16; |
2322 } else { | 2219 if (!is_near(L, bits)) return false; |
2323 bits = OffsetSize::kOffset16; | 2220 offset = GetOffset(offset, L, bits); |
2324 if (!is_near(L, bits)) return false; | 2221 bltzc(rs, offset); |
2325 scratch = GetRtAsRegisterHelper(rt, scratch); | 2222 } else { |
2326 DCHECK(!rs.is(scratch)); | 2223 bits = OffsetSize::kOffset16; |
2327 offset = GetOffset(offset, L, bits); | 2224 if (!is_near(L, bits)) return false; |
2328 bltuc(rs, scratch, offset); | 2225 scratch = GetRtAsRegisterHelper(rt, scratch); |
2329 } | 2226 DCHECK(!rs.is(scratch)); |
2330 break; | 2227 offset = GetOffset(offset, L, bits); |
2331 case Uless_equal: | 2228 bltc(rs, scratch, offset); |
2332 // rs <= rt | 2229 } |
2333 if (rs.code() == rt.rm_.reg_code) { | 2230 break; |
2334 bits = OffsetSize::kOffset26; | 2231 case less_equal: |
2335 if (!is_near(L, bits)) return false; | 2232 // rs <= rt |
2336 offset = GetOffset(offset, L, bits); | 2233 if (rs.code() == rt.rm_.reg_code) { |
2337 bc(offset); | 2234 bits = OffsetSize::kOffset26; |
2338 } else if (rs.is(zero_reg)) { | 2235 if (!is_near(L, bits)) return false; |
2339 bits = OffsetSize::kOffset26; | 2236 offset = GetOffset(offset, L, bits); |
2340 if (!is_near(L, bits)) return false; | 2237 bc(offset); |
2341 scratch = GetRtAsRegisterHelper(rt, scratch); | 2238 } else if (rs.is(zero_reg)) { |
2342 offset = GetOffset(offset, L, bits); | 2239 bits = OffsetSize::kOffset16; |
2343 bc(offset); | 2240 if (!is_near(L, bits)) return false; |
2344 } else if (IsZero(rt)) { | 2241 scratch = GetRtAsRegisterHelper(rt, scratch); |
2345 bits = OffsetSize::kOffset21; | 2242 offset = GetOffset(offset, L, bits); |
2346 if (!is_near(L, bits)) return false; | 2243 bgezc(scratch, offset); |
2347 offset = GetOffset(offset, L, bits); | 2244 } else if (IsZero(rt)) { |
2348 beqzc(rs, offset); | 2245 bits = OffsetSize::kOffset16; |
2349 } else { | 2246 if (!is_near(L, bits)) return false; |
2350 bits = OffsetSize::kOffset16; | 2247 offset = GetOffset(offset, L, bits); |
2351 if (!is_near(L, bits)) return false; | 2248 blezc(rs, offset); |
2352 scratch = GetRtAsRegisterHelper(rt, scratch); | 2249 } else { |
2353 DCHECK(!rs.is(scratch)); | 2250 bits = OffsetSize::kOffset16; |
2354 offset = GetOffset(offset, L, bits); | 2251 if (!is_near(L, bits)) return false; |
2355 bgeuc(scratch, rs, offset); | 2252 scratch = GetRtAsRegisterHelper(rt, scratch); |
2356 } | 2253 DCHECK(!rs.is(scratch)); |
2357 break; | 2254 offset = GetOffset(offset, L, bits); |
2358 default: | 2255 bgec(scratch, rs, offset); |
2359 UNREACHABLE(); | 2256 } |
| 2257 break; |
| 2258 |
| 2259 // Unsigned comparison. |
| 2260 case Ugreater: |
| 2261 // rs > rt |
| 2262 if (rs.code() == rt.rm_.reg_code) { |
| 2263 break; // No code needs to be emitted. |
| 2264 } else if (rs.is(zero_reg)) { |
| 2265 bits = OffsetSize::kOffset21; |
| 2266 if (!is_near(L, bits)) return false; |
| 2267 scratch = GetRtAsRegisterHelper(rt, scratch); |
| 2268 offset = GetOffset(offset, L, bits); |
| 2269 bnezc(scratch, offset); |
| 2270 } else if (IsZero(rt)) { |
| 2271 bits = OffsetSize::kOffset21; |
| 2272 if (!is_near(L, bits)) return false; |
| 2273 offset = GetOffset(offset, L, bits); |
| 2274 bnezc(rs, offset); |
| 2275 } else { |
| 2276 bits = OffsetSize::kOffset16; |
| 2277 if (!is_near(L, bits)) return false; |
| 2278 scratch = GetRtAsRegisterHelper(rt, scratch); |
| 2279 DCHECK(!rs.is(scratch)); |
| 2280 offset = GetOffset(offset, L, bits); |
| 2281 bltuc(scratch, rs, offset); |
| 2282 } |
| 2283 break; |
| 2284 case Ugreater_equal: |
| 2285 // rs >= rt |
| 2286 if (rs.code() == rt.rm_.reg_code) { |
| 2287 bits = OffsetSize::kOffset26; |
| 2288 if (!is_near(L, bits)) return false; |
| 2289 offset = GetOffset(offset, L, bits); |
| 2290 bc(offset); |
| 2291 } else if (rs.is(zero_reg)) { |
| 2292 bits = OffsetSize::kOffset21; |
| 2293 if (!is_near(L, bits)) return false; |
| 2294 scratch = GetRtAsRegisterHelper(rt, scratch); |
| 2295 offset = GetOffset(offset, L, bits); |
| 2296 beqzc(scratch, offset); |
| 2297 } else if (IsZero(rt)) { |
| 2298 bits = OffsetSize::kOffset26; |
| 2299 if (!is_near(L, bits)) return false; |
| 2300 offset = GetOffset(offset, L, bits); |
| 2301 bc(offset); |
| 2302 } else { |
| 2303 bits = OffsetSize::kOffset16; |
| 2304 if (!is_near(L, bits)) return false; |
| 2305 scratch = GetRtAsRegisterHelper(rt, scratch); |
| 2306 DCHECK(!rs.is(scratch)); |
| 2307 offset = GetOffset(offset, L, bits); |
| 2308 bgeuc(rs, scratch, offset); |
| 2309 } |
| 2310 break; |
| 2311 case Uless: |
| 2312 // rs < rt |
| 2313 if (rs.code() == rt.rm_.reg_code) { |
| 2314 break; // No code needs to be emitted. |
| 2315 } else if (rs.is(zero_reg)) { |
| 2316 bits = OffsetSize::kOffset21; |
| 2317 if (!is_near(L, bits)) return false; |
| 2318 scratch = GetRtAsRegisterHelper(rt, scratch); |
| 2319 offset = GetOffset(offset, L, bits); |
| 2320 bnezc(scratch, offset); |
| 2321 } else if (IsZero(rt)) { |
| 2322 break; // No code needs to be emitted. |
| 2323 } else { |
| 2324 bits = OffsetSize::kOffset16; |
| 2325 if (!is_near(L, bits)) return false; |
| 2326 scratch = GetRtAsRegisterHelper(rt, scratch); |
| 2327 DCHECK(!rs.is(scratch)); |
| 2328 offset = GetOffset(offset, L, bits); |
| 2329 bltuc(rs, scratch, offset); |
| 2330 } |
| 2331 break; |
| 2332 case Uless_equal: |
| 2333 // rs <= rt |
| 2334 if (rs.code() == rt.rm_.reg_code) { |
| 2335 bits = OffsetSize::kOffset26; |
| 2336 if (!is_near(L, bits)) return false; |
| 2337 offset = GetOffset(offset, L, bits); |
| 2338 bc(offset); |
| 2339 } else if (rs.is(zero_reg)) { |
| 2340 bits = OffsetSize::kOffset26; |
| 2341 if (!is_near(L, bits)) return false; |
| 2342 scratch = GetRtAsRegisterHelper(rt, scratch); |
| 2343 offset = GetOffset(offset, L, bits); |
| 2344 bc(offset); |
| 2345 } else if (IsZero(rt)) { |
| 2346 bits = OffsetSize::kOffset21; |
| 2347 if (!is_near(L, bits)) return false; |
| 2348 offset = GetOffset(offset, L, bits); |
| 2349 beqzc(rs, offset); |
| 2350 } else { |
| 2351 bits = OffsetSize::kOffset16; |
| 2352 if (!is_near(L, bits)) return false; |
| 2353 scratch = GetRtAsRegisterHelper(rt, scratch); |
| 2354 DCHECK(!rs.is(scratch)); |
| 2355 offset = GetOffset(offset, L, bits); |
| 2356 bgeuc(scratch, rs, offset); |
| 2357 } |
| 2358 break; |
| 2359 default: |
| 2360 UNREACHABLE(); |
| 2361 } |
2360 } | 2362 } |
| 2363 CheckTrampolinePoolQuick(1); |
2361 return true; | 2364 return true; |
2362 } | 2365 } |
2363 | 2366 |
2364 | 2367 |
2365 bool MacroAssembler::BranchShortHelper(int16_t offset, Label* L, Condition cond, | 2368 bool MacroAssembler::BranchShortHelper(int16_t offset, Label* L, Condition cond, |
2366 Register rs, const Operand& rt, | 2369 Register rs, const Operand& rt, |
2367 BranchDelaySlot bdslot) { | 2370 BranchDelaySlot bdslot) { |
2368 DCHECK(L == nullptr || offset == 0); | 2371 DCHECK(L == nullptr || offset == 0); |
2369 if (!is_near(L, OffsetSize::kOffset16)) return false; | 2372 if (!is_near(L, OffsetSize::kOffset16)) return false; |
2370 | 2373 |
(...skipping 3483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5854 if (mag.shift > 0) sra(result, result, mag.shift); | 5857 if (mag.shift > 0) sra(result, result, mag.shift); |
5855 srl(at, dividend, 31); | 5858 srl(at, dividend, 31); |
5856 Addu(result, result, Operand(at)); | 5859 Addu(result, result, Operand(at)); |
5857 } | 5860 } |
5858 | 5861 |
5859 | 5862 |
5860 } // namespace internal | 5863 } // namespace internal |
5861 } // namespace v8 | 5864 } // namespace v8 |
5862 | 5865 |
5863 #endif // V8_TARGET_ARCH_MIPS | 5866 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |