This is an archive of the discontinued LLVM Phabricator instance.

add support for -print-imm-hex for AArch64
ClosedPublic

Authored by pawosm01 on Feb 5 2016, 9:38 AM.

Details

Summary

Most immediates are printed in Aarch64InstPrinter using 'formatImm' macro,
but not all of them.

Implementation contains following rules:

  • floating point immediates are always printed as decimal
  • signed integer immediates are printed depends on flag settings (for negative values 'formatImm' macro prints the value as i.e -0x01 which may be convenient when imm is an address or offset)
  • logical immediates are always printed as hex
  • the 64-bit immediate for advSIMD, encoded in "a:b:c:d:e:f:g:h" is always printed as hex
  • the 64-bit immedaite in exception generation instructions like: brk, dcps1, dcps2, dcps3, hlt, hvc, smc, svc is always printed as hex
  • the rest of immediates is printed depends on availability of -print-imm-hex

Signed-off-by: Maciej Gabka <maciej.gabka@arm.com>
Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>

Diff Detail

Repository
rL LLVM

Event Timeline

pawosm01 updated this revision to Diff 47022.Feb 5 2016, 9:38 AM
pawosm01 retitled this revision from to add support for -print-imm-hex for AArch64.
pawosm01 updated this object.
pawosm01 set the repository for this revision to rL LLVM.
jmolloy edited edge metadata.Feb 15 2016, 7:07 AM

Hi Pawel,

Thanks for this - it generally looks good to me. Just one comment.

James

lib/Target/AArch64/InstPrinter/AArch64InstPrinter.h
107

Is this dead code you're deleting?

You're right, this patch smuggles elimination of two dead functions. I've prepared alternative version of this patch which does not do that.

pawosm01 updated this revision to Diff 48063.Feb 16 2016, 4:12 AM
pawosm01 edited edge metadata.

This is altered version of the patch - no dead code elimination and it applies cleanly on todays LLVM git master. 'make check' completes successfully.

jmolloy accepted this revision.Feb 16 2016, 9:40 AM
jmolloy edited edge metadata.

LGTM, thanks!

This revision is now accepted and ready to land.Feb 16 2016, 9:40 AM
pawosm01 closed this revision.Apr 21 2016, 11:49 AM
pawosm01 removed a reviewer: aemerson.