diff options
author | Tim Northover <tnorthover@apple.com> | 2013-07-01 19:23:10 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2013-07-01 19:23:10 +0000 |
commit | 8625fd8cad18731d042dad5f22ad926ed9f99b66 (patch) | |
tree | 9a42be1a6f96a51d891cee5d19e489e802a3d5f2 /llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp | |
parent | 8b30c13e12b5ebc60f5f84f2ccfbc9c64199cf96 (diff) | |
download | bcm5719-llvm-8625fd8cad18731d042dad5f22ad926ed9f99b66.tar.gz bcm5719-llvm-8625fd8cad18731d042dad5f22ad926ed9f99b66.zip |
AArch64: correct CodeGen of MOVZ/MOVK combinations.
According to the AArch64 ELF specification (4.6.8), it's the
assembler's responsibility to make sure the shift amount is correct in
relocated MOVZ/MOVK instructions.
This wasn't being obeyed by either the MCJIT CodeGen or RuntimeDyldELF
(which happened to work out well for JIT tests). This commit should
make us compliant in this area.
llvm-svn: 185360
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp b/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp index 2e37cb41f9b..f258a966948 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp @@ -70,10 +70,11 @@ public: /// Used for pre-lowered address-reference nodes, so we already know /// the fields match. This operand's job is simply to add an - /// appropriate shift operand (i.e. 0) to the MOVZ/MOVK instruction. + /// appropriate shift operand to the MOVZ/MOVK instruction. + template<unsigned LogShift> bool SelectMOVWAddressRef(SDValue N, SDValue &Imm, SDValue &Shift) { Imm = N; - Shift = CurDAG->getTargetConstant(0, MVT::i32); + Shift = CurDAG->getTargetConstant(LogShift, MVT::i32); return true; } |