This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix the implicit casting for the emulated intrinsics
ClosedPublic

Authored by maryammo on Feb 17 2023, 12:54 PM.

Details

Summary

This patch is to fix some implicit castings for emulated intrinsics
so that there are no lax-vector-conversions errors and warnings.

Diff Detail

Event Timeline

maryammo created this revision.Feb 17 2023, 12:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2023, 12:54 PM
maryammo requested review of this revision.Feb 17 2023, 12:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2023, 12:54 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
maryammo added reviewers: nemanjai, amyk, stefanp, Restricted Project.Feb 17 2023, 12:57 PM
nemanjai accepted this revision.Feb 20 2023, 7:50 AM

LGTM as long as the naming nit is addressed.

clang/lib/Headers/ppc_wrappers/emmintrin.h
58

The name __v2f seems strange since __vector float is a vector of 4 float values. Should this be __v4f?

This revision is now accepted and ready to land.Feb 20 2023, 7:50 AM
amyk added inline comments.Feb 21 2023, 11:44 AM
clang/lib/Headers/ppc_wrappers/emmintrin.h
58

nit: Could we also put this to where we put the double?

clang/lib/Headers/ppc_wrappers/smmintrin.h
310

Potentially silly question, but is it intentionally for that mask for be signed?

maryammo added inline comments.Feb 21 2023, 1:06 PM
clang/lib/Headers/ppc_wrappers/smmintrin.h
310

In altivec header, vec_unpackh 's parameter is either signed char or bool char, so we need explicit casting since __charmask is unsigned char.

maryammo updated this revision to Diff 499273.Feb 21 2023, 1:07 PM

Address review comments

This revision was landed with ongoing or failed builds.Feb 21 2023, 1:45 PM
This revision was automatically updated to reflect the committed changes.