@@ -1666,18 +1666,18 @@ let mayLoad = 0, mayStore = 1, Predicates = [PairedVectorMemops, PrefixInstrs] i
16661666
16671667let Predicates = [PairedVectorMemops] in {
16681668 // Intrinsics for Paired Vector Loads.
1669- def : Pat<(v256i1 (int_ppc_vsx_lxvp iaddrX16 :$src)), (LXVP memrix16:$src)>;
1670- def : Pat<(v256i1 (int_ppc_vsx_lxvp xaddrX16 :$src)), (LXVPX xaddrX16 :$src)>;
1669+ def : Pat<(v256i1 (int_ppc_vsx_lxvp DQForm :$src)), (LXVP memrix16:$src)>;
1670+ def : Pat<(v256i1 (int_ppc_vsx_lxvp XForm :$src)), (LXVPX XForm :$src)>;
16711671 let Predicates = [PairedVectorMemops, PrefixInstrs] in {
1672- def : Pat<(v256i1 (int_ppc_vsx_lxvp iaddrX34 :$src)), (PLXVP memri34:$src)>;
1672+ def : Pat<(v256i1 (int_ppc_vsx_lxvp PDForm :$src)), (PLXVP memri34:$src)>;
16731673 }
16741674 // Intrinsics for Paired Vector Stores.
1675- def : Pat<(int_ppc_vsx_stxvp v256i1:$XSp, iaddrX16 :$dst),
1675+ def : Pat<(int_ppc_vsx_stxvp v256i1:$XSp, DQForm :$dst),
16761676 (STXVP $XSp, memrix16:$dst)>;
1677- def : Pat<(int_ppc_vsx_stxvp v256i1:$XSp, xaddrX16 :$dst),
1678- (STXVPX $XSp, xaddrX16 :$dst)>;
1677+ def : Pat<(int_ppc_vsx_stxvp v256i1:$XSp, XForm :$dst),
1678+ (STXVPX $XSp, XForm :$dst)>;
16791679 let Predicates = [PairedVectorMemops, PrefixInstrs] in {
1680- def : Pat<(int_ppc_vsx_stxvp v256i1:$XSp, iaddrX34 :$dst),
1680+ def : Pat<(int_ppc_vsx_stxvp v256i1:$XSp, PDForm :$dst),
16811681 (PSTXVP $XSp, memri34:$dst)>;
16821682 }
16831683}
@@ -2671,6 +2671,45 @@ def : Pat<(f64 nzFPImmAsi64:$A),
26712671 // nand(A, nand(B, C))
26722672 def : xxevalPattern<(or (vnot v4i32:$vA), (and v4i32:$vB, v4i32:$vC)),
26732673 !sub(255, 14)>;
2674+
2675+ // Anonymous patterns to select prefixed VSX loads and stores.
2676+ // Load / Store f128
2677+ def : Pat<(f128 (load PDForm:$src)),
2678+ (COPY_TO_REGCLASS (PLXV memri34:$src), VRRC)>;
2679+ def : Pat<(store f128:$XS, PDForm:$dst),
2680+ (PSTXV (COPY_TO_REGCLASS $XS, VSRC), memri34:$dst)>;
2681+
2682+ // Load / Store v4i32
2683+ def : Pat<(v4i32 (load PDForm:$src)), (PLXV memri34:$src)>;
2684+ def : Pat<(store v4i32:$XS, PDForm:$dst), (PSTXV $XS, memri34:$dst)>;
2685+
2686+ // Load / Store v2i64
2687+ def : Pat<(v2i64 (load PDForm:$src)), (PLXV memri34:$src)>;
2688+ def : Pat<(store v2i64:$XS, PDForm:$dst), (PSTXV $XS, memri34:$dst)>;
2689+
2690+ // Load / Store v4f32
2691+ def : Pat<(v4f32 (load PDForm:$src)), (PLXV memri34:$src)>;
2692+ def : Pat<(store v4f32:$XS, PDForm:$dst), (PSTXV $XS, memri34:$dst)>;
2693+
2694+ // Load / Store v2f64
2695+ def : Pat<(v2f64 (load PDForm:$src)), (PLXV memri34:$src)>;
2696+ def : Pat<(store v2f64:$XS, PDForm:$dst), (PSTXV $XS, memri34:$dst)>;
2697+
2698+ // Cases For PPCstore_scal_int_from_vsr
2699+ def : Pat<(PPCstore_scal_int_from_vsr
2700+ (f64 (PPCcv_fp_to_uint_in_vsr f64:$src)), PDForm:$dst, 8),
2701+ (PSTXSD (XSCVDPUXDS f64:$src), PDForm:$dst)>;
2702+ def : Pat<(PPCstore_scal_int_from_vsr
2703+ (f64 (PPCcv_fp_to_sint_in_vsr f64:$src)), PDForm:$dst, 8),
2704+ (PSTXSD (XSCVDPSXDS f64:$src), PDForm:$dst)>;
2705+ def : Pat<(PPCstore_scal_int_from_vsr
2706+ (f64 (PPCcv_fp_to_uint_in_vsr f128:$src)), PDForm:$dst, 8),
2707+ (PSTXSD (COPY_TO_REGCLASS (XSCVQPUDZ f128:$src), VFRC),
2708+ PDForm:$dst)>;
2709+ def : Pat<(PPCstore_scal_int_from_vsr
2710+ (f64 (PPCcv_fp_to_sint_in_vsr f128:$src)), PDForm:$dst, 8),
2711+ (PSTXSD (COPY_TO_REGCLASS (XSCVQPSDZ f128:$src), VFRC),
2712+ PDForm:$dst)>;
26742713}
26752714
26762715let Predicates = [PrefixInstrs] in {
@@ -2694,6 +2733,63 @@ let Predicates = [PrefixInstrs] in {
26942733 (XXBLENDVW $A, $B, $C)>;
26952734 def : Pat<(int_ppc_vsx_xxblendvd v2i64:$A, v2i64:$B, v2i64:$C),
26962735 (XXBLENDVD $A, $B, $C)>;
2736+
2737+ // Anonymous patterns to select prefixed loads and stores.
2738+ // Load i32
2739+ def : Pat<(i32 (extloadi1 PDForm:$src)), (PLBZ memri34:$src)>;
2740+ def : Pat<(i32 (zextloadi1 PDForm:$src)), (PLBZ memri34:$src)>;
2741+ def : Pat<(i32 (extloadi8 PDForm:$src)), (PLBZ memri34:$src)>;
2742+ def : Pat<(i32 (zextloadi8 PDForm:$src)), (PLBZ memri34:$src)>;
2743+ def : Pat<(i32 (extloadi16 PDForm:$src)), (PLHZ memri34:$src)>;
2744+ def : Pat<(i32 (zextloadi16 PDForm:$src)), (PLHZ memri34:$src)>;
2745+ def : Pat<(i32 (sextloadi16 PDForm:$src)), (PLHA memri34:$src)>;
2746+ def : Pat<(i32 (load PDForm:$src)), (PLWZ memri34:$src)>;
2747+
2748+ // Store i32
2749+ def : Pat<(truncstorei8 i32:$rS, PDForm:$dst), (PSTB gprc:$rS, memri34:$dst)>;
2750+ def : Pat<(truncstorei16 i32:$rS, PDForm:$dst), (PSTH gprc:$rS, memri34:$dst)>;
2751+ def : Pat<(store i32:$rS, PDForm:$dst), (PSTW gprc:$rS, memri34:$dst)>;
2752+
2753+ // Load i64
2754+ def : Pat<(i64 (extloadi1 PDForm:$src)), (PLBZ8 memri34:$src)>;
2755+ def : Pat<(i64 (zextloadi1 PDForm:$src)), (PLBZ8 memri34:$src)>;
2756+ def : Pat<(i64 (extloadi8 PDForm:$src)), (PLBZ8 memri34:$src)>;
2757+ def : Pat<(i64 (zextloadi8 PDForm:$src)), (PLBZ8 memri34:$src)>;
2758+ def : Pat<(i64 (extloadi16 PDForm:$src)), (PLHZ8 memri34:$src)>;
2759+ def : Pat<(i64 (zextloadi16 PDForm:$src)), (PLHZ8 memri34:$src)>;
2760+ def : Pat<(i64 (sextloadi16 PDForm:$src)), (PLHA8 memri34:$src)>;
2761+ def : Pat<(i64 (extloadi32 PDForm:$src)), (PLWZ8 memri34:$src)>;
2762+ def : Pat<(i64 (zextloadi32 PDForm:$src)), (PLWZ8 memri34:$src)>;
2763+ def : Pat<(i64 (sextloadi32 PDForm:$src)), (PLWA8 memri34:$src)>;
2764+ def : Pat<(i64 (load PDForm:$src)), (PLD memri34:$src)>;
2765+
2766+ // Store i64
2767+ def : Pat<(truncstorei8 i64:$rS, PDForm:$dst), (PSTB8 g8rc:$rS, memri34:$dst)>;
2768+ def : Pat<(truncstorei16 i64:$rS, PDForm:$dst), (PSTH8 g8rc:$rS, memri34:$dst)>;
2769+ def : Pat<(truncstorei32 i64:$rS, PDForm:$dst), (PSTW8 g8rc:$rS, memri34:$dst)>;
2770+ def : Pat<(store i64:$rS, PDForm:$dst), (PSTD g8rc:$rS, memri34:$dst)>;
2771+
2772+ // Load / Store f32
2773+ def : Pat<(f32 (load PDForm:$src)), (PLFS memri34:$src)>;
2774+ def : Pat<(store f32:$FRS, PDForm:$dst), (PSTFS $FRS, memri34:$dst)>;
2775+
2776+ // Load / Store f64
2777+ def : Pat<(f64 (extloadf32 PDForm:$src)),
2778+ (COPY_TO_REGCLASS (PLFS memri34:$src), VSFRC)>;
2779+ def : Pat<(f64 (load PDForm:$src)), (PLFD memri34:$src)>;
2780+ def : Pat<(store f64:$FRS, PDForm:$dst), (PSTFD $FRS, memri34:$dst)>;
2781+
2782+ // Atomic Load
2783+ def : Pat<(atomic_load_8 PDForm:$src), (PLBZ memri34:$src)>;
2784+ def : Pat<(atomic_load_16 PDForm:$src), (PLHZ memri34:$src)>;
2785+ def : Pat<(atomic_load_32 PDForm:$src), (PLWZ memri34:$src)>;
2786+ def : Pat<(atomic_load_64 PDForm:$src), (PLD memri34:$src)>;
2787+
2788+ // Atomic Store
2789+ def : Pat<(atomic_store_8 PDForm:$dst, i32:$RS), (PSTB $RS, memri34:$dst)>;
2790+ def : Pat<(atomic_store_16 PDForm:$dst, i32:$RS), (PSTH $RS, memri34:$dst)>;
2791+ def : Pat<(atomic_store_32 PDForm:$dst, i32:$RS), (PSTW $RS, memri34:$dst)>;
2792+ def : Pat<(atomic_store_64 PDForm:$dst, i64:$RS), (PSTD $RS, memri34:$dst)>;
26972793}
26982794
26992795def InsertEltShift {
0 commit comments