OLD | NEW |
---|---|
1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==// | 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- 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 2165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2176 break; | 2176 break; |
2177 } | 2177 } |
2178 return; | 2178 return; |
2179 } | 2179 } |
2180 Variable *T_edx = nullptr; | 2180 Variable *T_edx = nullptr; |
2181 Variable *T = nullptr; | 2181 Variable *T = nullptr; |
2182 switch (Instr->getOp()) { | 2182 switch (Instr->getOp()) { |
2183 case InstArithmetic::_num: | 2183 case InstArithmetic::_num: |
2184 llvm_unreachable("Unknown arithmetic operator"); | 2184 llvm_unreachable("Unknown arithmetic operator"); |
2185 break; | 2185 break; |
2186 case InstArithmetic::Add: | 2186 case InstArithmetic::Add: { |
2187 _mov(T, Src0); | 2187 bool ConvertedToLea = false; |
2188 _add(T, Src1); | 2188 if (getFlags().getAggressiveLea() && |
Jim Stichnoth
2016/07/29 14:27:26
I wonder if this conditional would be clearer as s
manasijm
2016/08/01 19:36:21
Done.
| |
2189 _mov(Dest, T); | 2189 (Ty == IceType_i32 || (Ty == IceType_i64 && Traits::Is64Bit))) { |
2190 break; | 2190 Constant *Const = llvm::dyn_cast<Constant>(Instr->getSrc(1)); |
Jim Stichnoth
2016/07/29 14:27:26
auto *Const
manasijm
2016/08/01 19:36:21
Done.
| |
2191 if (Const != nullptr && (llvm::isa<ConstantInteger32>(Const) || | |
2192 llvm::isa<ConstantRelocatable>(Const))) { | |
2193 auto *Var = legalizeToReg(Src0); | |
2194 auto *Mem = | |
2195 Traits::X86OperandMem::create(Func, IceType_void, Var, Const); | |
2196 T = makeReg(Ty); | |
2197 _lea(T, _sandbox_mem_reference(Mem)); | |
2198 _mov(Dest, T); | |
2199 ConvertedToLea = true; | |
Jim Stichnoth
2016/07/29 14:27:26
I would just put a "break;" here, and remove Conve
manasijm
2016/08/01 19:36:21
Done.
| |
2200 } | |
2201 } | |
2202 if (!ConvertedToLea) { | |
2203 _mov(T, Src0); | |
2204 _add(T, Src1); | |
2205 _mov(Dest, T); | |
2206 } | |
2207 } break; | |
2191 case InstArithmetic::And: | 2208 case InstArithmetic::And: |
2192 _mov(T, Src0); | 2209 _mov(T, Src0); |
2193 _and(T, Src1); | 2210 _and(T, Src1); |
2194 _mov(Dest, T); | 2211 _mov(Dest, T); |
2195 break; | 2212 break; |
2196 case InstArithmetic::Or: | 2213 case InstArithmetic::Or: |
2197 _mov(T, Src0); | 2214 _mov(T, Src0); |
2198 _or(T, Src1); | 2215 _or(T, Src1); |
2199 _mov(Dest, T); | 2216 _mov(Dest, T); |
2200 break; | 2217 break; |
(...skipping 5870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8071 emitGlobal(*Var, SectionSuffix); | 8088 emitGlobal(*Var, SectionSuffix); |
8072 } | 8089 } |
8073 } | 8090 } |
8074 } break; | 8091 } break; |
8075 } | 8092 } |
8076 } | 8093 } |
8077 } // end of namespace X86NAMESPACE | 8094 } // end of namespace X86NAMESPACE |
8078 } // end of namespace Ice | 8095 } // end of namespace Ice |
8079 | 8096 |
8080 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H | 8097 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H |
OLD | NEW |