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

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1634913005: Add VMLA (floating point) to the integrated ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 4 years, 10 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.cpp » ('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 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 assert(CondARM32::isDefined(Cond)); 1038 assert(CondARM32::isDefined(Cond));
1039 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9 | B8; 1039 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9 | B8;
1040 const IValueT Encoding = 1040 const IValueT Encoding =
1041 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | 1041 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) |
1042 (getYInRegYXXXX(Dd) << 22) | (getXXXXInRegYXXXX(Dn) << 16) | 1042 (getYInRegYXXXX(Dd) << 22) | (getXXXXInRegYXXXX(Dn) << 16) |
1043 (getXXXXInRegYXXXX(Dd) << 12) | (getYInRegYXXXX(Dn) << 7) | 1043 (getXXXXInRegYXXXX(Dd) << 12) | (getYInRegYXXXX(Dn) << 7) |
1044 (getYInRegYXXXX(Dm) << 5) | getXXXXInRegYXXXX(Dm); 1044 (getYInRegYXXXX(Dm) << 5) | getXXXXInRegYXXXX(Dm);
1045 emitInst(Encoding); 1045 emitInst(Encoding);
1046 } 1046 }
1047 1047
1048 void AssemblerARM32::emitVFPddd(CondARM32::Cond Cond, IValueT Opcode,
1049 const Operand *OpDd, const Operand *OpDn,
1050 const Operand *OpDm, const char *InstName) {
1051 IValueT Dd = encodeDRegister(OpDd, "Dd", InstName);
1052 IValueT Dn = encodeDRegister(OpDn, "Dn", InstName);
1053 IValueT Dm = encodeDRegister(OpDm, "Dm", InstName);
1054 emitVFPddd(Cond, Opcode, Dd, Dn, Dm);
1055 }
1056
1048 void AssemblerARM32::emitVFPsss(CondARM32::Cond Cond, IValueT Opcode, 1057 void AssemblerARM32::emitVFPsss(CondARM32::Cond Cond, IValueT Opcode,
1049 IValueT Sd, IValueT Sn, IValueT Sm) { 1058 IValueT Sd, IValueT Sn, IValueT Sm) {
1050 assert(Sd < RegARM32::getNumSRegs()); 1059 assert(Sd < RegARM32::getNumSRegs());
1051 assert(Sn < RegARM32::getNumSRegs()); 1060 assert(Sn < RegARM32::getNumSRegs());
1052 assert(Sm < RegARM32::getNumSRegs()); 1061 assert(Sm < RegARM32::getNumSRegs());
1053 assert(CondARM32::isDefined(Cond)); 1062 assert(CondARM32::isDefined(Cond));
1054 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9; 1063 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9;
1055 const IValueT Encoding = 1064 const IValueT Encoding =
1056 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | 1065 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) |
1057 (getYInRegXXXXY(Sd) << 22) | (getXXXXInRegXXXXY(Sn) << 16) | 1066 (getYInRegXXXXY(Sd) << 22) | (getXXXXInRegXXXXY(Sn) << 16) |
1058 (getXXXXInRegXXXXY(Sd) << 12) | (getYInRegXXXXY(Sn) << 7) | 1067 (getXXXXInRegXXXXY(Sd) << 12) | (getYInRegXXXXY(Sn) << 7) |
1059 (getYInRegXXXXY(Sm) << 5) | getXXXXInRegXXXXY(Sm); 1068 (getYInRegXXXXY(Sm) << 5) | getXXXXInRegXXXXY(Sm);
1060 emitInst(Encoding); 1069 emitInst(Encoding);
1061 } 1070 }
1062 1071
1072 void AssemblerARM32::emitVFPsss(CondARM32::Cond Cond, IValueT Opcode,
1073 const Operand *OpSd, const Operand *OpSn,
1074 const Operand *OpSm, const char *InstName) {
1075 const IValueT Sd = encodeSRegister(OpSd, "Sd", InstName);
1076 const IValueT Sn = encodeSRegister(OpSn, "Sn", InstName);
1077 const IValueT Sm = encodeSRegister(OpSm, "Sm", InstName);
1078 emitVFPsss(Cond, Opcode, Sd, Sn, Sm);
1079 }
1080
1063 void AssemblerARM32::adc(const Operand *OpRd, const Operand *OpRn, 1081 void AssemblerARM32::adc(const Operand *OpRd, const Operand *OpRn,
1064 const Operand *OpSrc1, bool SetFlags, 1082 const Operand *OpSrc1, bool SetFlags,
1065 CondARM32::Cond Cond) { 1083 CondARM32::Cond Cond) {
1066 // ADC (register) - ARM section 18.8.2, encoding A1: 1084 // ADC (register) - ARM section 18.8.2, encoding A1:
1067 // adc{s}<c> <Rd>, <Rn>, <Rm>{, <shift>} 1085 // adc{s}<c> <Rd>, <Rn>, <Rm>{, <shift>}
1068 // 1086 //
1069 // cccc0000101snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, 1087 // cccc0000101snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn,
1070 // mmmm=Rm, iiiii=Shift, tt=ShiftKind, and s=SetFlags. 1088 // mmmm=Rm, iiiii=Shift, tt=ShiftKind, and s=SetFlags.
1071 // 1089 //
1072 // ADC (Immediate) - ARM section A8.8.1, encoding A1: 1090 // ADC (Immediate) - ARM section A8.8.1, encoding A1:
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
2068 } 2086 }
2069 2087
2070 void AssemblerARM32::vadds(const Operand *OpSd, const Operand *OpSn, 2088 void AssemblerARM32::vadds(const Operand *OpSd, const Operand *OpSn,
2071 const Operand *OpSm, CondARM32::Cond Cond) { 2089 const Operand *OpSm, CondARM32::Cond Cond) {
2072 // VADD (floating-point) - ARM section A8.8.283, encoding A2: 2090 // VADD (floating-point) - ARM section A8.8.283, encoding A2:
2073 // vadd<c>.f32 <Sd>, <Sn>, <Sm> 2091 // vadd<c>.f32 <Sd>, <Sn>, <Sm>
2074 // 2092 //
2075 // cccc11100D11nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, 2093 // cccc11100D11nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn,
2076 // and mmmmM=Rm. 2094 // and mmmmM=Rm.
2077 constexpr const char *Vadds = "vadds"; 2095 constexpr const char *Vadds = "vadds";
2078 IValueT Sd = encodeSRegister(OpSd, "Sd", Vadds);
2079 IValueT Sn = encodeSRegister(OpSn, "Sn", Vadds);
2080 IValueT Sm = encodeSRegister(OpSm, "Sm", Vadds);
2081 constexpr IValueT VaddsOpcode = B21 | B20; 2096 constexpr IValueT VaddsOpcode = B21 | B20;
2082 emitVFPsss(Cond, VaddsOpcode, Sd, Sn, Sm); 2097 emitVFPsss(Cond, VaddsOpcode, OpSd, OpSn, OpSm, Vadds);
2083 } 2098 }
2084 2099
2085 void AssemblerARM32::vaddd(const Operand *OpDd, const Operand *OpDn, 2100 void AssemblerARM32::vaddd(const Operand *OpDd, const Operand *OpDn,
2086 const Operand *OpDm, CondARM32::Cond Cond) { 2101 const Operand *OpDm, CondARM32::Cond Cond) {
2087 // VADD (floating-point) - ARM section A8.8.283, encoding A2: 2102 // VADD (floating-point) - ARM section A8.8.283, encoding A2:
2088 // vadd<c>.f64 <Dd>, <Dn>, <Dm> 2103 // vadd<c>.f64 <Dd>, <Dn>, <Dm>
2089 // 2104 //
2090 // cccc11100D11nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, 2105 // cccc11100D11nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn,
2091 // and Mmmmm=Rm. 2106 // and Mmmmm=Rm.
2092 constexpr const char *Vaddd = "vaddd"; 2107 constexpr const char *Vaddd = "vaddd";
2093 IValueT Dd = encodeDRegister(OpDd, "Dd", Vaddd);
2094 IValueT Dn = encodeDRegister(OpDn, "Dn", Vaddd);
2095 IValueT Dm = encodeDRegister(OpDm, "Dm", Vaddd);
2096 constexpr IValueT VadddOpcode = B21 | B20; 2108 constexpr IValueT VadddOpcode = B21 | B20;
2097 emitVFPddd(Cond, VadddOpcode, Dd, Dn, Dm); 2109 emitVFPddd(Cond, VadddOpcode, OpDd, OpDn, OpDm, Vaddd);
2098 } 2110 }
2099 2111
2100 void AssemblerARM32::vcmpd(const Operand *OpDd, const Operand *OpDm, 2112 void AssemblerARM32::vcmpd(const Operand *OpDd, const Operand *OpDm,
2101 CondARM32::Cond Cond) { 2113 CondARM32::Cond Cond) {
2102 constexpr const char *Vcmpd = "vcmpd"; 2114 constexpr const char *Vcmpd = "vcmpd";
2103 IValueT Dd = encodeDRegister(OpDd, "Dd", Vcmpd); 2115 IValueT Dd = encodeDRegister(OpDd, "Dd", Vcmpd);
2104 IValueT Dm = encodeDRegister(OpDm, "Dm", Vcmpd); 2116 IValueT Dm = encodeDRegister(OpDm, "Dm", Vcmpd);
2105 constexpr IValueT VcmpdOpcode = B23 | B21 | B20 | B18 | B6; 2117 constexpr IValueT VcmpdOpcode = B23 | B21 | B20 | B18 | B6;
2106 constexpr IValueT Dn = 0; 2118 constexpr IValueT Dn = 0;
2107 emitVFPddd(Cond, VcmpdOpcode, Dd, Dn, Dm); 2119 emitVFPddd(Cond, VcmpdOpcode, Dd, Dn, Dm);
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
2298 } 2310 }
2299 2311
2300 void AssemblerARM32::vdivs(const Operand *OpSd, const Operand *OpSn, 2312 void AssemblerARM32::vdivs(const Operand *OpSd, const Operand *OpSn,
2301 const Operand *OpSm, CondARM32::Cond Cond) { 2313 const Operand *OpSm, CondARM32::Cond Cond) {
2302 // VDIV (floating-point) - ARM section A8.8.283, encoding A2: 2314 // VDIV (floating-point) - ARM section A8.8.283, encoding A2:
2303 // vdiv<c>.f32 <Sd>, <Sn>, <Sm> 2315 // vdiv<c>.f32 <Sd>, <Sn>, <Sm>
2304 // 2316 //
2305 // cccc11101D00nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, 2317 // cccc11101D00nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn,
2306 // and mmmmM=Rm. 2318 // and mmmmM=Rm.
2307 constexpr const char *Vdivs = "vdivs"; 2319 constexpr const char *Vdivs = "vdivs";
2308 IValueT Sd = encodeSRegister(OpSd, "Sd", Vdivs);
2309 IValueT Sn = encodeSRegister(OpSn, "Sn", Vdivs);
2310 IValueT Sm = encodeSRegister(OpSm, "Sm", Vdivs);
2311 constexpr IValueT VdivsOpcode = B23; 2320 constexpr IValueT VdivsOpcode = B23;
2312 emitVFPsss(Cond, VdivsOpcode, Sd, Sn, Sm); 2321 emitVFPsss(Cond, VdivsOpcode, OpSd, OpSn, OpSm, Vdivs);
2313 } 2322 }
2314 2323
2315 void AssemblerARM32::vdivd(const Operand *OpDd, const Operand *OpDn, 2324 void AssemblerARM32::vdivd(const Operand *OpDd, const Operand *OpDn,
2316 const Operand *OpDm, CondARM32::Cond Cond) { 2325 const Operand *OpDm, CondARM32::Cond Cond) {
2317 // VDIV (floating-point) - ARM section A8.8.283, encoding A2: 2326 // VDIV (floating-point) - ARM section A8.8.283, encoding A2:
2318 // vdiv<c>.f64 <Dd>, <Dn>, <Dm> 2327 // vdiv<c>.f64 <Dd>, <Dn>, <Dm>
2319 // 2328 //
2320 // cccc11101D00nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, 2329 // cccc11101D00nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn,
2321 // and Mmmmm=Rm. 2330 // and Mmmmm=Rm.
2322 constexpr const char *Vdivd = "vdivd"; 2331 constexpr const char *Vdivd = "vdivd";
2323 IValueT Dd = encodeDRegister(OpDd, "Dd", Vdivd);
2324 IValueT Dn = encodeDRegister(OpDn, "Dn", Vdivd);
2325 IValueT Dm = encodeDRegister(OpDm, "Dm", Vdivd);
2326 constexpr IValueT VdivdOpcode = B23; 2332 constexpr IValueT VdivdOpcode = B23;
2327 emitVFPddd(Cond, VdivdOpcode, Dd, Dn, Dm); 2333 emitVFPddd(Cond, VdivdOpcode, OpDd, OpDn, OpDm, Vdivd);
2328 } 2334 }
2329 2335
2330 void AssemblerARM32::veord(const Operand *OpDd, const Operand *OpDn, 2336 void AssemblerARM32::veord(const Operand *OpDd, const Operand *OpDn,
2331 const Operand *OpDm) { 2337 const Operand *OpDm) {
2332 // VEOR - ARM secdtion A8.8.315, encoding A1: 2338 // VEOR - ARM secdtion A8.8.315, encoding A1:
2333 // veor<c> <Dd>, <Dn>, <Dm> 2339 // veor<c> <Dd>, <Dn>, <Dm>
2334 // 2340 //
2335 // 111100110D00nnnndddd0001N0M1mmmm where Ddddd=Dd, Nnnnn=Dn, and Mmmmm=Dm. 2341 // 111100110D00nnnndddd0001N0M1mmmm where Ddddd=Dd, Nnnnn=Dn, and Mmmmm=Dm.
2336 constexpr const char *Veord = "veord"; 2342 constexpr const char *Veord = "veord";
2337 IValueT Dd = encodeDRegister(OpDd, "Dd", Veord); 2343 IValueT Dd = encodeDRegister(OpDd, "Dd", Veord);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
2437 IValueT Rt = encodeGPRegister(OpRt, "Rt", Vmovsr); 2443 IValueT Rt = encodeGPRegister(OpRt, "Rt", Vmovsr);
2438 assert(Sn < RegARM32::getNumSRegs()); 2444 assert(Sn < RegARM32::getNumSRegs());
2439 assert(Rt < RegARM32::getNumGPRegs()); 2445 assert(Rt < RegARM32::getNumGPRegs());
2440 assert(CondARM32::isDefined(Cond)); 2446 assert(CondARM32::isDefined(Cond));
2441 IValueT Encoding = (encodeCondition(Cond) << kConditionShift) | B27 | B26 | 2447 IValueT Encoding = (encodeCondition(Cond) << kConditionShift) | B27 | B26 |
2442 B25 | B11 | B9 | B4 | (getXXXXInRegXXXXY(Sn) << 16) | 2448 B25 | B11 | B9 | B4 | (getXXXXInRegXXXXY(Sn) << 16) |
2443 (Rt << kRdShift) | (getYInRegXXXXY(Sn) << 7); 2449 (Rt << kRdShift) | (getYInRegXXXXY(Sn) << 7);
2444 emitInst(Encoding); 2450 emitInst(Encoding);
2445 } 2451 }
2446 2452
2453 void AssemblerARM32::vmlad(const Operand *OpDd, const Operand *OpDn,
2454 const Operand *OpDm, CondARM32::Cond Cond) {
2455 // VMLA, VMLS (floating-point), ARM section A8.8.337, encoding A2:
2456 // vmla<c>.f64 <Dd>, <Dn>, <Dm>
2457 //
2458 // cccc11100d00nnnndddd1011n0M0mmmm where cccc=Cond, Ddddd=Dd, Nnnnn=Dn, and
2459 // Mmmmm=Dm
2460 constexpr const char *Vmlad = "vmlad";
2461 constexpr IValueT VmladOpcode = 0;
2462 emitVFPddd(Cond, VmladOpcode, OpDd, OpDn, OpDm, Vmlad);
2463 }
2464
2465 void AssemblerARM32::vmlas(const Operand *OpSd, const Operand *OpSn,
2466 const Operand *OpSm, CondARM32::Cond Cond) {
2467 // VMLA, VMLS (floating-point), ARM section A8.8.337, encoding A2:
2468 // vmla<c>.f32 <Sd>, <Sn>, <Sm>
2469 //
2470 // cccc11100d00nnnndddd1010n0M0mmmm where cccc=Cond, ddddD=Sd, nnnnN=Sn, and
2471 // mmmmM=Sm
2472 constexpr const char *Vmlas = "vmlas";
2473 constexpr IValueT VmlasOpcode = 0;
2474 emitVFPsss(Cond, VmlasOpcode, OpSd, OpSn, OpSm, Vmlas);
2475 }
2476
2447 void AssemblerARM32::vmrsAPSR_nzcv(CondARM32::Cond Cond) { 2477 void AssemblerARM32::vmrsAPSR_nzcv(CondARM32::Cond Cond) {
2448 // MVRS - ARM section A*.8.348, encoding A1: 2478 // MVRS - ARM section A*.8.348, encoding A1:
2449 // vmrs<c> APSR_nzcv, FPSCR 2479 // vmrs<c> APSR_nzcv, FPSCR
2450 // 2480 //
2451 // cccc111011110001tttt101000010000 where tttt=0x15 (i.e. when Rt=pc, use 2481 // cccc111011110001tttt101000010000 where tttt=0x15 (i.e. when Rt=pc, use
2452 // APSR_nzcv instead). 2482 // APSR_nzcv instead).
2453 assert(CondARM32::isDefined(Cond)); 2483 assert(CondARM32::isDefined(Cond));
2454 IValueT Encoding = B27 | B26 | B25 | B23 | B22 | B21 | B20 | B16 | B15 | B14 | 2484 IValueT Encoding = B27 | B26 | B25 | B23 | B22 | B21 | B20 | B16 | B15 | B14 |
2455 B13 | B12 | B11 | B9 | B4 | 2485 B13 | B12 | B11 | B9 | B4 |
2456 (encodeCondition(Cond) << kConditionShift); 2486 (encodeCondition(Cond) << kConditionShift);
2457 emitInst(Encoding); 2487 emitInst(Encoding);
2458 } 2488 }
2459 2489
2460 void AssemblerARM32::vmuls(const Operand *OpSd, const Operand *OpSn, 2490 void AssemblerARM32::vmuls(const Operand *OpSd, const Operand *OpSn,
2461 const Operand *OpSm, CondARM32::Cond Cond) { 2491 const Operand *OpSm, CondARM32::Cond Cond) {
2462 // VMUL (floating-point) - ARM section A8.8.351, encoding A2: 2492 // VMUL (floating-point) - ARM section A8.8.351, encoding A2:
2463 // vmul<c>.f32 <Sd>, <Sn>, <Sm> 2493 // vmul<c>.f32 <Sd>, <Sn>, <Sm>
2464 // 2494 //
2465 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, 2495 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn,
2466 // and mmmmM=Rm. 2496 // and mmmmM=Rm.
2467 constexpr const char *Vmuls = "vmuls"; 2497 constexpr const char *Vmuls = "vmuls";
2468 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmuls);
2469 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmuls);
2470 IValueT Sm = encodeSRegister(OpSm, "Sm", Vmuls);
2471 constexpr IValueT VmulsOpcode = B21; 2498 constexpr IValueT VmulsOpcode = B21;
2472 emitVFPsss(Cond, VmulsOpcode, Sd, Sn, Sm); 2499 emitVFPsss(Cond, VmulsOpcode, OpSd, OpSn, OpSm, Vmuls);
2473 } 2500 }
2474 2501
2475 void AssemblerARM32::vmuld(const Operand *OpDd, const Operand *OpDn, 2502 void AssemblerARM32::vmuld(const Operand *OpDd, const Operand *OpDn,
2476 const Operand *OpDm, CondARM32::Cond Cond) { 2503 const Operand *OpDm, CondARM32::Cond Cond) {
2477 // VMUL (floating-point) - ARM section A8.8.351, encoding A2: 2504 // VMUL (floating-point) - ARM section A8.8.351, encoding A2:
2478 // vmul<c>.f64 <Dd>, <Dn>, <Dm> 2505 // vmul<c>.f64 <Dd>, <Dn>, <Dm>
2479 // 2506 //
2480 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, 2507 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn,
2481 // and Mmmmm=Rm. 2508 // and Mmmmm=Rm.
2482 constexpr const char *Vmuld = "vmuld"; 2509 constexpr const char *Vmuld = "vmuld";
2483 IValueT Dd = encodeDRegister(OpDd, "Dd", Vmuld);
2484 IValueT Dn = encodeDRegister(OpDn, "Dn", Vmuld);
2485 IValueT Dm = encodeDRegister(OpDm, "Dm", Vmuld);
2486 constexpr IValueT VmuldOpcode = B21; 2510 constexpr IValueT VmuldOpcode = B21;
2487 emitVFPddd(Cond, VmuldOpcode, Dd, Dn, Dm); 2511 emitVFPddd(Cond, VmuldOpcode, OpDd, OpDn, OpDm, Vmuld);
2488 } 2512 }
2489 2513
2490 void AssemblerARM32::vstrd(const Operand *OpDd, const Operand *OpAddress, 2514 void AssemblerARM32::vstrd(const Operand *OpDd, const Operand *OpAddress,
2491 CondARM32::Cond Cond, const TargetInfo &TInfo) { 2515 CondARM32::Cond Cond, const TargetInfo &TInfo) {
2492 // VSTR - ARM section A8.8.413, encoding A1: 2516 // VSTR - ARM section A8.8.413, encoding A1:
2493 // vstr<c> <Dd>, [<Rn>{, #+/-<Imm>}] 2517 // vstr<c> <Dd>, [<Rn>{, #+/-<Imm>}]
2494 // 2518 //
2495 // cccc1101UD00nnnndddd1011iiiiiiii where cccc=Cond, nnnn=Rn, Ddddd=Rd, 2519 // cccc1101UD00nnnndddd1011iiiiiiii where cccc=Cond, nnnn=Rn, Ddddd=Rd,
2496 // iiiiiiii=abs(Imm >> 2), and U=1 if Imm>=0. 2520 // iiiiiiii=abs(Imm >> 2), and U=1 if Imm>=0.
2497 constexpr const char *Vstrd = "vstrd"; 2521 constexpr const char *Vstrd = "vstrd";
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
2531 } 2555 }
2532 2556
2533 void AssemblerARM32::vsubs(const Operand *OpSd, const Operand *OpSn, 2557 void AssemblerARM32::vsubs(const Operand *OpSd, const Operand *OpSn,
2534 const Operand *OpSm, CondARM32::Cond Cond) { 2558 const Operand *OpSm, CondARM32::Cond Cond) {
2535 // VSUB (floating-point) - ARM section A8.8.415, encoding A2: 2559 // VSUB (floating-point) - ARM section A8.8.415, encoding A2:
2536 // vsub<c>.f32 <Sd>, <Sn>, <Sm> 2560 // vsub<c>.f32 <Sd>, <Sn>, <Sm>
2537 // 2561 //
2538 // cccc11100D11nnnndddd101sN1M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, 2562 // cccc11100D11nnnndddd101sN1M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn,
2539 // and mmmmM=Rm. 2563 // and mmmmM=Rm.
2540 constexpr const char *Vsubs = "vsubs"; 2564 constexpr const char *Vsubs = "vsubs";
2541 IValueT Sd = encodeSRegister(OpSd, "Sd", Vsubs);
2542 IValueT Sn = encodeSRegister(OpSn, "Sn", Vsubs);
2543 IValueT Sm = encodeSRegister(OpSm, "Sm", Vsubs);
2544 constexpr IValueT VsubsOpcode = B21 | B20 | B6; 2565 constexpr IValueT VsubsOpcode = B21 | B20 | B6;
2545 emitVFPsss(Cond, VsubsOpcode, Sd, Sn, Sm); 2566 emitVFPsss(Cond, VsubsOpcode, OpSd, OpSn, OpSm, Vsubs);
2546 } 2567 }
2547 2568
2548 void AssemblerARM32::vsubd(const Operand *OpDd, const Operand *OpDn, 2569 void AssemblerARM32::vsubd(const Operand *OpDd, const Operand *OpDn,
2549 const Operand *OpDm, CondARM32::Cond Cond) { 2570 const Operand *OpDm, CondARM32::Cond Cond) {
2550 // VSUB (floating-point) - ARM section A8.8.415, encoding A2: 2571 // VSUB (floating-point) - ARM section A8.8.415, encoding A2:
2551 // vsub<c>.f64 <Dd>, <Dn>, <Dm> 2572 // vsub<c>.f64 <Dd>, <Dn>, <Dm>
2552 // 2573 //
2553 // cccc11100D11nnnndddd101sN1M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, 2574 // cccc11100D11nnnndddd101sN1M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn,
2554 // and Mmmmm=Rm. 2575 // and Mmmmm=Rm.
2555 constexpr const char *Vsubd = "vsubd"; 2576 constexpr const char *Vsubd = "vsubd";
2556 IValueT Dd = encodeDRegister(OpDd, "Dd", Vsubd);
2557 IValueT Dn = encodeDRegister(OpDn, "Dn", Vsubd);
2558 IValueT Dm = encodeDRegister(OpDm, "Dm", Vsubd);
2559 constexpr IValueT VsubdOpcode = B21 | B20 | B6; 2577 constexpr IValueT VsubdOpcode = B21 | B20 | B6;
2560 emitVFPddd(Cond, VsubdOpcode, Dd, Dn, Dm); 2578 emitVFPddd(Cond, VsubdOpcode, OpDd, OpDn, OpDm, Vsubd);
2561 } 2579 }
2562 2580
2563 void AssemblerARM32::emitVStackOp(CondARM32::Cond Cond, IValueT Opcode, 2581 void AssemblerARM32::emitVStackOp(CondARM32::Cond Cond, IValueT Opcode,
2564 const Variable *OpBaseReg, 2582 const Variable *OpBaseReg,
2565 SizeT NumConsecRegs) { 2583 SizeT NumConsecRegs) {
2566 const IValueT BaseReg = getEncodedSRegNum(OpBaseReg); 2584 const IValueT BaseReg = getEncodedSRegNum(OpBaseReg);
2567 const IValueT DLastBit = mask(BaseReg, 0, 1); // Last bit of base register. 2585 const IValueT DLastBit = mask(BaseReg, 0, 1); // Last bit of base register.
2568 const IValueT Rd = mask(BaseReg, 1, 4); // Top 4 bits of base register. 2586 const IValueT Rd = mask(BaseReg, 1, 4); // Top 4 bits of base register.
2569 assert(0 < NumConsecRegs); 2587 assert(0 < NumConsecRegs);
2570 (void)VpushVpopMaxConsecRegs; 2588 (void)VpushVpopMaxConsecRegs;
(...skipping 30 matching lines...) Expand all
2601 // 2619 //
2602 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and 2620 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and
2603 // iiiiiiii=NumConsecRegs. 2621 // iiiiiiii=NumConsecRegs.
2604 constexpr IValueT VpushOpcode = 2622 constexpr IValueT VpushOpcode =
2605 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; 2623 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9;
2606 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); 2624 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs);
2607 } 2625 }
2608 2626
2609 } // end of namespace ARM32 2627 } // end of namespace ARM32
2610 } // end of namespace Ice 2628 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceInstARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698