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

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1570543002: Add VMULS and VMULD instructions to integrated ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: 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 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after
2054 IValueT Sm = encodeSRegister(OpSm, "Sm", Vadds); 2054 IValueT Sm = encodeSRegister(OpSm, "Sm", Vadds);
2055 constexpr IValueT VaddsOpcode = B21 | B20; 2055 constexpr IValueT VaddsOpcode = B21 | B20;
2056 emitVFPsss(Cond, VaddsOpcode, Sd, Sn, Sm); 2056 emitVFPsss(Cond, VaddsOpcode, Sd, Sn, Sm);
2057 } 2057 }
2058 2058
2059 void AssemblerARM32::vaddd(const Operand *OpDd, const Operand *OpDn, 2059 void AssemblerARM32::vaddd(const Operand *OpDd, const Operand *OpDn,
2060 const Operand *OpDm, CondARM32::Cond Cond) { 2060 const Operand *OpDm, CondARM32::Cond Cond) {
2061 // VADD (floating-point) - ARM section A8.8.283, encoding A2: 2061 // VADD (floating-point) - ARM section A8.8.283, encoding A2:
2062 // vadd<c>.f64 <Dd>, <Dn>, <Dm> 2062 // vadd<c>.f64 <Dd>, <Dn>, <Dm>
2063 // 2063 //
2064 // cccc11100D11nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, 2064 // cccc11100D10nnnndddd101sN0M0mmmm 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::vmuls(const Operand *OpSd, const Operand *OpSn,
2075 const Operand *OpSm, CondARM32::Cond Cond) {
2076 // VMUL (floating-point) - ARM section A8.8.351, encoding A2:
2077 // vmul<c>.f32 <Sd>, <Sn>, <Sm>
2078 //
2079 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn,
2080 // and mmmmM=Rm.
2081 constexpr const char *Vmuls = "vmuls";
2082 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmuls);
2083 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmuls);
2084 IValueT Sm = encodeSRegister(OpSm, "Sm", Vmuls);
2085 constexpr IValueT VmulsOpcode = B21;
2086 emitVFPsss(Cond, VmulsOpcode, Sd, Sn, Sm);
2087 }
2088
2089 void AssemblerARM32::vmuld(const Operand *OpDd, const Operand *OpDn,
2090 const Operand *OpDm, CondARM32::Cond Cond) {
2091 // VMUL (floating-point) - ARM section A8.8.351, encoding A2:
2092 // vmul<c>.f64 <Dd>, <Dn>, <Dm>
2093 //
2094 // cccc11100D11nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn,
2095 // and Mmmmm=Rm.
2096 constexpr const char *Vmuld = "vmuld";
2097 IValueT Dd = encodeDRegister(OpDd, "Dd", Vmuld);
2098 IValueT Dn = encodeDRegister(OpDn, "Dn", Vmuld);
2099 IValueT Dm = encodeDRegister(OpDm, "Dm", Vmuld);
2100 constexpr IValueT VmuldOpcode = B21;
2101 emitVFPddd(Cond, VmuldOpcode, Dd, Dn, Dm);
2102 }
2103
2074 void AssemblerARM32::emitVStackOp(CondARM32::Cond Cond, IValueT Opcode, 2104 void AssemblerARM32::emitVStackOp(CondARM32::Cond Cond, IValueT Opcode,
2075 const Variable *OpBaseReg, 2105 const Variable *OpBaseReg,
2076 SizeT NumConsecRegs) { 2106 SizeT NumConsecRegs) {
2077 const IValueT BaseReg = getEncodedSRegNum(OpBaseReg); 2107 const IValueT BaseReg = getEncodedSRegNum(OpBaseReg);
2078 const IValueT DLastBit = mask(BaseReg, 0, 1); // Last bit of base register. 2108 const IValueT DLastBit = mask(BaseReg, 0, 1); // Last bit of base register.
2079 const IValueT Rd = mask(BaseReg, 1, 4); // Top 4 bits of base register. 2109 const IValueT Rd = mask(BaseReg, 1, 4); // Top 4 bits of base register.
2080 assert(0 < NumConsecRegs); 2110 assert(0 < NumConsecRegs);
2081 (void)VpushVpopMaxConsecRegs; 2111 (void)VpushVpopMaxConsecRegs;
2082 assert(NumConsecRegs <= VpushVpopMaxConsecRegs); 2112 assert(NumConsecRegs <= VpushVpopMaxConsecRegs);
2083 assert((BaseReg + NumConsecRegs) <= RegARM32::getNumSRegs()); 2113 assert((BaseReg + NumConsecRegs) <= RegARM32::getNumSRegs());
(...skipping 29 matching lines...) Expand all
2113 // 2143 //
2114 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and 2144 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and
2115 // iiiiiiii=NumConsecRegs. 2145 // iiiiiiii=NumConsecRegs.
2116 constexpr IValueT VpushOpcode = 2146 constexpr IValueT VpushOpcode =
2117 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; 2147 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9;
2118 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); 2148 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs);
2119 } 2149 }
2120 2150
2121 } // end of namespace ARM32 2151 } // end of namespace ARM32
2122 } // end of namespace Ice 2152 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698