xref: /freebsd-src/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrDFP.td (revision 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
1*06c3fb27SDimitry Andric//===-- PPCInstrDFP.td - PowerPC Decimal Floating Point ----*- tablegen -*-===//
2*06c3fb27SDimitry Andric//
3*06c3fb27SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*06c3fb27SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
5*06c3fb27SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*06c3fb27SDimitry Andric//
7*06c3fb27SDimitry Andric//===----------------------------------------------------------------------===//
8*06c3fb27SDimitry Andric//
9*06c3fb27SDimitry Andric// This file describes the PowerPC Decimal Floating Point (DFP) instructions.
10*06c3fb27SDimitry Andric//
11*06c3fb27SDimitry Andric//===----------------------------------------------------------------------===//
12*06c3fb27SDimitry Andric
13*06c3fb27SDimitry Andric// We provide no scheduling info for the DFP instructions.
14*06c3fb27SDimitry Andric// While they are not pseudo instructions we don't intend on scheduling them.
15*06c3fb27SDimitry Andriclet hasNoSchedulingInfo = 1 in {
16*06c3fb27SDimitry Andriclet mayRaiseFPException = 1, hasSideEffects = 0 in {
17*06c3fb27SDimitry Andric
18*06c3fb27SDimitry Andriclet isCommutable = 1 in {
19*06c3fb27SDimitry Andricdefm DADD : XForm_28r<59, 2, (outs f8rc:$RST), (ins f8rc:$RA, f8rc:$RB),
20*06c3fb27SDimitry Andric                      "dadd",  "$RST, $RA, $RB", IIC_FPGeneral, []>;
21*06c3fb27SDimitry Andric
22*06c3fb27SDimitry Andricdefm DADDQ : XForm_28r<63, 2, (outs fpairrc:$RST), (ins fpairrc:$RA, fpairrc:$RB),
23*06c3fb27SDimitry Andric                       "daddq",  "$RST, $RA, $RB", IIC_FPGeneral, []>;
24*06c3fb27SDimitry Andric}
25*06c3fb27SDimitry Andric
26*06c3fb27SDimitry Andricdefm DSUB : XForm_28r<59, 514, (outs f8rc:$RST), (ins f8rc:$RA, f8rc:$RB),
27*06c3fb27SDimitry Andric                      "dsub",  "$RST, $RA, $RB", IIC_FPGeneral, []>;
28*06c3fb27SDimitry Andric
29*06c3fb27SDimitry Andricdefm DSUBQ : XForm_28r<63, 514, (outs fpairrc:$RST), (ins fpairrc:$RA, fpairrc:$RB),
30*06c3fb27SDimitry Andric                       "dsubq",  "$RST, $RA, $RB", IIC_FPGeneral, []>;
31*06c3fb27SDimitry Andric
32*06c3fb27SDimitry Andriclet isCommutable = 1 in {
33*06c3fb27SDimitry Andricdefm DMUL : XForm_28r<59, 34, (outs f8rc:$RST), (ins f8rc:$RA, f8rc:$RB),
34*06c3fb27SDimitry Andric                      "dmul",  "$RST, $RA, $RB", IIC_FPGeneral, []>;
35*06c3fb27SDimitry Andric
36*06c3fb27SDimitry Andricdefm DMULQ : XForm_28r<63, 34, (outs fpairrc:$RST), (ins fpairrc:$RA, fpairrc:$RB),
37*06c3fb27SDimitry Andric                       "dmulq",  "$RST, $RA, $RB", IIC_FPGeneral, []>;
38*06c3fb27SDimitry Andric}
39*06c3fb27SDimitry Andric
40*06c3fb27SDimitry Andricdefm DDIV : XForm_28r<59, 546, (outs f8rc:$RST), (ins f8rc:$RA, f8rc:$RB),
41*06c3fb27SDimitry Andric                      "ddiv",  "$RST, $RA, $RB", IIC_FPGeneral, []>;
42*06c3fb27SDimitry Andric
43*06c3fb27SDimitry Andricdefm DDIVQ : XForm_28r<63, 546, (outs fpairrc:$RST), (ins fpairrc:$RA, fpairrc:$RB),
44*06c3fb27SDimitry Andric                       "ddivq",  "$RST, $RA, $RB", IIC_FPGeneral, []>;
45*06c3fb27SDimitry Andric
46*06c3fb27SDimitry Andriclet isCompare = 1 in {
47*06c3fb27SDimitry Andric  def DCMPU : XForm_17<59, 642, (outs crrc:$BF), (ins f8rc:$RA, f8rc:$RB),
48*06c3fb27SDimitry Andric                       "dcmpu $BF, $RA, $RB", IIC_FPCompare>;
49*06c3fb27SDimitry Andric
50*06c3fb27SDimitry Andric  def DCMPUQ : XForm_17<63, 642, (outs crrc:$BF), (ins fpairrc:$RA, fpairrc:$RB),
51*06c3fb27SDimitry Andric                        "dcmpuq $BF, $RA, $RB", IIC_FPCompare>;
52*06c3fb27SDimitry Andric
53*06c3fb27SDimitry Andric  def DCMPO : XForm_17<59, 130, (outs crrc:$BF), (ins f8rc:$RA, f8rc:$RB),
54*06c3fb27SDimitry Andric                       "dcmpo $BF, $RA, $RB", IIC_FPCompare>;
55*06c3fb27SDimitry Andric
56*06c3fb27SDimitry Andric  def DCMPOQ : XForm_17<63, 130, (outs crrc:$BF), (ins fpairrc:$RA, fpairrc:$RB),
57*06c3fb27SDimitry Andric                        "dcmpoq $BF, $RA, $RB", IIC_FPCompare>;
58*06c3fb27SDimitry Andric}
59*06c3fb27SDimitry Andric
60*06c3fb27SDimitry Andric// 5.6.4 DFP Quantum Adjustment Instructions
61*06c3fb27SDimitry Andricdefm DQUAI: Z23Form_TE5_FRTB5_RMC2r<59, 67, (outs f8rc:$FRT),
62*06c3fb27SDimitry Andric                                    (ins s5imm:$TE, f8rc:$FRB, u2imm:$RMC),
63*06c3fb27SDimitry Andric                                    "dquai", "$TE, $FRT, $FRB, $RMC", []>;
64*06c3fb27SDimitry Andricdefm DQUAIQ: Z23Form_TE5_FRTB5_RMC2r<63, 67, (outs fpairrc:$FRT),
65*06c3fb27SDimitry Andric                                     (ins s5imm:$TE, fpairrc:$FRB, u2imm:$RMC),
66*06c3fb27SDimitry Andric                                     "dquaiq", "$TE, $FRT, $FRB, $RMC", []>;
67*06c3fb27SDimitry Andricdefm DQUA: Z23Form_FRTAB5_RMC2r<59, 3, (outs f8rc:$FRT),
68*06c3fb27SDimitry Andric                                (ins f8rc:$FRA, f8rc:$FRB, u2imm:$RMC),
69*06c3fb27SDimitry Andric                                "dqua", "$FRT, $FRA, $FRB, $RMC", []>;
70*06c3fb27SDimitry Andricdefm DQUAQ: Z23Form_FRTAB5_RMC2r<63, 3, (outs fpairrc:$FRT),
71*06c3fb27SDimitry Andric                                 (ins fpairrc:$FRA, fpairrc:$FRB, u2imm:$RMC),
72*06c3fb27SDimitry Andric                                 "dquaq", "$FRT, $FRA, $FRB, $RMC", []>;
73*06c3fb27SDimitry Andricdefm DRRND: Z23Form_FRTAB5_RMC2r<59, 35, (outs f8rc:$FRT),
74*06c3fb27SDimitry Andric                                (ins f8rc:$FRA, f8rc:$FRB, u2imm:$RMC),
75*06c3fb27SDimitry Andric                                "drrnd", "$FRT, $FRA, $FRB, $RMC", []>;
76*06c3fb27SDimitry Andricdefm DRRNDQ: Z23Form_FRTAB5_RMC2r<63, 35, (outs fpairrc:$FRT),
77*06c3fb27SDimitry Andric                                 (ins f8rc:$FRA, fpairrc:$FRB, u2imm:$RMC),
78*06c3fb27SDimitry Andric                                 "drrndq", "$FRT, $FRA, $FRB, $RMC", []>;
79*06c3fb27SDimitry Andricdefm DRINTX: Z23Form_FRTB5_R1_RMC2r<59, 99, (outs f8rc:$FRT),
80*06c3fb27SDimitry Andric                                    (ins u1imm:$R, f8rc:$FRB, u2imm:$RMC),
81*06c3fb27SDimitry Andric                                    "drintx", "$R, $FRT, $FRB, $RMC", []>;
82*06c3fb27SDimitry Andricdefm DRINTXQ: Z23Form_FRTB5_R1_RMC2r<63, 99, (outs fpairrc:$FRT),
83*06c3fb27SDimitry Andric                                     (ins u1imm:$R, fpairrc:$FRB, u2imm:$RMC),
84*06c3fb27SDimitry Andric                                     "drintxq", "$R, $FRT, $FRB, $RMC", []>;
85*06c3fb27SDimitry Andricdefm DRINTN: Z23Form_FRTB5_R1_RMC2r<59, 227, (outs f8rc:$FRT),
86*06c3fb27SDimitry Andric                                    (ins u1imm:$R, f8rc:$FRB, u2imm:$RMC),
87*06c3fb27SDimitry Andric                                    "drintn", "$R, $FRT, $FRB, $RMC", []>;
88*06c3fb27SDimitry Andricdefm DRINTNQ: Z23Form_FRTB5_R1_RMC2r<63, 227, (outs fpairrc:$FRT),
89*06c3fb27SDimitry Andric                                     (ins u1imm:$R, fpairrc:$FRB, u2imm:$RMC),
90*06c3fb27SDimitry Andric                                     "drintnq", "$R, $FRT, $FRB, $RMC", []>;
91*06c3fb27SDimitry Andric
92*06c3fb27SDimitry Andric// 5.6.5 DFP Conversion Instructions
93*06c3fb27SDimitry Andricdefm DCTDP: XForm_26r<59, 258, (outs f8rc:$RST), (ins f8rc:$RB),
94*06c3fb27SDimitry Andric                      "dctdp", "$RST, $RB", IIC_FPGeneral, []>;
95*06c3fb27SDimitry Andricdefm DCTQPQ: XForm_26r<63, 258, (outs fpairrc:$RST), (ins f8rc:$RB),
96*06c3fb27SDimitry Andric                       "dctqpq", "$RST, $RB", IIC_FPGeneral, []>;
97*06c3fb27SDimitry Andricdefm DRSP: XForm_26r<59, 770, (outs f8rc:$RST), (ins f8rc:$RB),
98*06c3fb27SDimitry Andric                     "drsp", "$RST, $RB", IIC_FPGeneral, []>;
99*06c3fb27SDimitry Andricdefm DRDPQ: XForm_26r<63, 770, (outs fpairrc:$RST), (ins fpairrc:$RB),
100*06c3fb27SDimitry Andric                      "drdpq", "$RST, $RB", IIC_FPGeneral, []>;
101*06c3fb27SDimitry Andricdefm DCFFIX: XForm_26r<59, 802, (outs f8rc:$RST), (ins f8rc:$RB),
102*06c3fb27SDimitry Andric                       "dcffix", "$RST, $RB", IIC_FPGeneral, []>;
103*06c3fb27SDimitry Andricdefm DCFFIXQ: XForm_26r<63, 802, (outs fpairrc:$RST), (ins f8rc:$RB),
104*06c3fb27SDimitry Andric                        "dcffixq", "$RST, $RB", IIC_FPGeneral, []>;
105*06c3fb27SDimitry Andricdefm DCTFIX: XForm_26r<59, 290, (outs f8rc:$RST), (ins f8rc:$RB),
106*06c3fb27SDimitry Andric                       "dctfix", "$RST, $RB", IIC_FPGeneral, []>;
107*06c3fb27SDimitry Andricdefm DCTFIXQ: XForm_26r<63, 290, (outs f8rc:$RST), (ins fpairrc:$RB),
108*06c3fb27SDimitry Andric                        "dctfixq", "$RST, $RB", IIC_FPGeneral, []>;
109*06c3fb27SDimitry Andriclet Predicates = [HasP10Vector] in {
110*06c3fb27SDimitry Andric  def DCFFIXQQ: XForm_26<63, 994, (outs fpairrc:$RST), (ins vrrc:$RB),
111*06c3fb27SDimitry Andric                         "dcffixqq $RST, $RB", IIC_FPGeneral, []>;
112*06c3fb27SDimitry Andriclet RA = 1 in
113*06c3fb27SDimitry Andric  def DCTFIXQQ: XForm_base_r3xo<63, 994, (outs vrrc:$RST), (ins fpairrc:$RB),
114*06c3fb27SDimitry Andric                                "dctfixqq $RST, $RB", IIC_FPGeneral, []>;
115*06c3fb27SDimitry Andric} // HasP10Vector
116*06c3fb27SDimitry Andric
117*06c3fb27SDimitry Andric// 5.6.6 DFP Format Instructions
118*06c3fb27SDimitry Andricdefm DENBCD: XForm_S1_FRTB5r<59, 834, (outs f8rc:$FRT),
119*06c3fb27SDimitry Andric                              (ins u1imm:$S, f8rc:$FRB),
120*06c3fb27SDimitry Andric                              "denbcd", "$S, $FRT, $FRB", []>;
121*06c3fb27SDimitry Andricdefm DENBCDQ: XForm_S1_FRTB5r<63, 834, (outs fpairrc:$FRT),
122*06c3fb27SDimitry Andric                               (ins u1imm:$S, fpairrc:$FRB),
123*06c3fb27SDimitry Andric                               "denbcdq", "$S, $FRT, $FRB", []>;
124*06c3fb27SDimitry Andric} // mayRaiseFPException
125*06c3fb27SDimitry Andric
126*06c3fb27SDimitry Andric// 5.6.6 DFP none exception raising format instructions.
127*06c3fb27SDimitry Andricdefm DDEDPD: XForm_SP2_FRTB5r<59, 322, (outs f8rc:$FRT),
128*06c3fb27SDimitry Andric                              (ins u2imm:$SP, f8rc:$FRB),
129*06c3fb27SDimitry Andric                              "ddedpd", "$SP, $FRT, $FRB", []>;
130*06c3fb27SDimitry Andricdefm DDEDPDQ: XForm_SP2_FRTB5r<63, 322, (outs fpairrc:$FRT),
131*06c3fb27SDimitry Andric                               (ins u2imm:$SP, fpairrc:$FRB),
132*06c3fb27SDimitry Andric                               "ddedpdq", "$SP, $FRT, $FRB", []>;
133*06c3fb27SDimitry Andricdefm DXEX: XForm_26r<59, 354, (outs f8rc:$RST), (ins f8rc:$RB),
134*06c3fb27SDimitry Andric                     "dxex", "$RST, $RB", NoItinerary, []>;
135*06c3fb27SDimitry Andricdefm DXEXQ: XForm_26r<63, 354, (outs f8rc:$RST), (ins fpairrc:$RB),
136*06c3fb27SDimitry Andric                      "dxexq", "$RST, $RB", NoItinerary, []>;
137*06c3fb27SDimitry Andricdefm DIEX: XForm_base_r3xo_r<59, 866, (outs f8rc:$RST),
138*06c3fb27SDimitry Andric                             (ins f8rc:$RA, f8rc:$RB),
139*06c3fb27SDimitry Andric                             "diex", "$RST, $RA, $RB", []>;
140*06c3fb27SDimitry Andricdefm DIEXQ: XForm_base_r3xo_r<63, 866, (outs fpairrc:$RST),
141*06c3fb27SDimitry Andric                              (ins f8rc:$RA, fpairrc:$RB),
142*06c3fb27SDimitry Andric                              "diexq", "$RST, $RA, $RB", []>;
143*06c3fb27SDimitry Andricdefm DSCLI: Z22Form_FRTA5_SH6r<59, 66, (outs f8rc:$FRT),
144*06c3fb27SDimitry Andric                               (ins f8rc:$FRA, u6imm:$SH),
145*06c3fb27SDimitry Andric                               "dscli", "$FRT, $FRA, $SH", []>;
146*06c3fb27SDimitry Andricdefm DSCLIQ: Z22Form_FRTA5_SH6r<63, 66, (outs fpairrc:$FRT),
147*06c3fb27SDimitry Andric                                (ins fpairrc:$FRA, u6imm:$SH),
148*06c3fb27SDimitry Andric                                "dscliq", "$FRT, $FRA, $SH", []>;
149*06c3fb27SDimitry Andricdefm DSCRI: Z22Form_FRTA5_SH6r<59, 98, (outs f8rc:$FRT),
150*06c3fb27SDimitry Andric                               (ins f8rc:$FRA, u6imm:$SH),
151*06c3fb27SDimitry Andric                               "dscri", "$FRT, $FRA, $SH", []>;
152*06c3fb27SDimitry Andricdefm DSCRIQ: Z22Form_FRTA5_SH6r<63, 98, (outs fpairrc:$FRT),
153*06c3fb27SDimitry Andric                                (ins fpairrc:$FRA, u6imm:$SH),
154*06c3fb27SDimitry Andric                                "dscriq", "$FRT, $FRA, $SH", []>;
155*06c3fb27SDimitry Andric
156*06c3fb27SDimitry Andric// 5.6.3 DFP Test Instructions
157*06c3fb27SDimitry Andricdef DTSTDC : Z22Form_BF3_FRA5_DCM6<59, 194, (outs crrc:$BF),
158*06c3fb27SDimitry Andric                                   (ins f8rc:$FRA, u6imm:$DCM),
159*06c3fb27SDimitry Andric                                   "dtstdc $BF, $FRA, $DCM", IIC_FPCompare, []>;
160*06c3fb27SDimitry Andric
161*06c3fb27SDimitry Andricdef DTSTDCQ : Z22Form_BF3_FRA5_DCM6<63, 194, (outs crrc:$BF),
162*06c3fb27SDimitry Andric                                    (ins fpairrc:$FRA, u6imm:$DCM),
163*06c3fb27SDimitry Andric                                    "dtstdcq $BF, $FRA, $DCM", IIC_FPCompare, []>;
164*06c3fb27SDimitry Andric
165*06c3fb27SDimitry Andricdef DTSTDG : Z22Form_BF3_FRA5_DCM6<59, 226, (outs crrc:$BF),
166*06c3fb27SDimitry Andric                                   (ins f8rc:$FRA, u6imm:$DCM),
167*06c3fb27SDimitry Andric                                   "dtstdg $BF, $FRA, $DCM", IIC_FPCompare, []>;
168*06c3fb27SDimitry Andric
169*06c3fb27SDimitry Andricdef DTSTDGQ : Z22Form_BF3_FRA5_DCM6<63, 226, (outs crrc:$BF),
170*06c3fb27SDimitry Andric                                    (ins fpairrc:$FRA, u6imm:$DCM),
171*06c3fb27SDimitry Andric                                    "dtstdgq $BF, $FRA, $DCM", IIC_FPCompare, []>;
172*06c3fb27SDimitry Andric
173*06c3fb27SDimitry Andricdef DTSTEX : XForm_17<59, 162, (outs crrc:$BF), (ins f8rc:$RA, f8rc:$RB),
174*06c3fb27SDimitry Andric                      "dtstex $BF, $RA, $RB", IIC_FPCompare>;
175*06c3fb27SDimitry Andric
176*06c3fb27SDimitry Andricdef DTSTEXQ : XForm_17<63, 162, (outs crrc:$BF), (ins fpairrc:$RA, fpairrc:$RB),
177*06c3fb27SDimitry Andric                       "dtstexq $BF, $RA, $RB", IIC_FPCompare>;
178*06c3fb27SDimitry Andric
179*06c3fb27SDimitry Andricdef DTSTSF : XForm_17<59, 674, (outs crrc:$BF), (ins f8rc:$RA, f8rc:$RB),
180*06c3fb27SDimitry Andric                      "dtstsf $BF, $RA, $RB", IIC_FPCompare>;
181*06c3fb27SDimitry Andric
182*06c3fb27SDimitry Andricdef DTSTSFQ : XForm_17<63, 674, (outs crrc:$BF), (ins f8rc:$RA, fpairrc:$RB),
183*06c3fb27SDimitry Andric                       "dtstsfq $BF, $RA, $RB", IIC_FPCompare>;
184*06c3fb27SDimitry Andric
185*06c3fb27SDimitry Andricdef DTSTSFI : XForm_BF3_UIM6_FRB5<59, 675, (outs crrc:$BF),
186*06c3fb27SDimitry Andric                                  (ins u6imm:$UIM, f8rc:$FRB),
187*06c3fb27SDimitry Andric                                  "dtstsfi $BF, $UIM, $FRB", IIC_FPCompare, []>;
188*06c3fb27SDimitry Andric
189*06c3fb27SDimitry Andricdef DTSTSFIQ : XForm_BF3_UIM6_FRB5<63, 675, (outs crrc:$BF),
190*06c3fb27SDimitry Andric                                   (ins u6imm:$UIM, fpairrc:$FRB),
191*06c3fb27SDimitry Andric                                   "dtstsfiq $BF, $UIM, $FRB", IIC_FPCompare, []>;
192*06c3fb27SDimitry Andric
193*06c3fb27SDimitry Andric} // hasNoSchedulingInfo
194