diff options
| author | Simon Dardis <simon.dardis@imgtec.com> | 2016-04-28 16:26:43 +0000 |
|---|---|---|
| committer | Simon Dardis <simon.dardis@imgtec.com> | 2016-04-28 16:26:43 +0000 |
| commit | a2d8cc3db90ab5694b5bb3b94a978772531f921e (patch) | |
| tree | 3a2b4666c0467150a98a2b8c100813fc022825ef /llvm/lib/Target/Mips/MCTargetDesc | |
| parent | 0e610340181cef1d88a15c850406993e915501f8 (diff) | |
| download | bcm5719-llvm-a2d8cc3db90ab5694b5bb3b94a978772531f921e.tar.gz bcm5719-llvm-a2d8cc3db90ab5694b5bb3b94a978772531f921e.zip | |
[mips][atomics] Fix partword atomic binary operation implementation
Currently Mips::emitAtomicBinaryPartword() does not properly respect the
width of pointers. For MIPS64 this causes the memory address that the ll/sc
sequence uses to be truncated. At runtime this causes a segmentation fault.
This can be fixed by applying similar changes as r266204, so that a full 64bit
pointer is loaded.
Reviewers: dsanders
Differential Review: http://reviews.llvm.org/D19651
llvm-svn: 267900
Diffstat (limited to 'llvm/lib/Target/Mips/MCTargetDesc')
| -rw-r--r-- | llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp index cdcc3923b81..5fda05a5b4e 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp @@ -118,6 +118,10 @@ unsigned MipsABIInfo::GetPtrAddiuOp() const { return ArePtrs64bit() ? Mips::DADDiu : Mips::ADDiu; } +unsigned MipsABIInfo::GetPtrAndOp() const { + return ArePtrs64bit() ? Mips::AND64 : Mips::AND; +} + unsigned MipsABIInfo::GetGPRMoveOp() const { return ArePtrs64bit() ? Mips::OR64 : Mips::OR; } diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.h b/llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.h index ac09a4bef8c..31e6a3ed5ac 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.h +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.h @@ -70,6 +70,7 @@ public: unsigned GetZeroReg() const; unsigned GetPtrAdduOp() const; unsigned GetPtrAddiuOp() const; + unsigned GetPtrAndOp() const; unsigned GetGPRMoveOp() const; inline bool ArePtrs64bit() const { return IsN64(); } inline bool AreGprs64bit() const { return IsN32() || IsN64(); } |

