Page MenuHomePhabricator

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

Authored by steven.zhang on Tue, Mar 10, 1:14 AM.

Details

Reviewers
nemanjai
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.Tue, Mar 10, 1:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptTue, Mar 10, 1:14 AM