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 const bool ValidType = |
| 2188 Ty == IceType_i32 || (Ty == IceType_i64 && Traits::Is64Bit); |
| 2189 auto *Const = llvm::dyn_cast<Constant>(Instr->getSrc(1)); |
| 2190 const bool ValidKind = |
| 2191 Const != nullptr && (llvm::isa<ConstantInteger32>(Const) || |
| 2192 llvm::isa<ConstantRelocatable>(Const)); |
| 2193 if (getFlags().getAggressiveLea() && ValidType && ValidKind) { |
| 2194 auto *Var = legalizeToReg(Src0); |
| 2195 auto *Mem = Traits::X86OperandMem::create(Func, IceType_void, Var, Const); |
| 2196 T = makeReg(Ty); |
| 2197 _lea(T, _sandbox_mem_reference(Mem)); |
| 2198 _mov(Dest, T); |
| 2199 break; |
| 2200 } |
2187 _mov(T, Src0); | 2201 _mov(T, Src0); |
2188 _add(T, Src1); | 2202 _add(T, Src1); |
2189 _mov(Dest, T); | 2203 _mov(Dest, T); |
2190 break; | 2204 } break; |
2191 case InstArithmetic::And: | 2205 case InstArithmetic::And: |
2192 _mov(T, Src0); | 2206 _mov(T, Src0); |
2193 _and(T, Src1); | 2207 _and(T, Src1); |
2194 _mov(Dest, T); | 2208 _mov(Dest, T); |
2195 break; | 2209 break; |
2196 case InstArithmetic::Or: | 2210 case InstArithmetic::Or: |
2197 _mov(T, Src0); | 2211 _mov(T, Src0); |
2198 _or(T, Src1); | 2212 _or(T, Src1); |
2199 _mov(Dest, T); | 2213 _mov(Dest, T); |
2200 break; | 2214 break; |
(...skipping 5870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8071 emitGlobal(*Var, SectionSuffix); | 8085 emitGlobal(*Var, SectionSuffix); |
8072 } | 8086 } |
8073 } | 8087 } |
8074 } break; | 8088 } break; |
8075 } | 8089 } |
8076 } | 8090 } |
8077 } // end of namespace X86NAMESPACE | 8091 } // end of namespace X86NAMESPACE |
8078 } // end of namespace Ice | 8092 } // end of namespace Ice |
8079 | 8093 |
8080 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H | 8094 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H |
OLD | NEW |