@@ -2918,6 +2918,39 @@ def : Pat<(PPCstore_scal_int_from_vsr f64:$src, XForm:$dst, 8),
29182918 (STXSDX $src, XForm:$dst)>;
29192919def : Pat<(PPCstore_scal_int_from_vsr f128:$src, XForm:$dst, 8),
29202920 (STXSDX (COPY_TO_REGCLASS $src, VSFRC), XForm:$dst)>;
2921+
2922+ def : Pat<(f32 (PPCvsx_cmpsel f32:$lhs, f32:$rhs, f32:$tval, f32:$fval, SETOEQ)),
2923+ (COPY_TO_REGCLASS (XXSEL
2924+ (COPY_TO_REGCLASS $tval, VSRC), (COPY_TO_REGCLASS $fval, VSRC),
2925+ (XVCMPEQSP (COPY_TO_REGCLASS $lhs, VSRC),
2926+ (COPY_TO_REGCLASS $rhs, VSRC))), VSSRC)>;
2927+ def : Pat<(f32 (PPCvsx_cmpsel f32:$lhs, f32:$rhs, f32:$tval, f32:$fval, SETOGE)),
2928+ (COPY_TO_REGCLASS (XXSEL
2929+ (COPY_TO_REGCLASS $tval, VSRC), (COPY_TO_REGCLASS $fval, VSRC),
2930+ (XVCMPGESP (COPY_TO_REGCLASS $lhs, VSRC),
2931+ (COPY_TO_REGCLASS $rhs, VSRC))), VSSRC)>;
2932+ def : Pat<(f32 (PPCvsx_cmpsel f32:$lhs, f32:$rhs, f32:$tval, f32:$fval, SETOGT)),
2933+ (COPY_TO_REGCLASS (XXSEL
2934+ (COPY_TO_REGCLASS $tval, VSRC),
2935+ (COPY_TO_REGCLASS $fval, VSRC),
2936+ (XVCMPGTSP (COPY_TO_REGCLASS $lhs, VSRC),
2937+ (COPY_TO_REGCLASS $rhs, VSRC))), VSSRC)>;
2938+ def : Pat<(f64 (PPCvsx_cmpsel f64:$lhs, f64:$rhs, f64:$tval, f64:$fval, SETOEQ)),
2939+ (COPY_TO_REGCLASS (XXSEL
2940+ (COPY_TO_REGCLASS $tval, VSRC), (COPY_TO_REGCLASS $fval, VSRC),
2941+ (XVCMPEQDP (COPY_TO_REGCLASS $lhs, VSRC),
2942+ (COPY_TO_REGCLASS $rhs, VSRC))), VSFRC)>;
2943+ def : Pat<(f64 (PPCvsx_cmpsel f64:$lhs, f64:$rhs, f64:$tval, f64:$fval, SETOGE)),
2944+ (COPY_TO_REGCLASS (XXSEL
2945+ (COPY_TO_REGCLASS $tval, VSRC), (COPY_TO_REGCLASS $fval, VSRC),
2946+ (XVCMPGEDP (COPY_TO_REGCLASS $lhs, VSRC),
2947+ (COPY_TO_REGCLASS $rhs, VSRC))), VSFRC)>;
2948+ def : Pat<(f64 (PPCvsx_cmpsel f64:$lhs, f64:$rhs, f64:$tval, f64:$fval, SETOGT)),
2949+ (COPY_TO_REGCLASS (XXSEL
2950+ (COPY_TO_REGCLASS $tval, VSRC),
2951+ (COPY_TO_REGCLASS $fval, VSRC),
2952+ (XVCMPGTDP (COPY_TO_REGCLASS $lhs, VSRC),
2953+ (COPY_TO_REGCLASS $rhs, VSRC))), VSFRC)>;
29212954} // HasVSX
29222955
29232956// Any big endian VSX subtarget.
@@ -3933,6 +3966,19 @@ foreach Ty = [v4i32, v4f32, v2i64, v2f64] in {
39333966 def : Pat<(store Ty:$rS, XForm:$dst), (STXVX $rS, XForm:$dst)>;
39343967}
39353968
3969+ def : Pat<(f64 (PPCvsx_cmpsel f64:$lhs, f64:$rhs, f64:$tval, f64:$fval, SETOEQ)),
3970+ (COPY_TO_REGCLASS (XXSEL (COPY_TO_REGCLASS $tval, VSRC),
3971+ (COPY_TO_REGCLASS $fval, VSRC),
3972+ (XSCMPEQDP $lhs, $rhs)), VSFRC)>;
3973+ def : Pat<(f64 (PPCvsx_cmpsel f64:$lhs, f64:$rhs, f64:$tval, f64:$fval, SETOGE)),
3974+ (COPY_TO_REGCLASS (XXSEL (COPY_TO_REGCLASS $tval, VSRC),
3975+ (COPY_TO_REGCLASS $fval, VSRC),
3976+ (XSCMPGEDP $lhs, $rhs)), VSFRC)>;
3977+ def : Pat<(f64 (PPCvsx_cmpsel f64:$lhs, f64:$rhs, f64:$tval, f64:$fval, SETOGT)),
3978+ (COPY_TO_REGCLASS (XXSEL (COPY_TO_REGCLASS $tval, VSRC),
3979+ (COPY_TO_REGCLASS $fval, VSRC),
3980+ (XSCMPGTDP $lhs, $rhs)), VSFRC)>;
3981+
39363982def : Pat<(f128 (load DQForm:$src)),
39373983 (COPY_TO_REGCLASS (LXV memrix16:$src), VRRC)>;
39383984def : Pat<(f128 (load XForm:$src)),
0 commit comments