This is an archive of the discontinued LLVM Phabricator instance.

Allow negative offsets in MipsMCInstLower::LowerOperand
ClosedPublic

Authored by arichardson on Dec 3 2019, 4:19 AM.

Details

Summary

We rely on this in our CHERI backend to address the GOT by generating a
$pc-relative addresses. For this we emit the following code sequence:

lui $1, %pcrel_hi(_CHERI_CAPABILITY_TABLE_-8)
daddiu $1, $1, %pcrel_lo(_CHERI_CAPABILITY_TABLE_-4)
cgetpccincoffset $c1, $1

However, without this change the addend is implicitly converted to
UINT32_MAX and an invalid pointer value is generated.

Diff Detail

Event Timeline

arichardson created this revision.Dec 3 2019, 4:19 AM

Add missing changes to header

clang-format

Build result: pass - 60404 tests passed, 0 failed and 726 were skipped.

Log files: console-log.txt, CMakeCache.txt

Build result: pass - 60404 tests passed, 0 failed and 726 were skipped.

Log files: console-log.txt, CMakeCache.txt

Harbormaster completed remote builds in B41783: Diff 231869.
This revision is now accepted and ready to land.Dec 3 2019, 7:02 AM
This revision was automatically updated to reflect the committed changes.