This is an archive of the discontinued LLVM Phabricator instance.

[VE] Implements minimum MC layer for VE (4/4)
ClosedPublic

Authored by kaz7 on May 6 2020, 8:08 PM.

Details

Summary

This patch includes following items.

  • Adds AsmParser and minimum AsmBackend/ELFObjectWriter/MCCodeEmitter to support only LEA instruction in order to reduce the size of this patch.
  • Adds regression test of MC layer for a LEA instruction.
  • Relocations are not supported this time to reduce the size of this patch.

Depends on D79545.

Diff Detail

Event Timeline

kaz7 created this revision.May 6 2020, 8:08 PM
kaz7 added a comment.May 6 2020, 8:10 PM

This is a patch related to https://reviews.llvm.org/D78698

I divided old patch into 4, but this 4th is still big.

kaz7 planned changes to this revision.May 11 2020, 10:22 PM

I'm trying to reduce the amount of code size.

kaz7 retitled this revision from [VE] Implements minimum MC layer for VE to [VE] Implements minimum MC layer for VE (4/4).May 11 2020, 10:22 PM
kaz7 updated this revision to Diff 265957.May 24 2020, 7:39 PM

Remove several functions which is not required at this time in order to
shrink the size of modifications. Rebased to the latest D79545.

Thanks for splitting up the patches!
The VEAsmParser class is still relatively large but the tests seem to cover all cases and i don't think it makes sense to slice up a testable unit only to drive down the patch size.
This patch gives us mclayer support for 'LEA' type instructions in objects without relocations, correct? (Whether i am right or not, you might want to add to the commit message what functionality this patch provides).
LGTM except for some nits.

llvm/lib/Target/VE/AsmParser/VEAsmParser.cpp
558

Stray ;

613

typo Operand

623

I suppose there should be a TODO here for the (m)1 and (m)0 immediates?

648

typo Operand

kaz7 edited the summary of this revision. (Show Details)May 28 2020, 8:33 AM
kaz7 planned changes to this revision.May 28 2020, 8:36 AM
kaz7 marked an inline comment as done.

Thanks for reviewing. Yes, you are correct. I removed relocation features too from this patch. I added comments in the commit message. Thanks.

llvm/lib/Target/VE/AsmParser/VEAsmParser.cpp
623

Thank you for taking a look. The answer is no. This todo is for a special operand of vsld and vsrd instructions. These instructions are something like vsld %vx, (%vy, %vz), %sy, %vm. I had not noticed this special operand until I try to run my regression tests through NEC assembler. On the other hand, (m)1 and (m)0 immediate values will be implemented using individual parseMImmOperand function.

simoll added inline comments.May 28 2020, 8:49 AM
llvm/lib/Target/VE/AsmParser/VEAsmParser.cpp
623

Fair enough. What i meant is that we currently do not parse (m)1-style immediates and there should be an additional TODO in the code line(s) where we would call a hypothetical parseMImmOperand function.

kaz7 updated this revision to Diff 267104.May 28 2020, 6:14 PM

Update following suggestions and rebase.

kaz7 marked 6 inline comments as done.May 28 2020, 6:19 PM

Update inline comments.

llvm/lib/Target/VE/AsmParser/VEAsmParser.cpp
623

I see. Leaving comments to where I'm going to add a call of parseMImmOperand function is still difficult. Because the call is automatically generated by tablegen. It confuses me often also.

simoll accepted this revision.May 29 2020, 1:47 AM
This revision is now accepted and ready to land.May 29 2020, 1:47 AM
This revision was automatically updated to reflect the committed changes.