This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][MC] Support expressions in getMemRIX16Encoding
ClosedPublic

Authored by sfertile on Aug 22 2018, 1:05 PM.

Details

Summary

Loosens an assert in getMemRIX16Encoding that restricts DQ-form instructions to using an immediate, so that we can assemble instructions like lxv 3, global@toc@l(3)

Diff Detail

Repository
rL LLVM

Event Timeline

sfertile created this revision.Aug 22 2018, 1:05 PM
nemanjai accepted this revision.Aug 27 2018, 7:52 AM

Other than the minor nit about the test case, this LGTM.

test/MC/PowerPC/ppc64-dq-expr.s
1 ↗(On Diff #162029)

This may be silly as I'm not familiar with similar tests, but won't you require the -f option to force the binary output to stdout?

This revision is now accepted and ready to land.Aug 27 2018, 7:52 AM
This revision was automatically updated to reflect the committed changes.
sfertile added inline comments.Aug 27 2018, 10:44 AM
test/MC/PowerPC/ppc64-dq-expr.s
1 ↗(On Diff #162029)

Not a silly question since that's the behavior I expected as well, but llvm-mc is happy to output binary to the term without -f. I just realized after committing this that I probably don't even need -o - since outputting to the term seems to be the default anyway.