This is an archive of the discontinued LLVM Phabricator instance.

MC: Introduce the ABS8 symbol modifier.
ClosedPublic

Authored by pcc on Jan 13 2017, 11:57 AM.

Details

Summary

@ABS8 can be applied to symbols which appear as immediate operands to
instructions that have a 8-bit immediate form for that operand. It causes
the assembler to use the 8-bit form and an 8-bit relocation (e.g. R_386_8
or R_X86_64_8) for the symbol.

Event Timeline

pcc updated this revision to Diff 84346.Jan 13 2017, 11:57 AM
pcc retitled this revision from to MC: Introduce the ABS8 symbol modifier..
pcc updated this object.
pcc added reviewers: RKSimon, craig.topper, majnemer.
pcc added a subscriber: llvm-commits.
RKSimon added inline comments.
llvm/include/llvm/MC/MCExpr.h
193

Should this be VK_X86_ABS8 or do we expect other targets to use this?

pcc updated this revision to Diff 86320.Jan 30 2017, 11:38 AM
  • Address review comments
pcc added inline comments.Jan 30 2017, 11:38 AM
llvm/include/llvm/MC/MCExpr.h
193

Browsing the lists of relocations in include/llvm/Support/ELFRelocs I can see that ARM and a few other targets have 8-bit relocations, but then of course ARM represents immediate operands in a completely different way (haven't thought about other targets). Renamed to be X86-specific and we can think about a more generic name if a need arises.

This revision was automatically updated to reflect the committed changes.