This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Select the select_cc for f64/f32 as set_cc + vselect if VSX enabled
AbandonedPublic

Authored by qiucf on Mar 10 2020, 1:14 AM.

Details

Reviewers
nemanjai
steven.zhang
jsji
Group Reviewers
Restricted Project
Summary

This is the motivated case:

define double @test(double %a, double %b, double %c, double %d) {
entry:
  %cmp = fcmp fast oeq double %a, %b
  %cond = select fast i1 %cmp, double %c, double %d
  ret double %cond
}

We are now using cmp + branch for this case. It could be improved with cmp + xxsel which is explicit suggested by Power ISA programming node.

Programming Note
xscmpeqdp can be used to implement the 
C/C++/Java conditional operation, RESULT = (x==y) ? a : b.
xscmpeqdp fEQ,fX,fY
xxsel           fRESULT,fA,fB,fEQ

Diff Detail

Event Timeline

steven.zhang created this revision.Mar 10 2020, 1:14 AM

Gentle ping ...

steven.zhang planned changes to this revision.Nov 25 2020, 6:37 PM
qiucf commandeered this revision.Sep 1 2021, 12:11 AM
qiucf added a reviewer: steven.zhang.
jsji resigned from this revision.Jun 2 2022, 7:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2022, 7:59 AM
qiucf abandoned this revision.Sep 19 2023, 12:46 AM

This can be split into two patches. One is already on GitHub https://github.com/llvm/llvm-project/pull/65295. Close.