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

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1603893003: Add vstr{s,d} 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, 11 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 2199 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, 2210 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn,
2211 // and Mmmmm=Rm. 2211 // and Mmmmm=Rm.
2212 constexpr const char *Vmuld = "vmuld"; 2212 constexpr const char *Vmuld = "vmuld";
2213 IValueT Dd = encodeDRegister(OpDd, "Dd", Vmuld); 2213 IValueT Dd = encodeDRegister(OpDd, "Dd", Vmuld);
2214 IValueT Dn = encodeDRegister(OpDn, "Dn", Vmuld); 2214 IValueT Dn = encodeDRegister(OpDn, "Dn", Vmuld);
2215 IValueT Dm = encodeDRegister(OpDm, "Dm", Vmuld); 2215 IValueT Dm = encodeDRegister(OpDm, "Dm", Vmuld);
2216 constexpr IValueT VmuldOpcode = B21; 2216 constexpr IValueT VmuldOpcode = B21;
2217 emitVFPddd(Cond, VmuldOpcode, Dd, Dn, Dm); 2217 emitVFPddd(Cond, VmuldOpcode, Dd, Dn, Dm);
2218 } 2218 }
2219 2219
2220 void AssemblerARM32::vstrd(const Operand *OpDd, const Operand *OpAddress,
2221 CondARM32::Cond Cond, const TargetInfo &TInfo) {
2222 // VSTR - ARM section A8.8.413, encoding A1:
2223 // vstr<c> <Dd>, [<Rn>{, #+/-<imm>}]
2224 //
2225 // cccc1101UD00nnnndddd1011iiiiiiii where cccc=Cond, nnnn=Rn, Ddddd=Rd,
2226 // iiiiiiii=abs(Opcode), and U=1 if Opcode>=0,
2227 constexpr const char *Vstrd = "vstrd";
2228 IValueT Dd = encodeDRegister(OpDd, "Dd", Vstrd);
2229 assert(CondARM32::isDefined(Cond));
2230 IValueT Address;
2231 if (encodeAddress(OpAddress, Address, TInfo) != EncodedAsImmRegOffset)
2232 assert(false);
2233 AssemblerBuffer::EnsureCapacity ensured(&Buffer);
2234 IValueT Encoding = B27 | B26 | B24 | B11 | B9 | B8 |
2235 (encodeCondition(Cond) << kConditionShift) |
2236 (getYInRegYXXXX(Dd) << 22) |
2237 (getXXXXInRegYXXXX(Dd) << 12) | Address;
2238 emitInst(Encoding);
2239 }
2240
2241 void AssemblerARM32::vstrs(const Operand *OpSd, const Operand *OpAddress,
2242 CondARM32::Cond Cond, const TargetInfo &TInfo) {
2243 // VSTR - ARM section A8.8.413, encoding A2:
2244 // vstr<c> <Sd>, [<Rn>{, #+/-<imm>]]
2245 //
2246 // cccc1101UD01nnnndddd1010iiiiiiii where cccc=Cond, nnnn=Rn, ddddD=Sd,
2247 // iiiiiiii=abs(Opcode), and U=1 if Opcode >= 0;
2248 constexpr const char *Vstrs = "vstrs";
2249 IValueT Sd = encodeSRegister(OpSd, "Sd", Vstrs);
2250 assert(CondARM32::isDefined(Cond));
2251 IValueT Address;
2252 if (encodeAddress(OpAddress, Address, TInfo) != EncodedAsImmRegOffset)
2253 assert(false);
2254 AssemblerBuffer::EnsureCapacity ensured(&Buffer);
2255 IValueT Encoding =
2256 B27 | B26 | B24 | B11 | B9 | (encodeCondition(Cond) << kConditionShift) |
2257 (getYInRegXXXXY(Sd) << 22) | (getXXXXInRegXXXXY(Sd) << 12) | Address;
2258 emitInst(Encoding);
2259 }
2260
2220 void AssemblerARM32::vsubs(const Operand *OpSd, const Operand *OpSn, 2261 void AssemblerARM32::vsubs(const Operand *OpSd, const Operand *OpSn,
2221 const Operand *OpSm, CondARM32::Cond Cond) { 2262 const Operand *OpSm, CondARM32::Cond Cond) {
2222 // VSUB (floating-point) - ARM section A8.8.415, encoding A2: 2263 // VSUB (floating-point) - ARM section A8.8.415, encoding A2:
2223 // vsub<c>.f32 <Sd>, <Sn>, <Sm> 2264 // vsub<c>.f32 <Sd>, <Sn>, <Sm>
2224 // 2265 //
2225 // cccc11100D11nnnndddd101sN1M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, 2266 // cccc11100D11nnnndddd101sN1M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn,
2226 // and mmmmM=Rm. 2267 // and mmmmM=Rm.
2227 constexpr const char *Vsubs = "vsubs"; 2268 constexpr const char *Vsubs = "vsubs";
2228 IValueT Sd = encodeSRegister(OpSd, "Sd", Vsubs); 2269 IValueT Sd = encodeSRegister(OpSd, "Sd", Vsubs);
2229 IValueT Sn = encodeSRegister(OpSn, "Sn", Vsubs); 2270 IValueT Sn = encodeSRegister(OpSn, "Sn", Vsubs);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2289 // 2330 //
2290 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and 2331 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and
2291 // iiiiiiii=NumConsecRegs. 2332 // iiiiiiii=NumConsecRegs.
2292 constexpr IValueT VpushOpcode = 2333 constexpr IValueT VpushOpcode =
2293 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; 2334 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9;
2294 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); 2335 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs);
2295 } 2336 }
2296 2337
2297 } // end of namespace ARM32 2338 } // end of namespace ARM32
2298 } // end of namespace Ice 2339 } // 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