Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: src/compiler/mips64/code-generator-mips64.cc

Issue 2791213003: MIPS[64]: Support for some SIMD operations (6) (Closed)
Patch Set: Rebasing Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 #include "src/compilation-info.h" 6 #include "src/compilation-info.h"
7 #include "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/gap-resolver.h" 8 #include "src/compiler/gap-resolver.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/osr.h" 10 #include "src/compiler/osr.h"
(...skipping 2072 matching lines...) Expand 10 before | Expand all | Expand 10 after
2083 __ max_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 2083 __ max_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
2084 i.InputSimd128Register(1)); 2084 i.InputSimd128Register(1));
2085 break; 2085 break;
2086 } 2086 }
2087 case kMips64I32x4MinU: { 2087 case kMips64I32x4MinU: {
2088 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); 2088 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2089 __ min_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 2089 __ min_u_w(i.OutputSimd128Register(), i.InputSimd128Register(0),
2090 i.InputSimd128Register(1)); 2090 i.InputSimd128Register(1));
2091 break; 2091 break;
2092 } 2092 }
2093 case kMips64S32x4Select: { 2093 case kMips64S32x4Select:
2094 case kMips64S16x8Select:
2095 case kMips64S8x16Select: {
2094 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); 2096 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2095 DCHECK(i.OutputSimd128Register().is(i.InputSimd128Register(0))); 2097 DCHECK(i.OutputSimd128Register().is(i.InputSimd128Register(0)));
2096 __ bsel_v(i.OutputSimd128Register(), i.InputSimd128Register(2), 2098 __ bsel_v(i.OutputSimd128Register(), i.InputSimd128Register(2),
2097 i.InputSimd128Register(1)); 2099 i.InputSimd128Register(1));
2098 break; 2100 break;
2099 } 2101 }
2100 case kMips64F32x4Abs: { 2102 case kMips64F32x4Abs: {
2101 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); 2103 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2102 __ bclri_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 31); 2104 __ bclri_w(i.OutputSimd128Register(), i.InputSimd128Register(0), 31);
2103 break; 2105 break;
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
2275 __ subv_h(i.OutputSimd128Register(), i.InputSimd128Register(0), 2277 __ subv_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
2276 i.InputSimd128Register(1)); 2278 i.InputSimd128Register(1));
2277 break; 2279 break;
2278 } 2280 }
2279 case kMips64I16x8SubSaturateS: { 2281 case kMips64I16x8SubSaturateS: {
2280 CpuFeatureScope msa_scope(masm(), MIPS_SIMD); 2282 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2281 __ subs_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0), 2283 __ subs_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
2282 i.InputSimd128Register(1)); 2284 i.InputSimd128Register(1));
2283 break; 2285 break;
2284 } 2286 }
2287 case kMips64I16x8Mul: {
2288 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2289 __ mulv_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
2290 i.InputSimd128Register(1));
2291 break;
2292 }
2293 case kMips64I16x8MaxS: {
2294 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2295 __ max_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
2296 i.InputSimd128Register(1));
2297 break;
2298 }
2299 case kMips64I16x8MinS: {
2300 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2301 __ min_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
2302 i.InputSimd128Register(1));
2303 break;
2304 }
2305 case kMips64I16x8Eq: {
2306 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2307 __ ceq_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
2308 i.InputSimd128Register(1));
2309 break;
2310 }
2311 case kMips64I16x8Ne: {
2312 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2313 Simd128Register dst = i.OutputSimd128Register();
2314 __ ceq_h(dst, i.InputSimd128Register(0), i.InputSimd128Register(1));
2315 __ nor_v(dst, dst, dst);
2316 break;
2317 }
2318 case kMips64I16x8LtS: {
2319 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2320 __ clt_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
2321 i.InputSimd128Register(1));
2322 break;
2323 }
2324 case kMips64I16x8LeS: {
2325 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2326 __ cle_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
2327 i.InputSimd128Register(1));
2328 break;
2329 }
2330 case kMips64I16x8AddSaturateU: {
2331 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2332 __ adds_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
2333 i.InputSimd128Register(1));
2334 break;
2335 }
2336 case kMips64I16x8SubSaturateU: {
2337 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2338 __ subs_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
2339 i.InputSimd128Register(1));
2340 break;
2341 }
2342 case kMips64I16x8MaxU: {
2343 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2344 __ max_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
2345 i.InputSimd128Register(1));
2346 break;
2347 }
2348 case kMips64I16x8MinU: {
2349 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2350 __ min_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
2351 i.InputSimd128Register(1));
2352 break;
2353 }
2354 case kMips64I16x8LtU: {
2355 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2356 __ clt_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
2357 i.InputSimd128Register(1));
2358 break;
2359 }
2360 case kMips64I16x8LeU: {
2361 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2362 __ cle_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
2363 i.InputSimd128Register(1));
2364 break;
2365 }
2366 case kMips64I8x16Splat: {
2367 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2368 __ fill_b(i.OutputSimd128Register(), i.InputRegister(0));
2369 break;
2370 }
2371 case kMips64I8x16ExtractLane: {
2372 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2373 __ copy_s_b(i.OutputRegister(), i.InputSimd128Register(0),
2374 i.InputInt8(1));
2375 break;
2376 }
2377 case kMips64I8x16ReplaceLane: {
2378 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2379 Simd128Register src = i.InputSimd128Register(0);
2380 Simd128Register dst = i.OutputSimd128Register();
2381 if (!src.is(dst)) {
2382 __ move_v(dst, src);
2383 }
2384 __ insert_b(dst, i.InputInt8(1), i.InputRegister(2));
2385 break;
2386 }
2387 case kMips64I8x16Neg: {
2388 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2389 __ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
2390 __ subv_b(i.OutputSimd128Register(), kSimd128RegZero,
2391 i.InputSimd128Register(0));
2392 break;
2393 }
2394 case kMips64I8x16Shl: {
2395 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2396 __ slli_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
2397 i.InputInt3(1));
2398 break;
2399 }
2400 case kMips64I8x16ShrS: {
2401 CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
2402 __ srai_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
2403 i.InputInt3(1));
2404 break;
2405 }
2285 } 2406 }
2286 return kSuccess; 2407 return kSuccess;
2287 } // NOLINT(readability/fn_size) 2408 } // NOLINT(readability/fn_size)
2288 2409
2289 2410
2290 #define UNSUPPORTED_COND(opcode, condition) \ 2411 #define UNSUPPORTED_COND(opcode, condition) \
2291 OFStream out(stdout); \ 2412 OFStream out(stdout); \
2292 out << "Unsupported " << #opcode << " condition: \"" << condition << "\""; \ 2413 out << "Unsupported " << #opcode << " condition: \"" << condition << "\""; \
2293 UNIMPLEMENTED(); 2414 UNIMPLEMENTED();
2294 2415
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
3041 padding_size -= v8::internal::Assembler::kInstrSize; 3162 padding_size -= v8::internal::Assembler::kInstrSize;
3042 } 3163 }
3043 } 3164 }
3044 } 3165 }
3045 3166
3046 #undef __ 3167 #undef __
3047 3168
3048 } // namespace compiler 3169 } // namespace compiler
3049 } // namespace internal 3170 } // namespace internal
3050 } // namespace v8 3171 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips/instruction-selector-mips.cc ('k') | src/compiler/mips64/instruction-codes-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698