Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 2336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2347 encodeAddress(OpAddress, Address, TInfo, ImmRegOffsetDiv4); | 2347 encodeAddress(OpAddress, Address, TInfo, ImmRegOffsetDiv4); |
| 2348 (void)AddressEncoding; | 2348 (void)AddressEncoding; |
| 2349 assert(AddressEncoding == EncodedAsImmRegOffset); | 2349 assert(AddressEncoding == EncodedAsImmRegOffset); |
| 2350 IValueT Encoding = B27 | B26 | B24 | B20 | B11 | B9 | | 2350 IValueT Encoding = B27 | B26 | B24 | B20 | B11 | B9 | |
| 2351 (encodeCondition(Cond) << kConditionShift) | | 2351 (encodeCondition(Cond) << kConditionShift) | |
| 2352 (getYInRegXXXXY(Sd) << 22) | | 2352 (getYInRegXXXXY(Sd) << 22) | |
| 2353 (getXXXXInRegXXXXY(Sd) << 12) | Address; | 2353 (getXXXXInRegXXXXY(Sd) << 12) | Address; |
| 2354 emitInst(Encoding); | 2354 emitInst(Encoding); |
| 2355 } | 2355 } |
| 2356 | 2356 |
| 2357 void AssemblerARM32::vmovd(const Operand *OpDd, | |
| 2358 const OperandARM32FlexFpImm *OpFpImm, | |
| 2359 CondARM32::Cond Cond) { | |
| 2360 // VMOV (immediate) - ARM section A8.8.339, encoding A2: | |
| 2361 // vmov<c>.f64 <Dd>, #<imm> | |
| 2362 // | |
| 2363 // cccc11101D11xxxxdddd10110000yyyy where cccc=Cond, ddddD=Sn, xxxxyyyy=imm. | |
| 2364 constexpr const char *Vmovd = "vmovd"; | |
| 2365 IValueT Dd = encodeSRegister(OpDd, "Dd", Vmovd); | |
| 2366 IValueT Imm8 = OpFpImm->getModifiedImm(); | |
| 2367 assert(Imm8 < (1 << 8)); | |
| 2368 constexpr IValueT VmovsOpcode = B23 | B21 | B20 | B8; | |
| 2369 IValueT OpcodePlusImm8 = VmovsOpcode | ((Imm8 >> 4) << 16) | (Imm8 & 0xf); | |
|
Jim Stichnoth
2016/01/26 13:44:41
I see that the ModifiedImm is being swizzled into
Karl
2016/01/26 16:42:05
Done.
| |
| 2370 constexpr IValueT D0 = 0; | |
| 2371 emitVFPddd(Cond, OpcodePlusImm8, Dd, D0, D0); | |
| 2372 } | |
| 2373 | |
| 2374 void AssemblerARM32::vmovs(const Operand *OpSd, | |
| 2375 const OperandARM32FlexFpImm *OpFpImm, | |
| 2376 CondARM32::Cond Cond) { | |
| 2377 // VMOV (immediate) - ARM section A8.8.339, encoding A2: | |
| 2378 // vmov<c>.f32 <Sd>, #<imm> | |
| 2379 // | |
| 2380 // cccc11101D11xxxxdddd10100000yyyy where cccc=Cond, ddddD=Sn, xxxxyyyy=imm. | |
| 2381 constexpr const char *Vmovs = "vmovs"; | |
| 2382 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmovs); | |
| 2383 IValueT Imm8 = OpFpImm->getModifiedImm(); | |
| 2384 assert(Imm8 < (1 << 8)); | |
| 2385 constexpr IValueT VmovsOpcode = B23 | B21 | B20; | |
| 2386 IValueT OpcodePlusImm8 = VmovsOpcode | ((Imm8 >> 4) << 16) | (Imm8 & 0xf); | |
| 2387 constexpr IValueT S0 = 0; | |
| 2388 emitVFPsss(Cond, OpcodePlusImm8, Sd, S0, S0); | |
| 2389 } | |
| 2390 | |
| 2357 void AssemblerARM32::vmovsr(const Operand *OpSn, const Operand *OpRt, | 2391 void AssemblerARM32::vmovsr(const Operand *OpSn, const Operand *OpRt, |
| 2358 CondARM32::Cond Cond) { | 2392 CondARM32::Cond Cond) { |
| 2359 // VMOV (between ARM core register and single-precision register) | 2393 // VMOV (between ARM core register and single-precision register) |
| 2360 // ARM section A8.8.343, encoding A1. | 2394 // ARM section A8.8.343, encoding A1. |
| 2361 // | 2395 // |
| 2362 // vmov<c> <Sn>, <Rt> | 2396 // vmov<c> <Sn>, <Rt> |
| 2363 // | 2397 // |
| 2364 // cccc1110000onnnntttt1010N0010000 where cccc=Cond, nnnnN = Sn, and tttt=Rt. | 2398 // cccc1110000onnnntttt1010N0010000 where cccc=Cond, nnnnN = Sn, and tttt=Rt. |
| 2365 constexpr const char *Vmovsr = "vmovsr"; | 2399 constexpr const char *Vmovsr = "vmovsr"; |
| 2366 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmovsr); | 2400 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmovsr); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2531 // | 2565 // |
| 2532 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and | 2566 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and |
| 2533 // iiiiiiii=NumConsecRegs. | 2567 // iiiiiiii=NumConsecRegs. |
| 2534 constexpr IValueT VpushOpcode = | 2568 constexpr IValueT VpushOpcode = |
| 2535 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; | 2569 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; |
| 2536 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); | 2570 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); |
| 2537 } | 2571 } |
| 2538 | 2572 |
| 2539 } // end of namespace ARM32 | 2573 } // end of namespace ARM32 |
| 2540 } // end of namespace Ice | 2574 } // end of namespace Ice |
| OLD | NEW |