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

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1891243002: Subzero. ARM32. De-scalarizes icmp and fcmp for vectors. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 4 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/IceAssemblerARM32.h ('k') | src/IceInstARM32.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 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===// 1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===//
2 // 2 //
3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 // 6 //
7 // Modified by the Subzero authors. 7 // Modified by the Subzero authors.
8 // 8 //
9 //===----------------------------------------------------------------------===// 9 //===----------------------------------------------------------------------===//
10 // 10 //
(...skipping 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after
2415 // VBSL (register) - ARM section A8.8.290, encoding A1: 2415 // VBSL (register) - ARM section A8.8.290, encoding A1:
2416 // vbsl <Qd>, <Qn>, <Qm> 2416 // vbsl <Qd>, <Qn>, <Qm>
2417 // 2417 //
2418 // 111100110D01nnn0ddd00001N1M1mmm0 where Dddd=OpQd, Nnnn=OpQm, and Mmmm=OpQm. 2418 // 111100110D01nnn0ddd00001N1M1mmm0 where Dddd=OpQd, Nnnn=OpQm, and Mmmm=OpQm.
2419 constexpr const char *Vbslq = "vbslq"; 2419 constexpr const char *Vbslq = "vbslq";
2420 constexpr IValueT VbslqOpcode = B24 | B20 | B8 | B4; 2420 constexpr IValueT VbslqOpcode = B24 | B20 | B8 | B4;
2421 constexpr Type ElmtTy = IceType_i8; // emits sz=0 2421 constexpr Type ElmtTy = IceType_i8; // emits sz=0
2422 emitSIMDqqq(VbslqOpcode, ElmtTy, OpQd, OpQm, OpQn, Vbslq); 2422 emitSIMDqqq(VbslqOpcode, ElmtTy, OpQd, OpQm, OpQn, Vbslq);
2423 } 2423 }
2424 2424
2425 void AssemblerARM32::vceqqi(const Type ElmtTy, const Operand *OpQd,
2426 const Operand *OpQm, const Operand *OpQn) {
2427 // vceq (register) - ARM section A8.8.291, encoding A1:
2428 // vceq.<st> <Qd>, <Qn>, <Qm>
2429 //
2430 // 111100110Dssnnnndddd1000NQM1mmmm where Dddd=OpQd, Nnnn=OpQm, Mmmm=OpQm, and
2431 // st in [i8, i16, i32] where ss is the index.
2432 constexpr const char *Vceq = "vceq";
2433 constexpr IValueT VceqOpcode = B24 | B11 | B4;
2434 emitSIMDqqq(VceqOpcode, ElmtTy, OpQd, OpQm, OpQn, Vceq);
2435 }
2436
2437 void AssemblerARM32::vceqqs(const Operand *OpQd, const Operand *OpQm,
2438 const Operand *OpQn) {
2439 // vceq (register) - ARM section A8.8.291, encoding A2:
2440 // vceq.f32 <Qd>, <Qn>, <Qm>
2441 //
2442 // 111100100D00nnnndddd1110NQM0mmmm where Dddd=OpQd, Nnnn=OpQm, and Mmmm=OpQm.
2443 constexpr const char *Vceq = "vceq";
2444 constexpr IValueT VceqOpcode = B11 | B10 | B9;
2445 constexpr Type ElmtTy = IceType_i8; // encoded as 0b00
2446 emitSIMDqqq(VceqOpcode, ElmtTy, OpQd, OpQm, OpQn, Vceq);
2447 }
2448
2449 void AssemblerARM32::vcgeqi(const Type ElmtTy, const Operand *OpQd,
2450 const Operand *OpQm, const Operand *OpQn) {
2451 // vcge (register) - ARM section A8.8.293, encoding A1:
2452 // vcge.<st> <Qd>, <Qn>, <Qm>
2453 //
2454 // 1111001U0Dssnnnndddd0011NQM1mmmm where Dddd=OpQd, Nnnn=OpQm, Mmmm=OpQm,
2455 // 0=U, and st in [s8, s16, s32] where ss is the index.
2456 constexpr const char *Vcge = "vcge";
2457 constexpr IValueT VcgeOpcode = B9 | B8 | B4;
2458 emitSIMDqqq(VcgeOpcode, ElmtTy, OpQd, OpQm, OpQn, Vcge);
2459 }
2460
2461 void AssemblerARM32::vcugeqi(const Type ElmtTy, const Operand *OpQd,
2462 const Operand *OpQm, const Operand *OpQn) {
2463 // vcge (register) - ARM section A8.8.293, encoding A1:
2464 // vcge.<st> <Qd>, <Qn>, <Qm>
2465 //
2466 // 1111001U0Dssnnnndddd0011NQM1mmmm where Dddd=OpQd, Nnnn=OpQm, Mmmm=OpQm,
2467 // 1=U, and st in [u8, u16, u32] where ss is the index.
2468 constexpr const char *Vcge = "vcge";
2469 constexpr IValueT VcgeOpcode = B24 | B9 | B8 | B4;
2470 emitSIMDqqq(VcgeOpcode, ElmtTy, OpQd, OpQm, OpQn, Vcge);
2471 }
2472
2473 void AssemblerARM32::vcgeqs(const Operand *OpQd, const Operand *OpQm,
2474 const Operand *OpQn) {
2475 // vcge (register) - ARM section A8.8.293, encoding A2:
2476 // vcge.f32 <Qd>, <Qn>, <Qm>
2477 //
2478 // 111100110D00nnnndddd1110NQM0mmmm where Dddd=OpQd, Nnnn=OpQm, and Mmmm=OpQm.
2479 constexpr const char *Vcge = "vcge";
2480 constexpr IValueT VcgeOpcode = B24 | B11 | B10 | B9;
2481 constexpr Type ElmtTy = IceType_i8; // encoded as 0b00.
2482 emitSIMDqqq(VcgeOpcode, ElmtTy, OpQd, OpQm, OpQn, Vcge);
2483 }
2484
2485 void AssemblerARM32::vcgtqi(const Type ElmtTy, const Operand *OpQd,
2486 const Operand *OpQm, const Operand *OpQn) {
2487 // vcgt (register) - ARM section A8.8.295, encoding A1:
2488 // vcgt.<st> <Qd>, <Qn>, <Qm>
2489 //
2490 // 1111001U0Dssnnnndddd0011NQM0mmmm where Dddd=OpQd, Nnnn=OpQm, Mmmm=OpQm,
2491 // 0=U, and st in [s8, s16, s32] where ss is the index.
2492 constexpr const char *Vcge = "vcgt";
2493 constexpr IValueT VcgeOpcode = B9 | B8;
2494 emitSIMDqqq(VcgeOpcode, ElmtTy, OpQd, OpQm, OpQn, Vcge);
2495 }
2496
2497 void AssemblerARM32::vcugtqi(const Type ElmtTy, const Operand *OpQd,
2498 const Operand *OpQm, const Operand *OpQn) {
2499 // vcgt (register) - ARM section A8.8.295, encoding A1:
2500 // vcgt.<st> <Qd>, <Qn>, <Qm>
2501 //
2502 // 111100110Dssnnnndddd0011NQM0mmmm where Dddd=OpQd, Nnnn=OpQm, Mmmm=OpQm,
2503 // 1=U, and st in [u8, u16, u32] where ss is the index.
2504 constexpr const char *Vcge = "vcgt";
2505 constexpr IValueT VcgeOpcode = B24 | B9 | B8;
2506 emitSIMDqqq(VcgeOpcode, ElmtTy, OpQd, OpQm, OpQn, Vcge);
2507 }
2508
2509 void AssemblerARM32::vcgtqs(const Operand *OpQd, const Operand *OpQm,
2510 const Operand *OpQn) {
2511 // vcgt (register) - ARM section A8.8.295, encoding A2:
2512 // vcgt.f32 <Qd>, <Qn>, <Qm>
2513 //
2514 // 111100110D10nnnndddd1110NQM0mmmm where Dddd=OpQd, Nnnn=OpQm, and Mmmm=OpQm.
2515 constexpr const char *Vcge = "vcgt";
2516 constexpr IValueT VcgeOpcode = B24 | B21 | B11 | B10 | B9;
2517 constexpr Type ElmtTy = IceType_i8; // encoded as 0b00.
2518 emitSIMDqqq(VcgeOpcode, ElmtTy, OpQd, OpQm, OpQn, Vcge);
2519 }
2520
2425 void AssemblerARM32::vcmpd(const Operand *OpDd, const Operand *OpDm, 2521 void AssemblerARM32::vcmpd(const Operand *OpDd, const Operand *OpDm,
2426 CondARM32::Cond Cond) { 2522 CondARM32::Cond Cond) {
2427 constexpr const char *Vcmpd = "vcmpd"; 2523 constexpr const char *Vcmpd = "vcmpd";
2428 IValueT Dd = encodeDRegister(OpDd, "Dd", Vcmpd); 2524 IValueT Dd = encodeDRegister(OpDd, "Dd", Vcmpd);
2429 IValueT Dm = encodeDRegister(OpDm, "Dm", Vcmpd); 2525 IValueT Dm = encodeDRegister(OpDm, "Dm", Vcmpd);
2430 constexpr IValueT VcmpdOpcode = B23 | B21 | B20 | B18 | B6; 2526 constexpr IValueT VcmpdOpcode = B23 | B21 | B20 | B18 | B6;
2431 constexpr IValueT Dn = 0; 2527 constexpr IValueT Dn = 0;
2432 emitVFPddd(Cond, VcmpdOpcode, Dd, Dn, Dm); 2528 emitVFPddd(Cond, VcmpdOpcode, Dd, Dn, Dm);
2433 } 2529 }
2434 2530
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
3136 // vmul.f32 <Qd>, <Qn>, <Qm> 3232 // vmul.f32 <Qd>, <Qn>, <Qm>
3137 // 3233 //
3138 // 111100110D00nnn0ddd01101MqM1mmm0 where Dddd=Qd, Nnnn=Qn, and Mmmm=Qm. 3234 // 111100110D00nnn0ddd01101MqM1mmm0 where Dddd=Qd, Nnnn=Qn, and Mmmm=Qm.
3139 assert(OpQd->getType() == IceType_v4f32 && "vmulqf expects type <4 x float>"); 3235 assert(OpQd->getType() == IceType_v4f32 && "vmulqf expects type <4 x float>");
3140 constexpr const char *Vmulqf = "vmulqf"; 3236 constexpr const char *Vmulqf = "vmulqf";
3141 constexpr IValueT VmulqfOpcode = B24 | B11 | B8 | B4; 3237 constexpr IValueT VmulqfOpcode = B24 | B11 | B8 | B4;
3142 constexpr bool IsFloatTy = true; 3238 constexpr bool IsFloatTy = true;
3143 emitSIMDqqqBase(VmulqfOpcode, OpQd, OpQn, OpQm, IsFloatTy, Vmulqf); 3239 emitSIMDqqqBase(VmulqfOpcode, OpQd, OpQn, OpQm, IsFloatTy, Vmulqf);
3144 } 3240 }
3145 3241
3242 void AssemblerARM32::vmvnq(const Operand *OpQd, const Operand *OpQm) {
3243 // VMVN (integer) - ARM section A8.8.354, encoding A1:
3244 // vmvn <Qd>, <Qm>
3245 //
3246 // 111100111D110000dddd01011QM0mmmm where Dddd=Qd, Mmmm=Qm, and 1=Q.
3247 // TODO(jpp) xxx: unify
3248 constexpr const char *Vmvn = "vmvn";
3249 constexpr IValueT VmvnOpcode = B24 | B23 | B21 | B20 | B10 | B8 | B7;
3250 const IValueT Qd = encodeQRegister(OpQd, "Qd", Vmvn);
3251 constexpr IValueT Qn = 0;
3252 const IValueT Qm = encodeQRegister(OpQm, "Qm", Vmvn);
3253 constexpr bool UseQRegs = true;
3254 constexpr bool IsFloat = false;
3255 emitSIMDBase(VmvnOpcode, mapQRegToDReg(Qd), mapQRegToDReg(Qn),
3256 mapQRegToDReg(Qm), UseQRegs, IsFloat);
3257 }
3258
3146 void AssemblerARM32::vnegqs(Type ElmtTy, const Operand *OpQd, 3259 void AssemblerARM32::vnegqs(Type ElmtTy, const Operand *OpQd,
3147 const Operand *OpQm) { 3260 const Operand *OpQm) {
3148 // VNEG - ARM section A8.8.355, encoding A1: 3261 // VNEG - ARM section A8.8.355, encoding A1:
3149 // vneg.<dt> <Qd>, <Qm> 3262 // vneg.<dt> <Qd>, <Qm>
3150 // 3263 //
3151 // 111111111D11ss01dddd0F111QM0mmmm where Dddd=Qd, and Mmmm=Qm, and: 3264 // 111111111D11ss01dddd0F111QM0mmmm where Dddd=Qd, and Mmmm=Qm, and:
3152 // * dt=s8 -> 00=ss, 0=F 3265 // * dt=s8 -> 00=ss, 0=F
3153 // * dt=s16 -> 01=ss, 0=F 3266 // * dt=s16 -> 01=ss, 0=F
3154 // * dt=s32 -> 10=ss, 0=F 3267 // * dt=s32 -> 10=ss, 0=F
3155 // * dt=s32 -> 10=ss, 1=F 3268 // * dt=s32 -> 10=ss, 1=F
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
3455 constexpr const char *Vsqrts = "vsqrts"; 3568 constexpr const char *Vsqrts = "vsqrts";
3456 IValueT Sd = encodeSRegister(OpSd, "Sd", Vsqrts); 3569 IValueT Sd = encodeSRegister(OpSd, "Sd", Vsqrts);
3457 IValueT Sm = encodeSRegister(OpSm, "Sm", Vsqrts); 3570 IValueT Sm = encodeSRegister(OpSm, "Sm", Vsqrts);
3458 constexpr IValueT VsqrtsOpcode = B23 | B21 | B20 | B16 | B7 | B6; 3571 constexpr IValueT VsqrtsOpcode = B23 | B21 | B20 | B16 | B7 | B6;
3459 constexpr IValueT S0 = 0; 3572 constexpr IValueT S0 = 0;
3460 emitVFPsss(Cond, VsqrtsOpcode, Sd, S0, Sm); 3573 emitVFPsss(Cond, VsqrtsOpcode, Sd, S0, Sm);
3461 } 3574 }
3462 3575
3463 } // end of namespace ARM32 3576 } // end of namespace ARM32
3464 } // end of namespace Ice 3577 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceInstARM32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698