This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Add bitcast/extract_subvec. of fp16 vectors
ClosedPublic

Authored by dnsampaio on Apr 12 2019, 7:56 AM.

Details

Summary

This patch adds some basic operations for fp16
vectors, such as bitcast from fp16 to i16,
required to perform extract_subvector (also added
here) and extract_element.

Diff Detail

Repository
rL LLVM

Event Timeline

dnsampaio created this revision.Apr 12 2019, 7:56 AM
dnsampaio edited reviewers, added: ostannard; removed: olista01.Apr 16 2019, 2:25 AM

It looks like we are still missing a lot of the conversions between f16 vectors and other vector types, I think it would be better to add them all at once, so it's easier to check we haven't messed any.

dnsampaio updated this revision to Diff 196475.Apr 24 2019, 9:51 AM

Added new conversions, tests, and different float-abi

Thanks for fixing the order of the patterns, it's much easier to check for completeness now.

lib/Target/ARM/ARMInstrNEON.td
7223 ↗(On Diff #196475)

Duplicate of the line above.

test/CodeGen/ARM/fp16-vector-basic-instructions.ll
1 ↗(On Diff #196475)

The expected output for this file is much more complicated than it needs to be, and depends on lots of things other than the changes you've made here. The shuffles in particular can generate a lot of extra code which we aren't trying to test here. Something like big-endian-neon-bitconv.ll would be better, using a similar pattern of code to test each type.

dnsampaio updated this revision to Diff 196660.Apr 25 2019, 9:42 AM

Fixes requested

  • Removed duplicated line
  • Changed tests as to not use vector shuffling. However, as vector are always loaded / passed as a f64 or v2f64, it is required to always perform some operation of the original type before bitcasting and performing an operation in the new type, else it always performs vrev64.16
dnsampaio marked an inline comment as done.Apr 25 2019, 9:48 AM

Removed duplicated %s in test file.

ostannard accepted this revision.Apr 29 2019, 2:05 AM

LGTM, thanks.

This revision is now accepted and ready to land.Apr 29 2019, 2:05 AM
This revision was automatically updated to reflect the committed changes.