OLD | NEW |
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/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/base/bits.h" | 6 #include "src/base/bits.h" |
7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 | 10 |
(...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2191 V(32x4) \ | 2191 V(32x4) \ |
2192 V(16x8) \ | 2192 V(16x8) \ |
2193 V(8x16) | 2193 V(8x16) |
2194 | 2194 |
2195 #define SIMD_ZERO_OP_LIST(V) \ | 2195 #define SIMD_ZERO_OP_LIST(V) \ |
2196 V(Simd128Zero) \ | 2196 V(Simd128Zero) \ |
2197 V(Simd1x4Zero) \ | 2197 V(Simd1x4Zero) \ |
2198 V(Simd1x8Zero) \ | 2198 V(Simd1x8Zero) \ |
2199 V(Simd1x16Zero) | 2199 V(Simd1x16Zero) |
2200 | 2200 |
2201 #define SIMD_UNOP_LIST(V) \ | 2201 #define SIMD_UNOP_LIST(V) \ |
2202 V(Float32x4FromInt32x4) \ | 2202 V(Float32x4FromInt32x4, kArmFloat32x4FromInt32x4) \ |
2203 V(Float32x4FromUint32x4) \ | 2203 V(Float32x4FromUint32x4, kArmFloat32x4FromUint32x4) \ |
2204 V(Float32x4Abs) \ | 2204 V(Float32x4Abs, kArmFloat32x4Abs) \ |
2205 V(Float32x4Neg) \ | 2205 V(Float32x4Neg, kArmFloat32x4Neg) \ |
2206 V(Int32x4FromFloat32x4) \ | 2206 V(Int32x4FromFloat32x4, kArmInt32x4FromFloat32x4) \ |
2207 V(Uint32x4FromFloat32x4) \ | 2207 V(Uint32x4FromFloat32x4, kArmUint32x4FromFloat32x4) \ |
2208 V(Int32x4Neg) \ | 2208 V(Int32x4Neg, kArmInt32x4Neg) \ |
2209 V(Int16x8Neg) \ | 2209 V(Int16x8Neg, kArmInt16x8Neg) \ |
2210 V(Int8x16Neg) \ | 2210 V(Int8x16Neg, kArmInt8x16Neg) \ |
2211 V(Simd128Not) | 2211 V(Simd128Not, kArmSimd128Not) \ |
| 2212 V(Simd1x4Not, kArmSimd128Not) \ |
| 2213 V(Simd1x4AnyTrue, kArmSimd1x4AnyTrue) \ |
| 2214 V(Simd1x4AllTrue, kArmSimd1x4AllTrue) \ |
| 2215 V(Simd1x8Not, kArmSimd128Not) \ |
| 2216 V(Simd1x8AnyTrue, kArmSimd1x8AnyTrue) \ |
| 2217 V(Simd1x8AllTrue, kArmSimd1x8AllTrue) \ |
| 2218 V(Simd1x16Not, kArmSimd128Not) \ |
| 2219 V(Simd1x16AnyTrue, kArmSimd1x16AnyTrue) \ |
| 2220 V(Simd1x16AllTrue, kArmSimd1x16AllTrue) |
2212 | 2221 |
2213 #define SIMD_BINOP_LIST(V) \ | 2222 #define SIMD_BINOP_LIST(V) \ |
2214 V(Float32x4Add) \ | 2223 V(Float32x4Add, kArmFloat32x4Add) \ |
2215 V(Float32x4Sub) \ | 2224 V(Float32x4Sub, kArmFloat32x4Sub) \ |
2216 V(Float32x4Equal) \ | 2225 V(Float32x4Equal, kArmFloat32x4Equal) \ |
2217 V(Float32x4NotEqual) \ | 2226 V(Float32x4NotEqual, kArmFloat32x4NotEqual) \ |
2218 V(Int32x4Add) \ | 2227 V(Int32x4Add, kArmInt32x4Add) \ |
2219 V(Int32x4Sub) \ | 2228 V(Int32x4Sub, kArmInt32x4Sub) \ |
2220 V(Int32x4Mul) \ | 2229 V(Int32x4Mul, kArmInt32x4Mul) \ |
2221 V(Int32x4Min) \ | 2230 V(Int32x4Min, kArmInt32x4Min) \ |
2222 V(Int32x4Max) \ | 2231 V(Int32x4Max, kArmInt32x4Max) \ |
2223 V(Int32x4Equal) \ | 2232 V(Int32x4Equal, kArmInt32x4Equal) \ |
2224 V(Int32x4NotEqual) \ | 2233 V(Int32x4NotEqual, kArmInt32x4NotEqual) \ |
2225 V(Int32x4GreaterThan) \ | 2234 V(Int32x4GreaterThan, kArmInt32x4GreaterThan) \ |
2226 V(Int32x4GreaterThanOrEqual) \ | 2235 V(Int32x4GreaterThanOrEqual, kArmInt32x4GreaterThanOrEqual) \ |
2227 V(Uint32x4Min) \ | 2236 V(Uint32x4Min, kArmUint32x4Min) \ |
2228 V(Uint32x4Max) \ | 2237 V(Uint32x4Max, kArmUint32x4Max) \ |
2229 V(Uint32x4GreaterThan) \ | 2238 V(Uint32x4GreaterThan, kArmUint32x4GreaterThan) \ |
2230 V(Uint32x4GreaterThanOrEqual) \ | 2239 V(Uint32x4GreaterThanOrEqual, kArmUint32x4GreaterThanOrEqual) \ |
2231 V(Int16x8Add) \ | 2240 V(Int16x8Add, kArmInt16x8Add) \ |
2232 V(Int16x8AddSaturate) \ | 2241 V(Int16x8AddSaturate, kArmInt16x8AddSaturate) \ |
2233 V(Int16x8Sub) \ | 2242 V(Int16x8Sub, kArmInt16x8Sub) \ |
2234 V(Int16x8SubSaturate) \ | 2243 V(Int16x8SubSaturate, kArmInt16x8SubSaturate) \ |
2235 V(Int16x8Mul) \ | 2244 V(Int16x8Mul, kArmInt16x8Mul) \ |
2236 V(Int16x8Min) \ | 2245 V(Int16x8Min, kArmInt16x8Min) \ |
2237 V(Int16x8Max) \ | 2246 V(Int16x8Max, kArmInt16x8Max) \ |
2238 V(Int16x8Equal) \ | 2247 V(Int16x8Equal, kArmInt16x8Equal) \ |
2239 V(Int16x8NotEqual) \ | 2248 V(Int16x8NotEqual, kArmInt16x8NotEqual) \ |
2240 V(Int16x8GreaterThan) \ | 2249 V(Int16x8GreaterThan, kArmInt16x8GreaterThan) \ |
2241 V(Int16x8GreaterThanOrEqual) \ | 2250 V(Int16x8GreaterThanOrEqual, kArmInt16x8GreaterThanOrEqual) \ |
2242 V(Uint16x8AddSaturate) \ | 2251 V(Uint16x8AddSaturate, kArmUint16x8AddSaturate) \ |
2243 V(Uint16x8SubSaturate) \ | 2252 V(Uint16x8SubSaturate, kArmUint16x8SubSaturate) \ |
2244 V(Uint16x8Min) \ | 2253 V(Uint16x8Min, kArmUint16x8Min) \ |
2245 V(Uint16x8Max) \ | 2254 V(Uint16x8Max, kArmUint16x8Max) \ |
2246 V(Uint16x8GreaterThan) \ | 2255 V(Uint16x8GreaterThan, kArmUint16x8GreaterThan) \ |
2247 V(Uint16x8GreaterThanOrEqual) \ | 2256 V(Uint16x8GreaterThanOrEqual, kArmUint16x8GreaterThanOrEqual) \ |
2248 V(Int8x16Add) \ | 2257 V(Int8x16Add, kArmInt8x16Add) \ |
2249 V(Int8x16AddSaturate) \ | 2258 V(Int8x16AddSaturate, kArmInt8x16AddSaturate) \ |
2250 V(Int8x16Sub) \ | 2259 V(Int8x16Sub, kArmInt8x16Sub) \ |
2251 V(Int8x16SubSaturate) \ | 2260 V(Int8x16SubSaturate, kArmInt8x16SubSaturate) \ |
2252 V(Int8x16Mul) \ | 2261 V(Int8x16Mul, kArmInt8x16Mul) \ |
2253 V(Int8x16Min) \ | 2262 V(Int8x16Min, kArmInt8x16Min) \ |
2254 V(Int8x16Max) \ | 2263 V(Int8x16Max, kArmInt8x16Max) \ |
2255 V(Int8x16Equal) \ | 2264 V(Int8x16Equal, kArmInt8x16Equal) \ |
2256 V(Int8x16NotEqual) \ | 2265 V(Int8x16NotEqual, kArmInt8x16NotEqual) \ |
2257 V(Int8x16GreaterThan) \ | 2266 V(Int8x16GreaterThan, kArmInt8x16GreaterThan) \ |
2258 V(Int8x16GreaterThanOrEqual) \ | 2267 V(Int8x16GreaterThanOrEqual, kArmInt8x16GreaterThanOrEqual) \ |
2259 V(Uint8x16AddSaturate) \ | 2268 V(Uint8x16AddSaturate, kArmUint8x16AddSaturate) \ |
2260 V(Uint8x16SubSaturate) \ | 2269 V(Uint8x16SubSaturate, kArmUint8x16SubSaturate) \ |
2261 V(Uint8x16Min) \ | 2270 V(Uint8x16Min, kArmUint8x16Min) \ |
2262 V(Uint8x16Max) \ | 2271 V(Uint8x16Max, kArmUint8x16Max) \ |
2263 V(Uint8x16GreaterThan) \ | 2272 V(Uint8x16GreaterThan, kArmUint8x16GreaterThan) \ |
2264 V(Uint8x16GreaterThanOrEqual) \ | 2273 V(Uint8x16GreaterThanOrEqual, kArmUint8x16GreaterThanOrEqual) \ |
2265 V(Simd128And) \ | 2274 V(Simd128And, kArmSimd128And) \ |
2266 V(Simd128Or) \ | 2275 V(Simd128Or, kArmSimd128Or) \ |
2267 V(Simd128Xor) | 2276 V(Simd128Xor, kArmSimd128Xor) \ |
| 2277 V(Simd1x4And, kArmSimd128And) \ |
| 2278 V(Simd1x4Or, kArmSimd128Or) \ |
| 2279 V(Simd1x4Xor, kArmSimd128Xor) \ |
| 2280 V(Simd1x8And, kArmSimd128And) \ |
| 2281 V(Simd1x8Or, kArmSimd128Or) \ |
| 2282 V(Simd1x8Xor, kArmSimd128Xor) \ |
| 2283 V(Simd1x16And, kArmSimd128And) \ |
| 2284 V(Simd1x16Or, kArmSimd128Or) \ |
| 2285 V(Simd1x16Xor, kArmSimd128Xor) |
2268 | 2286 |
2269 #define SIMD_SHIFT_OP_LIST(V) \ | 2287 #define SIMD_SHIFT_OP_LIST(V) \ |
2270 V(Int32x4ShiftLeftByScalar) \ | 2288 V(Int32x4ShiftLeftByScalar) \ |
2271 V(Int32x4ShiftRightByScalar) \ | 2289 V(Int32x4ShiftRightByScalar) \ |
2272 V(Uint32x4ShiftRightByScalar) \ | 2290 V(Uint32x4ShiftRightByScalar) \ |
2273 V(Int16x8ShiftLeftByScalar) \ | 2291 V(Int16x8ShiftLeftByScalar) \ |
2274 V(Int16x8ShiftRightByScalar) \ | 2292 V(Int16x8ShiftRightByScalar) \ |
2275 V(Uint16x8ShiftRightByScalar) \ | 2293 V(Uint16x8ShiftRightByScalar) \ |
2276 V(Int8x16ShiftLeftByScalar) \ | 2294 V(Int8x16ShiftLeftByScalar) \ |
2277 V(Int8x16ShiftRightByScalar) \ | 2295 V(Int8x16ShiftRightByScalar) \ |
(...skipping 21 matching lines...) Expand all Loading... |
2299 #undef SIMD_VISIT_REPLACE_LANE | 2317 #undef SIMD_VISIT_REPLACE_LANE |
2300 | 2318 |
2301 #define SIMD_VISIT_ZERO_OP(Name) \ | 2319 #define SIMD_VISIT_ZERO_OP(Name) \ |
2302 void InstructionSelector::Visit##Name(Node* node) { \ | 2320 void InstructionSelector::Visit##Name(Node* node) { \ |
2303 ArmOperandGenerator g(this); \ | 2321 ArmOperandGenerator g(this); \ |
2304 Emit(kArmSimd128Zero, g.DefineAsRegister(node), g.DefineAsRegister(node)); \ | 2322 Emit(kArmSimd128Zero, g.DefineAsRegister(node), g.DefineAsRegister(node)); \ |
2305 } | 2323 } |
2306 SIMD_ZERO_OP_LIST(SIMD_VISIT_ZERO_OP) | 2324 SIMD_ZERO_OP_LIST(SIMD_VISIT_ZERO_OP) |
2307 #undef SIMD_VISIT_ZERO_OP | 2325 #undef SIMD_VISIT_ZERO_OP |
2308 | 2326 |
2309 #define SIMD_VISIT_UNOP(Name) \ | 2327 #define SIMD_VISIT_UNOP(Name, instruction) \ |
2310 void InstructionSelector::Visit##Name(Node* node) { \ | 2328 void InstructionSelector::Visit##Name(Node* node) { \ |
2311 VisitRR(this, kArm##Name, node); \ | 2329 VisitRR(this, instruction, node); \ |
2312 } | 2330 } |
2313 SIMD_UNOP_LIST(SIMD_VISIT_UNOP) | 2331 SIMD_UNOP_LIST(SIMD_VISIT_UNOP) |
2314 #undef SIMD_VISIT_UNOP | 2332 #undef SIMD_VISIT_UNOP |
2315 | 2333 |
2316 #define SIMD_VISIT_BINOP(Name) \ | 2334 #define SIMD_VISIT_BINOP(Name, instruction) \ |
2317 void InstructionSelector::Visit##Name(Node* node) { \ | 2335 void InstructionSelector::Visit##Name(Node* node) { \ |
2318 VisitRRR(this, kArm##Name, node); \ | 2336 VisitRRR(this, instruction, node); \ |
2319 } | 2337 } |
2320 SIMD_BINOP_LIST(SIMD_VISIT_BINOP) | 2338 SIMD_BINOP_LIST(SIMD_VISIT_BINOP) |
2321 #undef SIMD_VISIT_BINOP | 2339 #undef SIMD_VISIT_BINOP |
2322 | 2340 |
2323 #define SIMD_VISIT_SHIFT_OP(Name) \ | 2341 #define SIMD_VISIT_SHIFT_OP(Name) \ |
2324 void InstructionSelector::Visit##Name(Node* node) { \ | 2342 void InstructionSelector::Visit##Name(Node* node) { \ |
2325 VisitRRI(this, kArm##Name, node); \ | 2343 VisitRRI(this, kArm##Name, node); \ |
2326 } | 2344 } |
2327 SIMD_SHIFT_OP_LIST(SIMD_VISIT_SHIFT_OP) | 2345 SIMD_SHIFT_OP_LIST(SIMD_VISIT_SHIFT_OP) |
2328 #undef SIMD_VISIT_SHIFT_OP | 2346 #undef SIMD_VISIT_SHIFT_OP |
2329 | 2347 |
2330 #define SIMD_VISIT_SELECT_OP(format) \ | 2348 #define SIMD_VISIT_SELECT_OP(format) \ |
2331 void InstructionSelector::VisitSimd##format##Select(Node* node) { \ | 2349 void InstructionSelector::VisitSimd##format##Select(Node* node) { \ |
2332 VisitRRRR(this, kArmSimd##format##Select, node); \ | 2350 VisitRRRR(this, kArmSimd128Select, node); \ |
2333 } | 2351 } |
2334 SIMD_FORMAT_LIST(SIMD_VISIT_SELECT_OP) | 2352 SIMD_FORMAT_LIST(SIMD_VISIT_SELECT_OP) |
2335 #undef SIMD_VISIT_SELECT_OP | 2353 #undef SIMD_VISIT_SELECT_OP |
2336 | 2354 |
2337 // static | 2355 // static |
2338 MachineOperatorBuilder::Flags | 2356 MachineOperatorBuilder::Flags |
2339 InstructionSelector::SupportedMachineOperatorFlags() { | 2357 InstructionSelector::SupportedMachineOperatorFlags() { |
2340 MachineOperatorBuilder::Flags flags; | 2358 MachineOperatorBuilder::Flags flags; |
2341 if (CpuFeatures::IsSupported(SUDIV)) { | 2359 if (CpuFeatures::IsSupported(SUDIV)) { |
2342 // The sdiv and udiv instructions correctly return 0 if the divisor is 0, | 2360 // The sdiv and udiv instructions correctly return 0 if the divisor is 0, |
(...skipping 24 matching lines...) Expand all Loading... |
2367 Vector<MachineType> req_aligned = Vector<MachineType>::New(2); | 2385 Vector<MachineType> req_aligned = Vector<MachineType>::New(2); |
2368 req_aligned[0] = MachineType::Float32(); | 2386 req_aligned[0] = MachineType::Float32(); |
2369 req_aligned[1] = MachineType::Float64(); | 2387 req_aligned[1] = MachineType::Float64(); |
2370 return MachineOperatorBuilder::AlignmentRequirements:: | 2388 return MachineOperatorBuilder::AlignmentRequirements:: |
2371 SomeUnalignedAccessUnsupported(req_aligned, req_aligned); | 2389 SomeUnalignedAccessUnsupported(req_aligned, req_aligned); |
2372 } | 2390 } |
2373 | 2391 |
2374 } // namespace compiler | 2392 } // namespace compiler |
2375 } // namespace internal | 2393 } // namespace internal |
2376 } // namespace v8 | 2394 } // namespace v8 |
OLD | NEW |