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

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1564393002: Add VCMP{s,sz,d,dz} Instructions to ARM integrated 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.h » ('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 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 IValueT Dd, IValueT Dn, IValueT Dm) { 1003 IValueT Dd, IValueT Dn, IValueT Dm) {
1004 assert(Dd < RegARM32::getNumDRegs()); 1004 assert(Dd < RegARM32::getNumDRegs());
1005 assert(Dn < RegARM32::getNumDRegs()); 1005 assert(Dn < RegARM32::getNumDRegs());
1006 assert(Dm < RegARM32::getNumDRegs()); 1006 assert(Dm < RegARM32::getNumDRegs());
1007 assert(CondARM32::isDefined(Cond)); 1007 assert(CondARM32::isDefined(Cond));
1008 AssemblerBuffer::EnsureCapacity ensured(&Buffer); 1008 AssemblerBuffer::EnsureCapacity ensured(&Buffer);
1009 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9 | B8; 1009 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9 | B8;
1010 const IValueT Encoding = 1010 const IValueT Encoding =
1011 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | 1011 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) |
1012 (getYInRegYXXXX(Dd) << 22) | (getXXXXInRegYXXXX(Dn) << 16) | 1012 (getYInRegYXXXX(Dd) << 22) | (getXXXXInRegYXXXX(Dn) << 16) |
1013 (getXXXXInRegYXXXX(Dn) << 12) | (getYInRegYXXXX(Dn) << 7) | 1013 (getXXXXInRegYXXXX(Dd) << 12) | (getYInRegYXXXX(Dn) << 7) |
1014 (getYInRegYXXXX(Dm) << 5) | getXXXXInRegYXXXX(Dm); 1014 (getYInRegYXXXX(Dm) << 5) | getXXXXInRegYXXXX(Dm);
1015 emitInst(Encoding); 1015 emitInst(Encoding);
1016 } 1016 }
1017 1017
1018 void AssemblerARM32::emitVFPsss(CondARM32::Cond Cond, IValueT Opcode, 1018 void AssemblerARM32::emitVFPsss(CondARM32::Cond Cond, IValueT Opcode,
1019 IValueT Sd, IValueT Sn, IValueT Sm) { 1019 IValueT Sd, IValueT Sn, IValueT Sm) {
1020 assert(Sd < RegARM32::getNumSRegs()); 1020 assert(Sd < RegARM32::getNumSRegs());
1021 assert(Sn < RegARM32::getNumSRegs()); 1021 assert(Sn < RegARM32::getNumSRegs());
1022 assert(Sm < RegARM32::getNumSRegs()); 1022 assert(Sm < RegARM32::getNumSRegs());
1023 assert(CondARM32::isDefined(Cond)); 1023 assert(CondARM32::isDefined(Cond));
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
2064 // cccc11100D11nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, 2064 // cccc11100D11nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn,
2065 // and Mmmmm=Rm. 2065 // and Mmmmm=Rm.
2066 constexpr const char *Vaddd = "vaddd"; 2066 constexpr const char *Vaddd = "vaddd";
2067 IValueT Dd = encodeDRegister(OpDd, "Dd", Vaddd); 2067 IValueT Dd = encodeDRegister(OpDd, "Dd", Vaddd);
2068 IValueT Dn = encodeDRegister(OpDn, "Dn", Vaddd); 2068 IValueT Dn = encodeDRegister(OpDn, "Dn", Vaddd);
2069 IValueT Dm = encodeDRegister(OpDm, "Dm", Vaddd); 2069 IValueT Dm = encodeDRegister(OpDm, "Dm", Vaddd);
2070 constexpr IValueT VadddOpcode = B21 | B20; 2070 constexpr IValueT VadddOpcode = B21 | B20;
2071 emitVFPddd(Cond, VadddOpcode, Dd, Dn, Dm); 2071 emitVFPddd(Cond, VadddOpcode, Dd, Dn, Dm);
2072 } 2072 }
2073 2073
2074 void AssemblerARM32::vcmpd(const Operand *OpDd, const Operand *OpDm,
2075 CondARM32::Cond Cond) {
2076 constexpr const char *Vcmpd = "vcmpd";
2077 IValueT Dd = encodeDRegister(OpDd, "Dd", Vcmpd);
2078 IValueT Dm = encodeDRegister(OpDm, "Dm", Vcmpd);
2079 constexpr IValueT VcmpdOpcode = B23 | B21 | B20 | B18 | B6;
2080 constexpr IValueT Dn = 0;
2081 emitVFPddd(Cond, VcmpdOpcode, Dd, Dn, Dm);
2082 }
2083
2084 void AssemblerARM32::vcmpdz(const Operand *OpDd, CondARM32::Cond Cond) {
2085 constexpr const char *Vcmpdz = "vcmpdz";
2086 IValueT Dd = encodeDRegister(OpDd, "Dd", Vcmpdz);
2087 constexpr IValueT VcmpdzOpcode = B23 | B21 | B20 | B18 | B16 | B6;
2088 constexpr IValueT Dn = 0;
2089 constexpr IValueT Dm = 0;
2090 emitVFPddd(Cond, VcmpdzOpcode, Dd, Dn, Dm);
2091 }
2092
2093 void AssemblerARM32::vcmps(const Operand *OpSd, const Operand *OpSm,
2094 CondARM32::Cond Cond) {
2095 constexpr const char *Vcmps = "vcmps";
2096 IValueT Sd = encodeSRegister(OpSd, "Sd", Vcmps);
2097 IValueT Sm = encodeSRegister(OpSm, "Sm", Vcmps);
2098 constexpr IValueT VcmpsOpcode = B23 | B21 | B20 | B18 | B6;
2099 constexpr IValueT Sn = 0;
2100 emitVFPsss(Cond, VcmpsOpcode, Sd, Sn, Sm);
2101 }
2102
2103 void AssemblerARM32::vcmpsz(const Operand *OpSd, CondARM32::Cond Cond) {
2104 constexpr const char *Vcmpsz = "vcmps";
2105 IValueT Sd = encodeSRegister(OpSd, "Sd", Vcmpsz);
2106 constexpr IValueT VcmpszOpcode = B23 | B21 | B20 | B18 | B16 | B6;
2107 constexpr IValueT Sn = 0;
2108 constexpr IValueT Sm = 0;
2109 emitVFPsss(Cond, VcmpszOpcode, Sd, Sn, Sm);
2110 }
2111
2074 void AssemblerARM32::emitVFPsd(CondARM32::Cond Cond, IValueT Opcode, IValueT Sd, 2112 void AssemblerARM32::emitVFPsd(CondARM32::Cond Cond, IValueT Opcode, IValueT Sd,
2075 IValueT Dm) { 2113 IValueT Dm) {
2076 assert(Sd < RegARM32::getNumSRegs()); 2114 assert(Sd < RegARM32::getNumSRegs());
2077 assert(Dm < RegARM32::getNumDRegs()); 2115 assert(Dm < RegARM32::getNumDRegs());
2078 assert(CondARM32::isDefined(Cond)); 2116 assert(CondARM32::isDefined(Cond));
2079 AssemblerBuffer::EnsureCapacity ensured(&Buffer); 2117 AssemblerBuffer::EnsureCapacity ensured(&Buffer);
2080 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9; 2118 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9;
2081 const IValueT Encoding = 2119 const IValueT Encoding =
2082 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | 2120 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) |
2083 (getYInRegXXXXY(Sd) << 22) | (getXXXXInRegXXXXY(Sd) << 12) | 2121 (getYInRegXXXXY(Sd) << 22) | (getXXXXInRegXXXXY(Sd) << 12) |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2250 // 2288 //
2251 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and 2289 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and
2252 // iiiiiiii=NumConsecRegs. 2290 // iiiiiiii=NumConsecRegs.
2253 constexpr IValueT VpushOpcode = 2291 constexpr IValueT VpushOpcode =
2254 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; 2292 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9;
2255 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); 2293 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs);
2256 } 2294 }
2257 2295
2258 } // end of namespace ARM32 2296 } // end of namespace ARM32
2259 } // end of namespace Ice 2297 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceInstARM32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698