This is an archive of the discontinued LLVM Phabricator instance.

[X86][FP16] add alias for f*mul_*ch intrinsics
ClosedPublic

Authored by FreddyYe on Oct 28 2021, 7:44 PM.

Details

Summary

*_mul_*ch is to align with *_mul_*s, *_mul_*d and *_mul_*h.

Diff Detail

Event Timeline

FreddyYe created this revision.Oct 28 2021, 7:44 PM
FreddyYe requested review of this revision.Oct 28 2021, 7:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2021, 7:44 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

*_mul_pch is to align with *_mul_ps annd *_mul_pd

And *_mul_ph?

*_mul_pch is to align with *_mul_ps annd *_mul_pd

And *_mul_ph?

Yes. Corrected in summary.

FreddyYe edited the summary of this revision. (Show Details)Oct 31 2021, 6:55 PM
FreddyYe updated this revision to Diff 383702.Oct 31 2021, 6:57 PM

clang-formats.

pengfei added inline comments.Nov 7 2021, 5:05 PM
clang/lib/Headers/avx512fp16intrin.h
3174

Missing these?
How about define all use macro together somewhere with comment to say thay are just aliases?

Also missing *_sch.

craig.topper added a comment.EditedNov 7 2021, 5:44 PM

Not directly related to this patch, but why is the suffix _pch and _sch when the instruction names end in CPH and CSH? It kind of seems like the correct intrinsic name would have been _mm_fmulc_ph.

Why does the name here need to be aligned with mul_ps/pd? This a "complex" multiply which is a different operation. Is gcc also going to add aliases?

Not directly related to this patch, but why is the suffix _pch and _sch when the instruction names end in CPH and CSH? It kind of seems like the correct intrinsic name would have been _mm_fmulc_ph.

Why does the name here need to be aligned with mul_ps/pd? This a "complex" multiply which is a different operation. Is gcc also going to add aliases?

I can answer the second question. The prefix "f" can be judged as the mnemonic to distinguish fma instrinsics. The suffix "c" can be judged as the mnemonic of "complex". So add "f" mnemonic in this multiply intrinsics is ambiguous. gcc will add aliases, too. The first question is also a good question. But for now, it's not very conflict to old intrinsics, I think.

Thx for review. I found I missed many intrinsics, including _fcmul_* series. they need to be aliased with cmul_*. pls wait for update.

Not directly related to this patch, but why is the suffix _pch and _sch when the instruction names end in CPH and CSH? It kind of seems like the correct intrinsic name would have been _mm_fmulc_ph.

Why does the name here need to be aligned with mul_ps/pd? This a "complex" multiply which is a different operation. Is gcc also going to add aliases?

I can answer the second question. The prefix "f" can be judged as the mnemonic to distinguish fma instrinsics. The suffix "c" can be judged as the mnemonic of "complex". So add "f" mnemonic in this multiply intrinsics is ambiguous. gcc will add aliases, too. The first question is also a good question. But for now, it's not very conflict to old intrinsics, I think.

But the mnemonic for the instructions here do include an 'F'. While the mulps/mulpd instruction names do not include an 'F'. So we're creating new intrinsics that are further away from the mnemonics of the instructions. Is your argument that the instruction mnemonics are wrong and shouldn't include an 'F'?

Not directly related to this patch, but why is the suffix _pch and _sch when the instruction names end in CPH and CSH? It kind of seems like the correct intrinsic name would have been _mm_fmulc_ph.

Why does the name here need to be aligned with mul_ps/pd? This a "complex" multiply which is a different operation. Is gcc also going to add aliases?

I can answer the second question. The prefix "f" can be judged as the mnemonic to distinguish fma instrinsics. The suffix "c" can be judged as the mnemonic of "complex". So add "f" mnemonic in this multiply intrinsics is ambiguous. gcc will add aliases, too. The first question is also a good question. But for now, it's not very conflict to old intrinsics, I think.

But the mnemonic for the instructions here do include an 'F'. While the mulps/mulpd instruction names do not include an 'F'. So we're creating new intrinsics that are further away from the mnemonics of the instructions. Is your argument that the instruction mnemonics are wrong and shouldn't include an 'F'?

Yes, our intrinsics naming convention after instruction name rule should be followed, too. So this patch is just adding the alias but not replacing them. Yes, from my opinion, it's wrong.

FreddyYe updated this revision to Diff 385443.Nov 8 2021, 4:00 AM

address comments. add alias for 36 intrinsics in all.

FreddyYe retitled this revision from [X86][FP16] add alias for *_fmul_pch intrinsics to [X86][FP16] add alias for f*mul_*ch intrinsics.Nov 8 2021, 4:02 AM
FreddyYe edited the summary of this revision. (Show Details)
pengfei accepted this revision.Nov 14 2021, 10:59 PM

LGTM. Please wait one or two days for other comments.

This revision is now accepted and ready to land.Nov 14 2021, 10:59 PM
This revision was automatically updated to reflect the committed changes.