This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][Power10] Fix VINS* (vector insert byte/half/word) instructions to have i32 arguments.
ClosedPublic

Authored by amyk on Jul 9 2020, 11:23 AM.

Details

Summary

Previously, the vins* intrinsic was incorrectly defined to have its second and third argument arguments as an i64.
This patch fixes the second and third argument of the vins* instruction and intrinsic to have i32s instead.

For example, vinsw is now defined as:

<4 x i32> @llvm.ppc.altivec.vinsw(<4 x i32>, i32, i32)

Instead of:

<4 x i32> @llvm.ppc.altivec.vinsw(<4 x i32>, i64, i32)

Diff Detail

Event Timeline

amyk created this revision.Jul 9 2020, 11:23 AM
lei added a reviewer: rzurob.Jul 9 2020, 12:10 PM
amyk edited the summary of this revision. (Show Details)Jul 9 2020, 12:47 PM
lei accepted this revision as: lei.Jul 9 2020, 1:53 PM
lei added a subscriber: lei.

LGTM

This revision is now accepted and ready to land.Jul 9 2020, 1:53 PM
rzurob requested changes to this revision.Jul 9 2020, 9:48 PM

We should update vins[bhw][lr] too. They have the same problem.

llvm/include/llvm/IR/IntrinsicsPowerPC.td
523

The same problem also occurs in vins[bhw][lr]

This revision now requires changes to proceed.Jul 9 2020, 9:48 PM
amyk marked an inline comment as done.Jul 10 2020, 7:26 AM
amyk added inline comments.
llvm/include/llvm/IR/IntrinsicsPowerPC.td
523

Ah, I missed that. Thank you for bringing that to my attention. I'll look into it.

amyk updated this revision to Diff 277153.Jul 10 2020, 3:09 PM
amyk retitled this revision from [PowerPC][Power10] Fix the VINSW instruction to have an i32 argument. to [PowerPC][Power10] Fix VINS* (vector insert byte/half/word) instructions to have i32 arguments..
amyk edited the summary of this revision. (Show Details)

Updated revision to fix vector insert byte/half/word versions to have an i32 argument.

Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2020, 3:09 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
bsaleil accepted this revision as: bsaleil.Jul 13 2020, 3:13 PM
bsaleil added a subscriber: bsaleil.

LGTM

nemanjai accepted this revision.Jul 14 2020, 4:11 AM

LGTM aside from a minor nit regarding the description.

clang/include/clang/Basic/BuiltinsPPC.def
324 ↗(On Diff #277153)

The description of this review mentions the second argument but you are changing the second and third argument. Please fix the description.

@rzurob This cannot proceed without your approval since you requested changes.

rzurob accepted this revision.Jul 14 2020, 6:01 AM

LGTM. Thanks!

This revision is now accepted and ready to land.Jul 14 2020, 6:01 AM
This revision was automatically updated to reflect the committed changes.