Page MenuHomePhabricator

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

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


Group Reviewers
Restricted Project

This is the motivated case:

define double @test(double %a, double %b, double %c, double %d) {
  %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