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

Side by Side Diff: src/compiler/instruction-selector.cc

Issue 2804883008: [WASM SIMD] Implement horizontal add for float and integer types. (Closed)
Patch Set: Fix MIPS. Created 3 years, 8 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/instruction-selector.h" 5 #include "src/compiler/instruction-selector.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/assembler-inl.h" 9 #include "src/assembler-inl.h"
10 #include "src/base/adapters.h" 10 #include "src/base/adapters.h"
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 case IrOpcode::kF32x4Abs: 1502 case IrOpcode::kF32x4Abs:
1503 return MarkAsSimd128(node), VisitF32x4Abs(node); 1503 return MarkAsSimd128(node), VisitF32x4Abs(node);
1504 case IrOpcode::kF32x4Neg: 1504 case IrOpcode::kF32x4Neg:
1505 return MarkAsSimd128(node), VisitF32x4Neg(node); 1505 return MarkAsSimd128(node), VisitF32x4Neg(node);
1506 case IrOpcode::kF32x4RecipApprox: 1506 case IrOpcode::kF32x4RecipApprox:
1507 return MarkAsSimd128(node), VisitF32x4RecipApprox(node); 1507 return MarkAsSimd128(node), VisitF32x4RecipApprox(node);
1508 case IrOpcode::kF32x4RecipRefine: 1508 case IrOpcode::kF32x4RecipRefine:
1509 return MarkAsSimd128(node), VisitF32x4RecipRefine(node); 1509 return MarkAsSimd128(node), VisitF32x4RecipRefine(node);
1510 case IrOpcode::kF32x4Add: 1510 case IrOpcode::kF32x4Add:
1511 return MarkAsSimd128(node), VisitF32x4Add(node); 1511 return MarkAsSimd128(node), VisitF32x4Add(node);
1512 case IrOpcode::kF32x4AddHoriz:
1513 return MarkAsSimd128(node), VisitF32x4AddHoriz(node);
1512 case IrOpcode::kF32x4Sub: 1514 case IrOpcode::kF32x4Sub:
1513 return MarkAsSimd128(node), VisitF32x4Sub(node); 1515 return MarkAsSimd128(node), VisitF32x4Sub(node);
1514 case IrOpcode::kF32x4Mul: 1516 case IrOpcode::kF32x4Mul:
1515 return MarkAsSimd128(node), VisitF32x4Mul(node); 1517 return MarkAsSimd128(node), VisitF32x4Mul(node);
1516 case IrOpcode::kF32x4Min: 1518 case IrOpcode::kF32x4Min:
1517 return MarkAsSimd128(node), VisitF32x4Min(node); 1519 return MarkAsSimd128(node), VisitF32x4Min(node);
1518 case IrOpcode::kF32x4Max: 1520 case IrOpcode::kF32x4Max:
1519 return MarkAsSimd128(node), VisitF32x4Max(node); 1521 return MarkAsSimd128(node), VisitF32x4Max(node);
1520 case IrOpcode::kF32x4RecipSqrtApprox: 1522 case IrOpcode::kF32x4RecipSqrtApprox:
1521 return MarkAsSimd128(node), VisitF32x4RecipSqrtApprox(node); 1523 return MarkAsSimd128(node), VisitF32x4RecipSqrtApprox(node);
(...skipping 20 matching lines...) Expand all
1542 case IrOpcode::kI32x4SConvertI16x8High: 1544 case IrOpcode::kI32x4SConvertI16x8High:
1543 return MarkAsSimd128(node), VisitI32x4SConvertI16x8High(node); 1545 return MarkAsSimd128(node), VisitI32x4SConvertI16x8High(node);
1544 case IrOpcode::kI32x4Neg: 1546 case IrOpcode::kI32x4Neg:
1545 return MarkAsSimd128(node), VisitI32x4Neg(node); 1547 return MarkAsSimd128(node), VisitI32x4Neg(node);
1546 case IrOpcode::kI32x4Shl: 1548 case IrOpcode::kI32x4Shl:
1547 return MarkAsSimd128(node), VisitI32x4Shl(node); 1549 return MarkAsSimd128(node), VisitI32x4Shl(node);
1548 case IrOpcode::kI32x4ShrS: 1550 case IrOpcode::kI32x4ShrS:
1549 return MarkAsSimd128(node), VisitI32x4ShrS(node); 1551 return MarkAsSimd128(node), VisitI32x4ShrS(node);
1550 case IrOpcode::kI32x4Add: 1552 case IrOpcode::kI32x4Add:
1551 return MarkAsSimd128(node), VisitI32x4Add(node); 1553 return MarkAsSimd128(node), VisitI32x4Add(node);
1554 case IrOpcode::kI32x4AddHoriz:
1555 return MarkAsSimd128(node), VisitI32x4AddHoriz(node);
1552 case IrOpcode::kI32x4Sub: 1556 case IrOpcode::kI32x4Sub:
1553 return MarkAsSimd128(node), VisitI32x4Sub(node); 1557 return MarkAsSimd128(node), VisitI32x4Sub(node);
1554 case IrOpcode::kI32x4Mul: 1558 case IrOpcode::kI32x4Mul:
1555 return MarkAsSimd128(node), VisitI32x4Mul(node); 1559 return MarkAsSimd128(node), VisitI32x4Mul(node);
1556 case IrOpcode::kI32x4MinS: 1560 case IrOpcode::kI32x4MinS:
1557 return MarkAsSimd128(node), VisitI32x4MinS(node); 1561 return MarkAsSimd128(node), VisitI32x4MinS(node);
1558 case IrOpcode::kI32x4MaxS: 1562 case IrOpcode::kI32x4MaxS:
1559 return MarkAsSimd128(node), VisitI32x4MaxS(node); 1563 return MarkAsSimd128(node), VisitI32x4MaxS(node);
1560 case IrOpcode::kI32x4Eq: 1564 case IrOpcode::kI32x4Eq:
1561 return MarkAsSimd1x4(node), VisitI32x4Eq(node); 1565 return MarkAsSimd1x4(node), VisitI32x4Eq(node);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 case IrOpcode::kI16x8Shl: 1600 case IrOpcode::kI16x8Shl:
1597 return MarkAsSimd128(node), VisitI16x8Shl(node); 1601 return MarkAsSimd128(node), VisitI16x8Shl(node);
1598 case IrOpcode::kI16x8ShrS: 1602 case IrOpcode::kI16x8ShrS:
1599 return MarkAsSimd128(node), VisitI16x8ShrS(node); 1603 return MarkAsSimd128(node), VisitI16x8ShrS(node);
1600 case IrOpcode::kI16x8SConvertI32x4: 1604 case IrOpcode::kI16x8SConvertI32x4:
1601 return MarkAsSimd128(node), VisitI16x8SConvertI32x4(node); 1605 return MarkAsSimd128(node), VisitI16x8SConvertI32x4(node);
1602 case IrOpcode::kI16x8Add: 1606 case IrOpcode::kI16x8Add:
1603 return MarkAsSimd128(node), VisitI16x8Add(node); 1607 return MarkAsSimd128(node), VisitI16x8Add(node);
1604 case IrOpcode::kI16x8AddSaturateS: 1608 case IrOpcode::kI16x8AddSaturateS:
1605 return MarkAsSimd128(node), VisitI16x8AddSaturateS(node); 1609 return MarkAsSimd128(node), VisitI16x8AddSaturateS(node);
1610 case IrOpcode::kI16x8AddHoriz:
1611 return MarkAsSimd128(node), VisitI16x8AddHoriz(node);
1606 case IrOpcode::kI16x8Sub: 1612 case IrOpcode::kI16x8Sub:
1607 return MarkAsSimd128(node), VisitI16x8Sub(node); 1613 return MarkAsSimd128(node), VisitI16x8Sub(node);
1608 case IrOpcode::kI16x8SubSaturateS: 1614 case IrOpcode::kI16x8SubSaturateS:
1609 return MarkAsSimd128(node), VisitI16x8SubSaturateS(node); 1615 return MarkAsSimd128(node), VisitI16x8SubSaturateS(node);
1610 case IrOpcode::kI16x8Mul: 1616 case IrOpcode::kI16x8Mul:
1611 return MarkAsSimd128(node), VisitI16x8Mul(node); 1617 return MarkAsSimd128(node), VisitI16x8Mul(node);
1612 case IrOpcode::kI16x8MinS: 1618 case IrOpcode::kI16x8MinS:
1613 return MarkAsSimd128(node), VisitI16x8MinS(node); 1619 return MarkAsSimd128(node), VisitI16x8MinS(node);
1614 case IrOpcode::kI16x8MaxS: 1620 case IrOpcode::kI16x8MaxS:
1615 return MarkAsSimd128(node), VisitI16x8MaxS(node); 1621 return MarkAsSimd128(node), VisitI16x8MaxS(node);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 case IrOpcode::kI8x16Shl: 1658 case IrOpcode::kI8x16Shl:
1653 return MarkAsSimd128(node), VisitI8x16Shl(node); 1659 return MarkAsSimd128(node), VisitI8x16Shl(node);
1654 case IrOpcode::kI8x16ShrS: 1660 case IrOpcode::kI8x16ShrS:
1655 return MarkAsSimd128(node), VisitI8x16ShrS(node); 1661 return MarkAsSimd128(node), VisitI8x16ShrS(node);
1656 case IrOpcode::kI8x16SConvertI16x8: 1662 case IrOpcode::kI8x16SConvertI16x8:
1657 return MarkAsSimd128(node), VisitI8x16SConvertI16x8(node); 1663 return MarkAsSimd128(node), VisitI8x16SConvertI16x8(node);
1658 case IrOpcode::kI8x16Add: 1664 case IrOpcode::kI8x16Add:
1659 return MarkAsSimd128(node), VisitI8x16Add(node); 1665 return MarkAsSimd128(node), VisitI8x16Add(node);
1660 case IrOpcode::kI8x16AddSaturateS: 1666 case IrOpcode::kI8x16AddSaturateS:
1661 return MarkAsSimd128(node), VisitI8x16AddSaturateS(node); 1667 return MarkAsSimd128(node), VisitI8x16AddSaturateS(node);
1668 case IrOpcode::kI8x16AddHoriz:
1669 return MarkAsSimd128(node), VisitI8x16AddHoriz(node);
1662 case IrOpcode::kI8x16Sub: 1670 case IrOpcode::kI8x16Sub:
1663 return MarkAsSimd128(node), VisitI8x16Sub(node); 1671 return MarkAsSimd128(node), VisitI8x16Sub(node);
1664 case IrOpcode::kI8x16SubSaturateS: 1672 case IrOpcode::kI8x16SubSaturateS:
1665 return MarkAsSimd128(node), VisitI8x16SubSaturateS(node); 1673 return MarkAsSimd128(node), VisitI8x16SubSaturateS(node);
1666 case IrOpcode::kI8x16Mul: 1674 case IrOpcode::kI8x16Mul:
1667 return MarkAsSimd128(node), VisitI8x16Mul(node); 1675 return MarkAsSimd128(node), VisitI8x16Mul(node);
1668 case IrOpcode::kI8x16MinS: 1676 case IrOpcode::kI8x16MinS:
1669 return MarkAsSimd128(node), VisitI8x16MinS(node); 1677 return MarkAsSimd128(node), VisitI8x16MinS(node);
1670 case IrOpcode::kI8x16MaxS: 1678 case IrOpcode::kI8x16MaxS:
1671 return MarkAsSimd128(node), VisitI8x16MaxS(node); 1679 return MarkAsSimd128(node), VisitI8x16MaxS(node);
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
2150 2158
2151 void InstructionSelector::VisitF32x4RecipSqrtApprox(Node* node) { 2159 void InstructionSelector::VisitF32x4RecipSqrtApprox(Node* node) {
2152 UNIMPLEMENTED(); 2160 UNIMPLEMENTED();
2153 } 2161 }
2154 2162
2155 void InstructionSelector::VisitF32x4RecipSqrtRefine(Node* node) { 2163 void InstructionSelector::VisitF32x4RecipSqrtRefine(Node* node) {
2156 UNIMPLEMENTED(); 2164 UNIMPLEMENTED();
2157 } 2165 }
2158 2166
2159 void InstructionSelector::VisitF32x4Add(Node* node) { UNIMPLEMENTED(); } 2167 void InstructionSelector::VisitF32x4Add(Node* node) { UNIMPLEMENTED(); }
2168 #endif // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
2160 2169
2170 #if !V8_TARGET_ARCH_ARM
2171 void InstructionSelector::VisitF32x4AddHoriz(Node* node) { UNIMPLEMENTED(); }
2172 #endif // !V8_TARGET_ARCH_ARM
2173
2174 #if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
2161 void InstructionSelector::VisitF32x4Sub(Node* node) { UNIMPLEMENTED(); } 2175 void InstructionSelector::VisitF32x4Sub(Node* node) { UNIMPLEMENTED(); }
2162 2176
2163 void InstructionSelector::VisitF32x4Mul(Node* node) { UNIMPLEMENTED(); } 2177 void InstructionSelector::VisitF32x4Mul(Node* node) { UNIMPLEMENTED(); }
2164 2178
2165 void InstructionSelector::VisitF32x4Max(Node* node) { UNIMPLEMENTED(); } 2179 void InstructionSelector::VisitF32x4Max(Node* node) { UNIMPLEMENTED(); }
2166 2180
2167 void InstructionSelector::VisitF32x4Min(Node* node) { UNIMPLEMENTED(); } 2181 void InstructionSelector::VisitF32x4Min(Node* node) { UNIMPLEMENTED(); }
2168 2182
2169 void InstructionSelector::VisitF32x4RecipApprox(Node* node) { UNIMPLEMENTED(); } 2183 void InstructionSelector::VisitF32x4RecipApprox(Node* node) { UNIMPLEMENTED(); }
2170 2184
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 void InstructionSelector::VisitI32x4Ne(Node* node) { UNIMPLEMENTED(); } 2224 void InstructionSelector::VisitI32x4Ne(Node* node) { UNIMPLEMENTED(); }
2211 2225
2212 void InstructionSelector::VisitI32x4MinU(Node* node) { UNIMPLEMENTED(); } 2226 void InstructionSelector::VisitI32x4MinU(Node* node) { UNIMPLEMENTED(); }
2213 2227
2214 void InstructionSelector::VisitI32x4MaxU(Node* node) { UNIMPLEMENTED(); } 2228 void InstructionSelector::VisitI32x4MaxU(Node* node) { UNIMPLEMENTED(); }
2215 2229
2216 void InstructionSelector::VisitI32x4ShrU(Node* node) { UNIMPLEMENTED(); } 2230 void InstructionSelector::VisitI32x4ShrU(Node* node) { UNIMPLEMENTED(); }
2217 #endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS && 2231 #endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS &&
2218 // !V8_TARGET_ARCH_MIPS64 2232 // !V8_TARGET_ARCH_MIPS64
2219 2233
2234 #if !V8_TARGET_ARCH_ARM
2235 void InstructionSelector::VisitI32x4AddHoriz(Node* node) { UNIMPLEMENTED(); }
2236 #endif // !V8_TARGET_ARCH_ARM
2237
2220 #if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64 2238 #if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
2221 void InstructionSelector::VisitI32x4SConvertF32x4(Node* node) { 2239 void InstructionSelector::VisitI32x4SConvertF32x4(Node* node) {
2222 UNIMPLEMENTED(); 2240 UNIMPLEMENTED();
2223 } 2241 }
2224 2242
2225 void InstructionSelector::VisitI32x4UConvertF32x4(Node* node) { 2243 void InstructionSelector::VisitI32x4UConvertF32x4(Node* node) {
2226 UNIMPLEMENTED(); 2244 UNIMPLEMENTED();
2227 } 2245 }
2228 #endif // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64 2246 #endif // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
2229 2247
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
2264 2282
2265 void InstructionSelector::VisitI16x8Shl(Node* node) { UNIMPLEMENTED(); } 2283 void InstructionSelector::VisitI16x8Shl(Node* node) { UNIMPLEMENTED(); }
2266 2284
2267 void InstructionSelector::VisitI16x8ShrS(Node* node) { UNIMPLEMENTED(); } 2285 void InstructionSelector::VisitI16x8ShrS(Node* node) { UNIMPLEMENTED(); }
2268 2286
2269 void InstructionSelector::VisitI16x8Add(Node* node) { UNIMPLEMENTED(); } 2287 void InstructionSelector::VisitI16x8Add(Node* node) { UNIMPLEMENTED(); }
2270 2288
2271 void InstructionSelector::VisitI16x8AddSaturateS(Node* node) { 2289 void InstructionSelector::VisitI16x8AddSaturateS(Node* node) {
2272 UNIMPLEMENTED(); 2290 UNIMPLEMENTED();
2273 } 2291 }
2292 #endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM
2274 2293
2294 #if !V8_TARGET_ARCH_ARM
2295 void InstructionSelector::VisitI16x8AddHoriz(Node* node) { UNIMPLEMENTED(); }
2296 #endif // !V8_TARGET_ARCH_ARM
2297
2298 #if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM
2275 void InstructionSelector::VisitI16x8Sub(Node* node) { UNIMPLEMENTED(); } 2299 void InstructionSelector::VisitI16x8Sub(Node* node) { UNIMPLEMENTED(); }
2276 2300
2277 void InstructionSelector::VisitI16x8SubSaturateS(Node* node) { 2301 void InstructionSelector::VisitI16x8SubSaturateS(Node* node) {
2278 UNIMPLEMENTED(); 2302 UNIMPLEMENTED();
2279 } 2303 }
2280 2304
2281 void InstructionSelector::VisitI16x8Mul(Node* node) { UNIMPLEMENTED(); } 2305 void InstructionSelector::VisitI16x8Mul(Node* node) { UNIMPLEMENTED(); }
2282 2306
2283 void InstructionSelector::VisitI16x8MinS(Node* node) { UNIMPLEMENTED(); } 2307 void InstructionSelector::VisitI16x8MinS(Node* node) { UNIMPLEMENTED(); }
2284 2308
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2358 UNIMPLEMENTED(); 2382 UNIMPLEMENTED();
2359 } 2383 }
2360 #endif // !V8_TARGET_ARCH_ARM 2384 #endif // !V8_TARGET_ARCH_ARM
2361 2385
2362 #if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM 2386 #if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM
2363 void InstructionSelector::VisitI8x16Add(Node* node) { UNIMPLEMENTED(); } 2387 void InstructionSelector::VisitI8x16Add(Node* node) { UNIMPLEMENTED(); }
2364 2388
2365 void InstructionSelector::VisitI8x16AddSaturateS(Node* node) { 2389 void InstructionSelector::VisitI8x16AddSaturateS(Node* node) {
2366 UNIMPLEMENTED(); 2390 UNIMPLEMENTED();
2367 } 2391 }
2392 #endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM
2368 2393
2394 #if !V8_TARGET_ARCH_ARM
2395 void InstructionSelector::VisitI8x16AddHoriz(Node* node) { UNIMPLEMENTED(); }
2396 #endif // !V8_TARGET_ARCH_ARM
2397
2398 #if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM
2369 void InstructionSelector::VisitI8x16Sub(Node* node) { UNIMPLEMENTED(); } 2399 void InstructionSelector::VisitI8x16Sub(Node* node) { UNIMPLEMENTED(); }
2370 2400
2371 void InstructionSelector::VisitI8x16SubSaturateS(Node* node) { 2401 void InstructionSelector::VisitI8x16SubSaturateS(Node* node) {
2372 UNIMPLEMENTED(); 2402 UNIMPLEMENTED();
2373 } 2403 }
2374 2404
2375 void InstructionSelector::VisitI8x16MinS(Node* node) { UNIMPLEMENTED(); } 2405 void InstructionSelector::VisitI8x16MinS(Node* node) { UNIMPLEMENTED(); }
2376 2406
2377 void InstructionSelector::VisitI8x16MaxS(Node* node) { UNIMPLEMENTED(); } 2407 void InstructionSelector::VisitI8x16MaxS(Node* node) { UNIMPLEMENTED(); }
2378 2408
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
2925 return new (instruction_zone()) FrameStateDescriptor( 2955 return new (instruction_zone()) FrameStateDescriptor(
2926 instruction_zone(), state_info.type(), state_info.bailout_id(), 2956 instruction_zone(), state_info.type(), state_info.bailout_id(),
2927 state_info.state_combine(), parameters, locals, stack, 2957 state_info.state_combine(), parameters, locals, stack,
2928 state_info.shared_info(), outer_state); 2958 state_info.shared_info(), outer_state);
2929 } 2959 }
2930 2960
2931 2961
2932 } // namespace compiler 2962 } // namespace compiler
2933 } // namespace internal 2963 } // namespace internal
2934 } // namespace v8 2964 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698