This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] added FP16 vcvth intrinsic support
ClosedPublic

Authored by LukeGeeson on May 1 2018, 6:35 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

LukeGeeson created this revision.May 1 2018, 6:35 AM
lebedev.ri added inline comments.
test/CodeGen/AArch64/fp16_intrinsic_scalar_2op.ll
131–200 ↗(On Diff #144703)

Is it intentional that there are no ; CHECK lines?

Hi Luke, thanks for fixing this, some first comments inlined.

lib/Target/AArch64/AArch64InstrFormats.td
5983 ↗(On Diff #144703)

Remove comments

7793 ↗(On Diff #144703)

nit: trailing whitespace?

7799 ↗(On Diff #144703)

nit: don't think you break up the lines like this.

lib/Target/AArch64/AArch64InstrInfo.td
4880 ↗(On Diff #144703)

Better not to introduce new line breaks here and also below.

test/CodeGen/AArch64/fp16_intrinsic_scalar_2op.ll
131 ↗(On Diff #144703)

You should add CHECK lines for all these test cases (see examples above).

LukeGeeson updated this revision to Diff 144710.May 1 2018, 7:11 AM
  • [AArch64] rm'd linebreaks, added CHECKS to fp16 instrinsics
SjoerdMeijer added inline comments.May 1 2018, 7:43 AM
test/CodeGen/AArch64/fp16_intrinsic_scalar_2op.ll
1 ↗(On Diff #144710)

Please remove this line.

14 ↗(On Diff #144710)

Please don't modify the existing test cases. There is no need to check for the %bb.0 stuff as it doesn't add any value.

146 ↗(On Diff #144710)

Please remove this line here and similar lines in the test cases below.

147 ↗(On Diff #144710)

You should create a regexp for w8, and use it in the line below. Currently the test is very fragile, because if another register gets allocated this test starts failing.

LukeGeeson updated this revision to Diff 144725.May 1 2018, 8:10 AM
LukeGeeson marked 6 inline comments as done.
  • rm'd additional %bb lines, added regex for w8

give me one moment, syntax error missed

lib/Target/AArch64/AArch64InstrFormats.td
7799 ↗(On Diff #144703)

Would you remove line 7803 too? looks better for separation

test/CodeGen/AArch64/fp16_intrinsic_scalar_2op.ll
131–200 ↗(On Diff #144703)

missed this, will add thanks

SjoerdMeijer added inline comments.May 1 2018, 8:40 AM
test/CodeGen/AArch64/fp16_intrinsic_scalar_2op.ll
156 ↗(On Diff #144725)

What is the supported range of constant 'n' for this intrinsic? If it is e.g. [1,16], I think it is best to test the minimum value 1, which is what we do here, but also the maximum value 16.
Same comment for the other intrinsics here.

LukeGeeson updated this revision to Diff 144730.May 1 2018, 8:40 AM
  • [AArch64] fixed syntax errors for FP16 intrinsics
LukeGeeson updated this revision to Diff 144844.May 2 2018, 3:20 AM
LukeGeeson marked 5 inline comments as done.
  • [AArch64] added tests for FP16 intrinsic ranges
SjoerdMeijer added inline comments.May 2 2018, 3:35 AM
lib/Target/AArch64/AArch64InstrFormats.td
7793 ↗(On Diff #144844)

Do we use OpNode?

7805 ↗(On Diff #144844)

Nit1: spaces are off: FPR16 should be aligned under U.
Nit2: space between ">{". Same for other rules below.

lib/Target/AArch64/AArch64InstrInfo.td
4869 ↗(On Diff #144844)

Do we need to pass the intrinsics opnodes?

LukeGeeson updated this revision to Diff 144862.May 2 2018, 5:22 AM
LukeGeeson marked 3 inline comments as done.
  • [AArch64] removed OpNode+intrinsic template params
LukeGeeson marked an inline comment as done.May 2 2018, 5:23 AM
LukeGeeson added inline comments.
lib/Target/AArch64/AArch64InstrFormats.td
7793 ↗(On Diff #144844)

builds and tests fine without it - removed

LukeGeeson updated this revision to Diff 144870.May 2 2018, 6:15 AM
  • [AArch64] added spaces between [] and {
LukeGeeson marked an inline comment as done.May 2 2018, 6:15 AM
SjoerdMeijer accepted this revision.May 2 2018, 6:28 AM

Thanks, looks good to me now. One more nit inlined, but no need for another review.

lib/Target/AArch64/AArch64InstrFormats.td
5982 ↗(On Diff #144870)

No changes were made here, so can you keep the old formatting?

This revision is now accepted and ready to land.May 2 2018, 6:28 AM
SjoerdMeijer requested changes to this revision.May 2 2018, 8:12 AM

Sorry, I had one more look, see question inlined.

lib/Target/AArch64/AArch64InstrFormats.td
7804 ↗(On Diff #144870)

Does this need to be vecshiftR32 and thus accept values [1,32]? If that's the case, we also need to update the tests.

7822 ↗(On Diff #144870)

We don't need to change this?

This revision now requires changes to proceed.May 2 2018, 8:12 AM
LukeGeeson updated this revision to Diff 145168.May 4 2018, 3:42 AM
LukeGeeson marked 3 inline comments as done.
  • [AArch64] modified fp16 instrinsics patterns

Local setup broken, please ignore

LukeGeeson updated this revision to Diff 145169.May 4 2018, 3:53 AM

[Aarch64 reverting diff]

LukeGeeson edited subscribers, added: SjoerdMeijer; removed: jfb, sanjoy, arsenm and 17 others.
LukeGeeson updated this revision to Diff 145179.May 4 2018, 5:51 AM

[AArch64] fixed FP16 intrinsic h pattern

LukeGeeson updated this revision to Diff 145183.May 4 2018, 6:25 AM
  • [AArch64] added 32 case for FP16 instrinsic case, fixed remarks
LukeGeeson updated this revision to Diff 145186.May 4 2018, 6:48 AM
  • [AArch64] fixed 32 case for FP16 s61 f16 test, 2op tests pass
SjoerdMeijer added inline comments.May 4 2018, 7:11 AM
lib/Target/AArch64/AArch64InstrFormats.td
5982 ↗(On Diff #145186)

Nit: trailing whitespace

7793 ↗(On Diff #145186)

Nit: unnecessary new line.

7816 ↗(On Diff #145186)

Do the HDr and DHr patterns need to be guarded by predicates [HasNEON, HasFullFP16]? Can you check if they are all predicates are correctly set here? Also looks like we can simply things here a bit: merge all patterns with the same neon and fullfp16 predicates in one block.

7834 ↗(On Diff #145186)

To keep the changes minimal, can you please move the "def h" back up where it was?

LukeGeeson updated this revision to Diff 145197.May 4 2018, 8:09 AM
LukeGeeson marked 5 inline comments as done.
  • [AArch64] moved FP16 h pattern, refactored FP16 intrinsics into block
  • [AArch64] moved FP16 h pattern, refactored FP16 intrinsics into block
  • [AArch64] removed whitespace for consistency
SjoerdMeijer accepted this revision.May 14 2018, 1:19 AM

Thanks, I think this looks OK.

This revision is now accepted and ready to land.May 14 2018, 1:19 AM
This revision was automatically updated to reflect the committed changes.