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

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1611293003: Add vcvt.s32.f32 instruction 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
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 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2119 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9; 2119 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9;
2120 const IValueT Encoding = 2120 const IValueT Encoding =
2121 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | 2121 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) |
2122 (getYInRegXXXXY(Sd) << 22) | (getXXXXInRegXXXXY(Sd) << 12) | 2122 (getYInRegXXXXY(Sd) << 22) | (getXXXXInRegXXXXY(Sd) << 12) |
2123 (getYInRegYXXXX(Dm) << 5) | getXXXXInRegYXXXX(Dm); 2123 (getYInRegYXXXX(Dm) << 5) | getXXXXInRegYXXXX(Dm);
2124 emitInst(Encoding); 2124 emitInst(Encoding);
2125 } 2125 }
2126 2126
2127 void AssemblerARM32::vcvtsd(const Operand *OpSd, const Operand *OpDm, 2127 void AssemblerARM32::vcvtsd(const Operand *OpSd, const Operand *OpDm,
2128 CondARM32::Cond Cond) { 2128 CondARM32::Cond Cond) {
2129 constexpr const char *Vcvtsd = "vctsd"; 2129 constexpr const char *Vcvtsd = "vcvtsd";
2130 IValueT Sd = encodeSRegister(OpSd, "Sd", Vcvtsd); 2130 IValueT Sd = encodeSRegister(OpSd, "Sd", Vcvtsd);
2131 IValueT Dm = encodeDRegister(OpDm, "Dm", Vcvtsd); 2131 IValueT Dm = encodeDRegister(OpDm, "Dm", Vcvtsd);
2132 constexpr IValueT VcvtsdOpcode = 2132 constexpr IValueT VcvtsdOpcode =
2133 B23 | B21 | B20 | B18 | B17 | B16 | B8 | B7 | B6; 2133 B23 | B21 | B20 | B18 | B17 | B16 | B8 | B7 | B6;
2134 emitVFPsd(Cond, VcvtsdOpcode, Sd, Dm); 2134 emitVFPsd(Cond, VcvtsdOpcode, Sd, Dm);
2135 } 2135 }
2136 2136
2137 void AssemblerARM32::vcvtis(const Operand *OpSd, const Operand *OpSm,
2138 CondARM32::Cond Cond) {
2139 // VCVT (between floating-point and integer, Floating-point)
2140 // - ARM Section A8.8.306, encoding A1:
2141 // vcvt<c>.s32.f32 <Sd>, <Sm>
2142 //
2143 // cccc11101D111101dddd10101M0mmmm where cccc=Cond, ddddD=Sd, and mmmmM=Sm.
2144 constexpr const char *Vcvtis = "vcvtis";
2145 IValueT Sd = encodeSRegister(OpSd, "Sd", Vcvtis);
2146 IValueT Sm = encodeSRegister(OpSm, "Sm", Vcvtis);
2147 constexpr IValueT VcvtsiOpcode = B23 | B21 | B20 | B19 | B18 | B16 | B7 | B6;
2148 constexpr IValueT S0 = 0;
2149 emitVFPsss(Cond, VcvtsiOpcode, Sd, S0, Sm);
2150 }
2151
2137 void AssemblerARM32::emitVFPds(CondARM32::Cond Cond, IValueT Opcode, IValueT Dd, 2152 void AssemblerARM32::emitVFPds(CondARM32::Cond Cond, IValueT Opcode, IValueT Dd,
2138 IValueT Sm) { 2153 IValueT Sm) {
2139 assert(Dd < RegARM32::getNumDRegs()); 2154 assert(Dd < RegARM32::getNumDRegs());
2140 assert(Sm < RegARM32::getNumSRegs()); 2155 assert(Sm < RegARM32::getNumSRegs());
2141 assert(CondARM32::isDefined(Cond)); 2156 assert(CondARM32::isDefined(Cond));
2142 AssemblerBuffer::EnsureCapacity ensured(&Buffer); 2157 AssemblerBuffer::EnsureCapacity ensured(&Buffer);
2143 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9; 2158 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9;
2144 const IValueT Encoding = 2159 const IValueT Encoding =
2145 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | 2160 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) |
2146 (getYInRegYXXXX(Dd) << 22) | (getXXXXInRegYXXXX(Dd) << 12) | 2161 (getYInRegYXXXX(Dd) << 22) | (getXXXXInRegYXXXX(Dd) << 12) |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
2289 // 2304 //
2290 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and 2305 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and
2291 // iiiiiiii=NumConsecRegs. 2306 // iiiiiiii=NumConsecRegs.
2292 constexpr IValueT VpushOpcode = 2307 constexpr IValueT VpushOpcode =
2293 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; 2308 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9;
2294 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); 2309 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs);
2295 } 2310 }
2296 2311
2297 } // end of namespace ARM32 2312 } // end of namespace ARM32
2298 } // end of namespace Ice 2313 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698