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

Side by Side Diff: src/arm/assembler-arm.cc

Issue 2804883008: [WASM SIMD] Implement horizontal add for float and integer types. (Closed)
Patch Set: Rebase, reformat. 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
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/constants-arm.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are 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 4468 matching lines...) Expand 10 before | Expand all | Expand 10 after
4479 } 4479 }
4480 4480
4481 void Assembler::vrsqrts(QwNeonRegister dst, QwNeonRegister src1, 4481 void Assembler::vrsqrts(QwNeonRegister dst, QwNeonRegister src1,
4482 QwNeonRegister src2) { 4482 QwNeonRegister src2) {
4483 DCHECK(IsEnabled(NEON)); 4483 DCHECK(IsEnabled(NEON));
4484 // Qd = vrsqrts(Qn, Qm) SIMD reciprocal square root refinement step. 4484 // Qd = vrsqrts(Qn, Qm) SIMD reciprocal square root refinement step.
4485 // Instruction details available in ARM DDI 0406C.b, A8-1040. 4485 // Instruction details available in ARM DDI 0406C.b, A8-1040.
4486 emit(EncodeNeonBinOp(VRSQRTS, dst, src1, src2)); 4486 emit(EncodeNeonBinOp(VRSQRTS, dst, src1, src2));
4487 } 4487 }
4488 4488
4489 enum NeonPairwiseOp { VPMIN, VPMAX }; 4489 enum NeonPairwiseOp { VPADD, VPMIN, VPMAX };
4490 4490
4491 static Instr EncodeNeonPairwiseOp(NeonPairwiseOp op, NeonDataType dt, 4491 static Instr EncodeNeonPairwiseOp(NeonPairwiseOp op, NeonDataType dt,
4492 DwVfpRegister dst, DwVfpRegister src1, 4492 DwVfpRegister dst, DwVfpRegister src1,
4493 DwVfpRegister src2) { 4493 DwVfpRegister src2) {
4494 int op_encoding = 0; 4494 int op_encoding = 0;
4495 switch (op) { 4495 switch (op) {
4496 case VPADD:
4497 op_encoding = 0xB * B8 | B4;
4498 break;
4496 case VPMIN: 4499 case VPMIN:
4497 op_encoding = 0xA * B8 | B4; 4500 op_encoding = 0xA * B8 | B4;
4498 break; 4501 break;
4499 case VPMAX: 4502 case VPMAX:
4500 op_encoding = 0xA * B8; 4503 op_encoding = 0xA * B8;
4501 break; 4504 break;
4502 default: 4505 default:
4503 UNREACHABLE(); 4506 UNREACHABLE();
4504 break; 4507 break;
4505 } 4508 }
4506 int vd, d; 4509 int vd, d;
4507 dst.split_code(&vd, &d); 4510 dst.split_code(&vd, &d);
4508 int vn, n; 4511 int vn, n;
4509 src1.split_code(&vn, &n); 4512 src1.split_code(&vn, &n);
4510 int vm, m; 4513 int vm, m;
4511 src2.split_code(&vm, &m); 4514 src2.split_code(&vm, &m);
4512 int size = NeonSz(dt); 4515 int size = NeonSz(dt);
4513 int u = NeonU(dt); 4516 int u = NeonU(dt);
4514 return 0x1E4U * B23 | u * B24 | d * B22 | size * B20 | vn * B16 | vd * B12 | 4517 return 0x1E4U * B23 | u * B24 | d * B22 | size * B20 | vn * B16 | vd * B12 |
4515 n * B7 | m * B5 | vm | op_encoding; 4518 n * B7 | m * B5 | vm | op_encoding;
4516 } 4519 }
4517 4520
4521 void Assembler::vpadd(DwVfpRegister dst, DwVfpRegister src1,
4522 DwVfpRegister src2) {
4523 DCHECK(IsEnabled(NEON));
4524 // Dd = vpadd(Dn, Dm) SIMD integer pairwise ADD.
4525 // Instruction details available in ARM DDI 0406C.b, A8-982.
4526 int vd, d;
4527 dst.split_code(&vd, &d);
4528 int vn, n;
4529 src1.split_code(&vn, &n);
4530 int vm, m;
4531 src2.split_code(&vm, &m);
4532
4533 emit(0x1E6U * B23 | d * B22 | vn * B16 | vd * B12 | 0xD * B8 | n * B7 |
4534 m * B5 | vm);
4535 }
4536
4537 void Assembler::vpadd(NeonSize size, DwVfpRegister dst, DwVfpRegister src1,
4538 DwVfpRegister src2) {
4539 DCHECK(IsEnabled(NEON));
4540 // Dd = vpadd(Dn, Dm) SIMD integer pairwise ADD.
4541 // Instruction details available in ARM DDI 0406C.b, A8-980.
4542 emit(EncodeNeonPairwiseOp(VPADD, NeonSizeToDatatype(size), dst, src1, src2));
4543 }
4544
4518 void Assembler::vpmin(NeonDataType dt, DwVfpRegister dst, DwVfpRegister src1, 4545 void Assembler::vpmin(NeonDataType dt, DwVfpRegister dst, DwVfpRegister src1,
4519 DwVfpRegister src2) { 4546 DwVfpRegister src2) {
4520 DCHECK(IsEnabled(NEON)); 4547 DCHECK(IsEnabled(NEON));
4521 // Dd = vpmin(Dn, Dm) SIMD integer pairwise MIN. 4548 // Dd = vpmin(Dn, Dm) SIMD integer pairwise MIN.
4522 // Instruction details available in ARM DDI 0406C.b, A8-986. 4549 // Instruction details available in ARM DDI 0406C.b, A8-986.
4523 emit(EncodeNeonPairwiseOp(VPMIN, dt, dst, src1, src2)); 4550 emit(EncodeNeonPairwiseOp(VPMIN, dt, dst, src1, src2));
4524 } 4551 }
4525 4552
4526 void Assembler::vpmax(NeonDataType dt, DwVfpRegister dst, DwVfpRegister src1, 4553 void Assembler::vpmax(NeonDataType dt, DwVfpRegister dst, DwVfpRegister src1,
4527 DwVfpRegister src2) { 4554 DwVfpRegister src2) {
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
5235 } 5262 }
5236 5263
5237 void PatchingAssembler::FlushICache(Isolate* isolate) { 5264 void PatchingAssembler::FlushICache(Isolate* isolate) {
5238 Assembler::FlushICache(isolate, buffer_, buffer_size_ - kGap); 5265 Assembler::FlushICache(isolate, buffer_, buffer_size_ - kGap);
5239 } 5266 }
5240 5267
5241 } // namespace internal 5268 } // namespace internal
5242 } // namespace v8 5269 } // namespace v8
5243 5270
5244 #endif // V8_TARGET_ARCH_ARM 5271 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/constants-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698