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

Side by Side Diff: src/IceAssemblerARM32.cpp

Issue 1665593002: Add VMUL vector instructions to the integrated ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 10 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 2732 matching lines...) Expand 10 before | Expand all | Expand 10 after
2743 // VMUL (floating-point) - ARM section A8.8.351, encoding A2: 2743 // VMUL (floating-point) - ARM section A8.8.351, encoding A2:
2744 // vmul<c>.f64 <Dd>, <Dn>, <Dm> 2744 // vmul<c>.f64 <Dd>, <Dn>, <Dm>
2745 // 2745 //
2746 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, 2746 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn,
2747 // and Mmmmm=Rm. 2747 // and Mmmmm=Rm.
2748 constexpr const char *Vmuld = "vmuld"; 2748 constexpr const char *Vmuld = "vmuld";
2749 constexpr IValueT VmuldOpcode = B21; 2749 constexpr IValueT VmuldOpcode = B21;
2750 emitVFPddd(Cond, VmuldOpcode, OpDd, OpDn, OpDm, Vmuld); 2750 emitVFPddd(Cond, VmuldOpcode, OpDd, OpDn, OpDm, Vmuld);
2751 } 2751 }
2752 2752
2753 void AssemblerARM32::vmulqi(Type ElmtTy, const Operand *OpQd,
2754 const Operand *OpQn, const Operand *OpQm) {
2755 // VMUL, VMULL (integer and polynomial) - ARM section A8.8.350, encoding A1:
2756 // vmul<c>.<dt> <Qd>, <Qn>, <Qm>
2757 //
2758 // 111100100Dssnnn0ddd01001NqM1mmm0 where Dddd=Qd, Nnnn=Qn, Mmmm=Qm, and
2759 // dt in [i8, i16, i32] where ss is the index.
2760 assert(ElmtTy != IceType_i64 && "vmulqi on i64 vector not allowed");
2761 constexpr const char *Vmulqi = "vmulqi";
2762 constexpr IValueT VmulqiOpcode = B11 | B8 | B4;
2763 emitSIMDqqq(VmulqiOpcode, ElmtTy, OpQd, OpQn, OpQm, Vmulqi);
2764 }
2765
2766 void AssemblerARM32::vmulqf(const Operand *OpQd, const Operand *OpQn,
2767 const Operand *OpQm) {
2768 // VMUL (floating-point) - ARM section A8.8.351, encoding A1:
2769 // vmul.f32 <Qd>, <Qn>, <Qm>
2770 //
2771 // 111100110D00nnn0ddd01101MqM1mmm0 where Dddd=Qd, Nnnn=Qn, and Mmmm=Qm.
2772 constexpr const char *Vmulqf = "vmulqf";
2773 constexpr IValueT VmulqfOpcode = B24 | B11 | B10 | B8 | B4;
2774 emitSIMDqqq(VmulqfOpcode, IceType_f32, OpQd, OpQn, OpQm, Vmulqf);
2775 }
2776
2753 void AssemblerARM32::vorrq(const Operand *OpQd, const Operand *OpQm, 2777 void AssemblerARM32::vorrq(const Operand *OpQd, const Operand *OpQm,
2754 const Operand *OpQn) { 2778 const Operand *OpQn) {
2755 // VORR (register) - ARM section A8.8.360, encoding A1: 2779 // VORR (register) - ARM section A8.8.360, encoding A1:
2756 // vorr <Qd>, <Qn>, <Qm> 2780 // vorr <Qd>, <Qn>, <Qm>
2757 // 2781 //
2758 // 111100100D10nnn0ddd00001N1M1mmm0 where Dddd=OpQd, Nnnn=OpQm, and Mmmm=OpQm. 2782 // 111100100D10nnn0ddd00001N1M1mmm0 where Dddd=OpQd, Nnnn=OpQm, and Mmmm=OpQm.
2759 constexpr const char *Vorrq = "vorrq"; 2783 constexpr const char *Vorrq = "vorrq";
2760 constexpr IValueT VorrqOpcode = B21 | B8 | B4; 2784 constexpr IValueT VorrqOpcode = B21 | B8 | B4;
2761 constexpr Type ElmtTy = IceType_i8; 2785 constexpr Type ElmtTy = IceType_i8;
2762 emitSIMDqqq(VorrqOpcode, ElmtTy, OpQd, OpQm, OpQn, Vorrq); 2786 emitSIMDqqq(VorrqOpcode, ElmtTy, OpQd, OpQm, OpQn, Vorrq);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
2921 constexpr const char *Vsqrts = "vsqrts"; 2945 constexpr const char *Vsqrts = "vsqrts";
2922 IValueT Sd = encodeSRegister(OpSd, "Sd", Vsqrts); 2946 IValueT Sd = encodeSRegister(OpSd, "Sd", Vsqrts);
2923 IValueT Sm = encodeSRegister(OpSm, "Sm", Vsqrts); 2947 IValueT Sm = encodeSRegister(OpSm, "Sm", Vsqrts);
2924 constexpr IValueT VsqrtsOpcode = B23 | B21 | B20 | B16 | B7 | B6; 2948 constexpr IValueT VsqrtsOpcode = B23 | B21 | B20 | B16 | B7 | B6;
2925 constexpr IValueT S0 = 0; 2949 constexpr IValueT S0 = 0;
2926 emitVFPsss(Cond, VsqrtsOpcode, Sd, S0, Sm); 2950 emitVFPsss(Cond, VsqrtsOpcode, Sd, S0, Sm);
2927 } 2951 }
2928 2952
2929 } // end of namespace ARM32 2953 } // end of namespace ARM32
2930 } // end of namespace Ice 2954 } // end of namespace Ice
OLDNEW
« src/IceAssemblerARM32.h ('K') | « src/IceAssemblerARM32.h ('k') | src/IceInstARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698