llvm.org GIT mirror llvm / c3536b8
Add the 64-bit versions of the DS* Altivec instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41717 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 12 years ago
2 changed file(s) with 60 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
162162 def IMPLICIT_DEF_VRRC : Pseudo<(outs VRRC:$rD), (ins),"; IMPLICIT_DEF_VRRC $rD",
163163 [(set VRRC:$rD, (v4i32 (undef)))]>;
164164
165 def DSS : DSS_Form<822, (outs), (ins u5imm:$ZERO0, u5imm:$STRM,u5imm:$ZERO1,u5imm:$ZERO2),
166 "dss $STRM", LdStGeneral /*FIXME*/, []>;
167 def DSSALL: DSS_Form<822, (outs), (ins u5imm:$ONE, u5imm:$ZERO0,u5imm:$ZERO1,u5imm:$ZERO2),
168 "dssall", LdStGeneral /*FIXME*/, []>;
169 def DST : DSS_Form<342, (outs), (ins u5imm:$ZERO, u5imm:$STRM, GPRC:$rA, GPRC:$rB),
170 "dst $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
171 def DSTT : DSS_Form<342, (outs), (ins u5imm:$ONE, u5imm:$STRM, GPRC:$rA, GPRC:$rB),
172 "dstt $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
173 def DSTST : DSS_Form<374, (outs), (ins u5imm:$ZERO, u5imm:$STRM, GPRC:$rA, GPRC:$rB),
174 "dstst $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
175 def DSTSTT: DSS_Form<374, (outs), (ins u5imm:$ONE, u5imm:$STRM, GPRC:$rA, GPRC:$rB),
176 "dststt $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
165 def DSS : DSS_Form<822, (outs),
166 (ins u5imm:$ZERO0, u5imm:$STRM,u5imm:$ZERO1,u5imm:$ZERO2),
167 "dss $STRM", LdStGeneral /*FIXME*/, []>;
168 def DSSALL : DSS_Form<822, (outs),
169 (ins u5imm:$ONE, u5imm:$ZERO0,u5imm:$ZERO1,u5imm:$ZERO2),
170 "dssall", LdStGeneral /*FIXME*/, []>;
171 def DST : DSS_Form<342, (outs),
172 (ins u5imm:$ZERO, u5imm:$STRM, GPRC:$rA, GPRC:$rB),
173 "dst $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
174 def DSTT : DSS_Form<342, (outs),
175 (ins u5imm:$ONE, u5imm:$STRM, GPRC:$rA, GPRC:$rB),
176 "dstt $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
177 def DSTST : DSS_Form<374, (outs),
178 (ins u5imm:$ZERO, u5imm:$STRM, GPRC:$rA, GPRC:$rB),
179 "dstst $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
180 def DSTSTT : DSS_Form<374, (outs),
181 (ins u5imm:$ONE, u5imm:$STRM, GPRC:$rA, GPRC:$rB),
182 "dststt $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
183
184 def DST64 : DSS_Form<342, (outs),
185 (ins u5imm:$ZERO, u5imm:$STRM, G8RC:$rA, GPRC:$rB),
186 "dst $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
187 def DSTT64 : DSS_Form<342, (outs),
188 (ins u5imm:$ONE, u5imm:$STRM, G8RC:$rA, GPRC:$rB),
189 "dstt $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
190 def DSTST64 : DSS_Form<374, (outs),
191 (ins u5imm:$ZERO, u5imm:$STRM, G8RC:$rA, GPRC:$rB),
192 "dstst $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
193 def DSTSTT64 : DSS_Form<374, (outs),
194 (ins u5imm:$ONE, u5imm:$STRM, G8RC:$rA, GPRC:$rB),
195 "dststt $rA, $rB, $STRM", LdStGeneral /*FIXME*/, []>;
177196
178197 def MFVSCR : VXForm_4<1540, (outs VRRC:$vD), (ins),
179198 "mfvscr $vD", LdStGeneral,
535554 // Additional Altivec Patterns
536555 //
537556
538 // DS* intrinsics.
557 // DS* intrinsics
558 def : Pat<(int_ppc_altivec_dssall), (DSSALL 1, 0, 0, 0)>;
539559 def : Pat<(int_ppc_altivec_dss imm:$STRM), (DSS 0, imm:$STRM, 0, 0)>;
540 def : Pat<(int_ppc_altivec_dssall), (DSSALL 1, 0, 0, 0)>;
560
561 // * 32-bit
541562 def : Pat<(int_ppc_altivec_dst GPRC:$rA, GPRC:$rB, imm:$STRM),
542563 (DST 0, imm:$STRM, GPRC:$rA, GPRC:$rB)>;
543564 def : Pat<(int_ppc_altivec_dstt GPRC:$rA, GPRC:$rB, imm:$STRM),
546567 (DSTST 0, imm:$STRM, GPRC:$rA, GPRC:$rB)>;
547568 def : Pat<(int_ppc_altivec_dststt GPRC:$rA, GPRC:$rB, imm:$STRM),
548569 (DSTSTT 1, imm:$STRM, GPRC:$rA, GPRC:$rB)>;
570
571 // * 64-bit
572 def : Pat<(int_ppc_altivec_dst G8RC:$rA, GPRC:$rB, imm:$STRM),
573 (DST64 0, imm:$STRM, (i64 G8RC:$rA), GPRC:$rB)>;
574 def : Pat<(int_ppc_altivec_dstt G8RC:$rA, GPRC:$rB, imm:$STRM),
575 (DSTT64 1, imm:$STRM, (i64 G8RC:$rA), GPRC:$rB)>;
576 def : Pat<(int_ppc_altivec_dstst G8RC:$rA, GPRC:$rB, imm:$STRM),
577 (DSTST64 0, imm:$STRM, (i64 G8RC:$rA), GPRC:$rB)>;
578 def : Pat<(int_ppc_altivec_dststt G8RC:$rA, GPRC:$rB, imm:$STRM),
579 (DSTSTT64 1, imm:$STRM, (i64 G8RC:$rA), GPRC:$rB)>;
549580
550581 // Undef.
551582 def : Pat<(v16i8 (undef)), (IMPLICIT_DEF_VRRC)>;
0 ; RUN: llvm-as < %s | llc -march=ppc64 | grep dst | count 4
1
2 define hidden void @_Z4borkPc(i8* %image) {
3 entry:
4 tail call void @llvm.ppc.altivec.dst( i8* %image, i32 8, i32 0 )
5 tail call void @llvm.ppc.altivec.dstt( i8* %image, i32 8, i32 0 )
6 tail call void @llvm.ppc.altivec.dstst( i8* %image, i32 8, i32 0 )
7 tail call void @llvm.ppc.altivec.dststt( i8* %image, i32 8, i32 0 )
8 ret void
9 }
10
11 declare void @llvm.ppc.altivec.dst(i8*, i32, i32)
12 declare void @llvm.ppc.altivec.dstt(i8*, i32, i32)
13 declare void @llvm.ppc.altivec.dstst(i8*, i32, i32)
14 declare void @llvm.ppc.altivec.dststt(i8*, i32, i32)