This is an archive of the discontinued LLVM Phabricator instance.

[SveEmitter] Add builtins for ternary ops (fmla, fmad, etc)
ClosedPublic

Authored by sdesmalen on Apr 27 2020, 12:59 PM.

Details

Summary

This patch adds builtins for:

  • svmad, svmla, svmls, svmsb svnmad, svnmla, svnmls, svnmsb svmla_lane, svmls_lane

These builtins come in several flavours:

  • Merge into first source vector (_m)
  • False lanes are undef (_x)
  • False lanes are zeroed (_z)

And can also have _n to indicate the last operand is a scalar.

For example:

svint32_t svmla[_n_s32]_z(svbool_t pg, svint32_t op1, svint32_t op2, int32_t op3)

Diff Detail

Event Timeline

sdesmalen created this revision.Apr 27 2020, 12:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2020, 12:59 PM
Herald added a subscriber: tschuett. · View Herald Transcript

Now that most of the functionality has been added to SveEmitter.cpp and CGBuiltin.cpp, the patches are becoming simpler and simpler. This patch is such an example, which is basically "builtin definitions + tests".

This is probably a good point to ask for some feedback how to best get these patches into Clang without spamming your inboxes too much :) I can choose to do this in individual patches for similar 'groups' of operations (like this patch does it). Alternatively I could collate them all into a single patch and put that up for review. Or I can just commit such simple changes directly if you think there is little value in reviewing these (note that any patches that require code-changes or that add some macro in the arm_sve.h header file would still go through normal review process, the question is purely about structurally simple patches like this).

Do you have any preference/suggestions how to best approach this?

I'm also happy to add other reviewers, but I'm not sure who best to add. If you have suggestions, please let me know.

efriedma accepted this revision.Apr 27 2020, 1:50 PM

LGTM

For patches that only touch arm_sve.td, I trust that you've written it correctly; if there were any mistakes, it would be very hard to catch them in review anyway. However you prefer to organize that is fine.

This revision is now accepted and ready to land.Apr 27 2020, 1:50 PM
This revision was automatically updated to reflect the committed changes.