]> granicus.if.org Git - llvm/commit
[mips] Add support for accessing $gp as a named register.
authorDaniel Sanders <daniel.sanders@imgtec.com>
Fri, 9 Jan 2015 17:21:30 +0000 (17:21 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Fri, 9 Jan 2015 17:21:30 +0000 (17:21 +0000)
commit8d7b0bdcf022e06cac50afcf85945816a97b88ac
treef9ff0f7ef61026dc668e4048264f4721e33d8805
parente7306956180b16e32e0b10fa73829963c69dfff4
[mips] Add support for accessing $gp as a named register.

Summary:
Mips Linux uses $gp to hold a pointer to thread info structure and accesses it
with a named register. This makes this work for LLVM.

The N32 ABI doesn't quite work yet since the frontend generates incorrect IR
for this case. It neglects to truncate the 64-bit GPR to a 32-bit value before
converting to a pointer. Given correct IR (as in the testcase in this patch),
it works correctly.

Reviewers: sstankovic, vmedic, atanasyan

Reviewed By: atanasyan

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6893

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225529 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsISelLowering.cpp
lib/Target/Mips/MipsISelLowering.h
test/CodeGen/Mips/named-register-n32.ll [new file with mode: 0644]
test/CodeGen/Mips/named-register-n64.ll [new file with mode: 0644]
test/CodeGen/Mips/named-register-o32.ll [new file with mode: 0644]