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

Side by Side Diff: src/IceInstX86Base.h

Issue 1351133003: Optimize 64-bit shifts by constants for x86-32 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review updates Created 5 years, 3 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/IceInstX86Base.h - Generic x86 instructions -*- C++ -*--===// 1 //===- subzero/src/IceInstX86Base.h - Generic x86 instructions -*- C++ -*--===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after
2096 }; 2096 };
2097 2097
2098 /// Shld instruction - shift across a pair of operands. 2098 /// Shld instruction - shift across a pair of operands.
2099 template <class Machine> class InstX86Shld final : public InstX86Base<Machine> { 2099 template <class Machine> class InstX86Shld final : public InstX86Base<Machine> {
2100 InstX86Shld() = delete; 2100 InstX86Shld() = delete;
2101 InstX86Shld(const InstX86Shld &) = delete; 2101 InstX86Shld(const InstX86Shld &) = delete;
2102 InstX86Shld &operator=(const InstX86Shld &) = delete; 2102 InstX86Shld &operator=(const InstX86Shld &) = delete;
2103 2103
2104 public: 2104 public:
2105 static InstX86Shld *create(Cfg *Func, Variable *Dest, Variable *Source1, 2105 static InstX86Shld *create(Cfg *Func, Variable *Dest, Variable *Source1,
2106 Variable *Source2) { 2106 Operand *Source2) {
2107 return new (Func->allocate<InstX86Shld>()) 2107 return new (Func->allocate<InstX86Shld>())
2108 InstX86Shld(Func, Dest, Source1, Source2); 2108 InstX86Shld(Func, Dest, Source1, Source2);
2109 } 2109 }
2110 void emit(const Cfg *Func) const override; 2110 void emit(const Cfg *Func) const override;
2111 void emitIAS(const Cfg *Func) const override; 2111 void emitIAS(const Cfg *Func) const override;
2112 void dump(const Cfg *Func) const override; 2112 void dump(const Cfg *Func) const override;
2113 static bool classof(const Inst *Inst) { 2113 static bool classof(const Inst *Inst) {
2114 return InstX86Base<Machine>::isClassof(Inst, InstX86Base<Machine>::Shld); 2114 return InstX86Base<Machine>::isClassof(Inst, InstX86Base<Machine>::Shld);
2115 } 2115 }
2116 2116
2117 private: 2117 private:
2118 InstX86Shld(Cfg *Func, Variable *Dest, Variable *Source1, Variable *Source2); 2118 InstX86Shld(Cfg *Func, Variable *Dest, Variable *Source1, Operand *Source2);
2119 }; 2119 };
2120 2120
2121 /// Shrd instruction - shift across a pair of operands. 2121 /// Shrd instruction - shift across a pair of operands.
2122 template <class Machine> class InstX86Shrd final : public InstX86Base<Machine> { 2122 template <class Machine> class InstX86Shrd final : public InstX86Base<Machine> {
2123 InstX86Shrd() = delete; 2123 InstX86Shrd() = delete;
2124 InstX86Shrd(const InstX86Shrd &) = delete; 2124 InstX86Shrd(const InstX86Shrd &) = delete;
2125 InstX86Shrd &operator=(const InstX86Shrd &) = delete; 2125 InstX86Shrd &operator=(const InstX86Shrd &) = delete;
2126 2126
2127 public: 2127 public:
2128 static InstX86Shrd *create(Cfg *Func, Variable *Dest, Variable *Source1, 2128 static InstX86Shrd *create(Cfg *Func, Variable *Dest, Variable *Source1,
2129 Variable *Source2) { 2129 Operand *Source2) {
2130 return new (Func->allocate<InstX86Shrd>()) 2130 return new (Func->allocate<InstX86Shrd>())
2131 InstX86Shrd(Func, Dest, Source1, Source2); 2131 InstX86Shrd(Func, Dest, Source1, Source2);
2132 } 2132 }
2133 void emit(const Cfg *Func) const override; 2133 void emit(const Cfg *Func) const override;
2134 void emitIAS(const Cfg *Func) const override; 2134 void emitIAS(const Cfg *Func) const override;
2135 void dump(const Cfg *Func) const override; 2135 void dump(const Cfg *Func) const override;
2136 static bool classof(const Inst *Inst) { 2136 static bool classof(const Inst *Inst) {
2137 return InstX86Base<Machine>::isClassof(Inst, InstX86Base<Machine>::Shrd); 2137 return InstX86Base<Machine>::isClassof(Inst, InstX86Base<Machine>::Shrd);
2138 } 2138 }
2139 2139
2140 private: 2140 private:
2141 InstX86Shrd(Cfg *Func, Variable *Dest, Variable *Source1, Variable *Source2); 2141 InstX86Shrd(Cfg *Func, Variable *Dest, Variable *Source1, Operand *Source2);
2142 }; 2142 };
2143 2143
2144 /// Conditional move instruction. 2144 /// Conditional move instruction.
2145 template <class Machine> class InstX86Cmov final : public InstX86Base<Machine> { 2145 template <class Machine> class InstX86Cmov final : public InstX86Base<Machine> {
2146 InstX86Cmov() = delete; 2146 InstX86Cmov() = delete;
2147 InstX86Cmov(const InstX86Cmov &) = delete; 2147 InstX86Cmov(const InstX86Cmov &) = delete;
2148 InstX86Cmov &operator=(const InstX86Cmov &) = delete; 2148 InstX86Cmov &operator=(const InstX86Cmov &) = delete;
2149 2149
2150 public: 2150 public:
2151 static InstX86Cmov * 2151 static InstX86Cmov *
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
3197 &InstX86Base<Machine>::Traits::Assembler::psrl}; \ 3197 &InstX86Base<Machine>::Traits::Assembler::psrl}; \
3198 } \ 3198 } \
3199 } 3199 }
3200 3200
3201 } // end of namespace X86Internal 3201 } // end of namespace X86Internal
3202 } // end of namespace Ice 3202 } // end of namespace Ice
3203 3203
3204 #include "IceInstX86BaseImpl.h" 3204 #include "IceInstX86BaseImpl.h"
3205 3205
3206 #endif // SUBZERO_SRC_ICEINSTX86BASE_H 3206 #endif // SUBZERO_SRC_ICEINSTX86BASE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698