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

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1601103010: Add vdlr{s,d} to the integrated ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix remaining issues. 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // Rn should be used, and iiiiiiiiiiii defines the rotated Imm8 value. 231 // Rn should be used, and iiiiiiiiiiii defines the rotated Imm8 value.
232 // 232 //
233 // ***** OpEncoding3 ***** 233 // ***** OpEncoding3 *****
234 // 234 //
235 // Value=00000000pu0w0nnnn0000iiii0000jjjj where nnnn=Rn, iiiijjjj=Imm8, p=1 235 // Value=00000000pu0w0nnnn0000iiii0000jjjj where nnnn=Rn, iiiijjjj=Imm8, p=1
236 // if pre-indexed addressing, u=1 if offset positive, and w=1 if writeback to 236 // if pre-indexed addressing, u=1 if offset positive, and w=1 if writeback to
237 // Rn. 237 // Rn.
238 // 238 //
239 // ***** OpEncodingMemEx ***** 239 // ***** OpEncodingMemEx *****
240 // 240 //
241 // Value=000000000000nnnn0000000000000000 where nnnn=Rn. 241 // Value=00000000U000nnnn00000000xxxxxxxx where nnnn=Rn, xxxxxxxx=abs(Offset),
242 // and U=1 Offset>=0.
242 EncodedAsImmRegOffset, 243 EncodedAsImmRegOffset,
243 // Value=0000000pu0w00nnnnttttiiiiiss0mmmm where nnnn is the base register Rn, 244 // Value=0000000pu0w00nnnnttttiiiiiss0mmmm where nnnn is the base register Rn,
244 // mmmm is the index register Rm, iiiii is the shift amount, ss is the shift 245 // mmmm is the index register Rm, iiiii is the shift amount, ss is the shift
245 // kind, p=1 if pre-indexed addressing, u=1 if offset positive, and w=1 if 246 // kind, p=1 if pre-indexed addressing, u=1 if offset positive, and w=1 if
246 // writeback to Rn. 247 // writeback to Rn.
247 EncodedAsShiftRotateImm5, 248 EncodedAsShiftRotateImm5,
248 // Value=000000000000000000000iiiii0000000 where iiii defines the Imm5 value 249 // Value=000000000000000000000iiiii0000000 where iiii defines the Imm5 value
249 // to shift. 250 // to shift.
250 EncodedAsShiftImm5, 251 EncodedAsShiftImm5,
251 // Value=iiiiiss0mmmm where mmmm is the register to rotate, ss is the shift 252 // Value=iiiiiss0mmmm where mmmm is the register to rotate, ss is the shift
(...skipping 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after
2180 // cccc11101D00nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, 2181 // cccc11101D00nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn,
2181 // and Mmmmm=Rm. 2182 // and Mmmmm=Rm.
2182 constexpr const char *Vdivd = "vdivd"; 2183 constexpr const char *Vdivd = "vdivd";
2183 IValueT Dd = encodeDRegister(OpDd, "Dd", Vdivd); 2184 IValueT Dd = encodeDRegister(OpDd, "Dd", Vdivd);
2184 IValueT Dn = encodeDRegister(OpDn, "Dn", Vdivd); 2185 IValueT Dn = encodeDRegister(OpDn, "Dn", Vdivd);
2185 IValueT Dm = encodeDRegister(OpDm, "Dm", Vdivd); 2186 IValueT Dm = encodeDRegister(OpDm, "Dm", Vdivd);
2186 constexpr IValueT VdivdOpcode = B23; 2187 constexpr IValueT VdivdOpcode = B23;
2187 emitVFPddd(Cond, VdivdOpcode, Dd, Dn, Dm); 2188 emitVFPddd(Cond, VdivdOpcode, Dd, Dn, Dm);
2188 } 2189 }
2189 2190
2191 void AssemblerARM32::vldrd(const Operand *OpDd, const Operand *OpAddress,
2192 CondARM32::Cond Cond, const TargetInfo &TInfo) {
2193 // VLDR - ARM section A8.8.333, encoding A1.
2194 // vldr<c> <Dd>, [<Rn>{, #+/-<imm>}]
2195 //
2196 // cccc1101UD01nnnndddd1011iiiiiiii where cccc=Cond, nnnn=Rn, Ddddd=Rd,
2197 // iiiiiiii=abs(Opcode), and U=1 if Opcode>=0,
2198 constexpr const char *Vldrd = "vldrd";
2199 IValueT Dd = encodeDRegister(OpDd, "Dd", Vldrd);
2200 assert(CondARM32::isDefined(Cond));
2201 IValueT Address;
2202 EncodedOperand AddressEncoding = encodeAddress(OpAddress, Address, TInfo);
2203 (void)AddressEncoding;
2204 assert(AddressEncoding == EncodedAsImmRegOffset);
2205 AssemblerBuffer::EnsureCapacity ensured(&Buffer);
2206 IValueT Encoding = B27 | B26 | B24 | B20 | B11 | B9 | B8 |
2207 (encodeCondition(Cond) << kConditionShift) |
2208 (getYInRegYXXXX(Dd) << 22) |
2209 (getXXXXInRegYXXXX(Dd) << 12) | Address;
2210 emitInst(Encoding);
2211 }
2212
2213 void AssemblerARM32::vldrs(const Operand *OpSd, const Operand *OpAddress,
2214 CondARM32::Cond Cond, const TargetInfo &TInfo) {
2215 // VDLR - ARM section A8.8.333, encoding A2.
2216 // vldr<c> <Sd>, [<Rn>{, #+/-<imm>]]
2217 //
2218 // cccc1101UD01nnnndddd1010iiiiiiii where cccc=Cond, nnnn=Rn, ddddD=Sd,
2219 // iiiiiiii=abs(Opcode), and U=1 if Opcode >= 0;
2220 constexpr const char *Vldrs = "vldrs";
2221 IValueT Sd = encodeSRegister(OpSd, "Sd", Vldrs);
2222 assert(CondARM32::isDefined(Cond));
2223 IValueT Address;
2224 EncodedOperand AddressEncoding = encodeAddress(OpAddress, Address, TInfo);
2225 (void)AddressEncoding;
2226 assert(AddressEncoding == EncodedAsImmRegOffset);
2227 AssemblerBuffer::EnsureCapacity ensured(&Buffer);
2228 IValueT Encoding = B27 | B26 | B24 | B20 | B11 | B9 |
2229 (encodeCondition(Cond) << kConditionShift) |
2230 (getYInRegXXXXY(Sd) << 22) |
2231 (getXXXXInRegXXXXY(Sd) << 12) | Address;
2232 emitInst(Encoding);
2233 }
2234
2190 void AssemblerARM32::vmuls(const Operand *OpSd, const Operand *OpSn, 2235 void AssemblerARM32::vmuls(const Operand *OpSd, const Operand *OpSn,
2191 const Operand *OpSm, CondARM32::Cond Cond) { 2236 const Operand *OpSm, CondARM32::Cond Cond) {
2192 // VMUL (floating-point) - ARM section A8.8.351, encoding A2: 2237 // VMUL (floating-point) - ARM section A8.8.351, encoding A2:
2193 // vmul<c>.f32 <Sd>, <Sn>, <Sm> 2238 // vmul<c>.f32 <Sd>, <Sn>, <Sm>
2194 // 2239 //
2195 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, 2240 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn,
2196 // and mmmmM=Rm. 2241 // and mmmmM=Rm.
2197 constexpr const char *Vmuls = "vmuls"; 2242 constexpr const char *Vmuls = "vmuls";
2198 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmuls); 2243 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmuls);
2199 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmuls); 2244 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmuls);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
2289 // 2334 //
2290 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and 2335 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and
2291 // iiiiiiii=NumConsecRegs. 2336 // iiiiiiii=NumConsecRegs.
2292 constexpr IValueT VpushOpcode = 2337 constexpr IValueT VpushOpcode =
2293 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; 2338 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9;
2294 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); 2339 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs);
2295 } 2340 }
2296 2341
2297 } // end of namespace ARM32 2342 } // end of namespace ARM32
2298 } // end of namespace Ice 2343 } // 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