1 //===- P9InstrResources.td - P9 Instruction Resource Defs -*- tablegen -*-==//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file defines the resources required by P9 instructions. This is part of
10 // the P9 processor model used for instruction scheduling. This file should
11 // contain all the instructions that may be used on Power 9. This is not
12 // just instructions that are new on Power 9 but also instructions that were
13 // available on earlier architectures and are still used in Power 9.
15 // The makeup of the P9 CPU is modeled as follows:
16 // - Each CPU is made up of two superslices.
17 // - Each superslice is made up of two slices. Therefore, there are 4 slices
19 // - Up to 6 instructions can be dispatched to each CPU. Three per superslice.
21 // - One CY (Crypto) unit P9_CY_*
22 // - One DFU (Decimal Floating Point and Quad Precision) unit P9_DFU_*
23 // - Two PM (Permute) units. One on each superslice. P9_PM_*
24 // - Two DIV (Fixed Point Divide) units. One on each superslize. P9_DIV_*
25 // - Four ALU (Fixed Point Arithmetic) units. One on each slice. P9_ALU_*
26 // - Four DP (Floating Point) units. One on each slice. P9_DP_*
27 // This also includes fixed point multiply add.
28 // - Four AGEN (Address Generation) units. One for each slice. P9_AGEN_*
29 // - Four Load/Store Queues. P9_LS_*
30 // - Each set of instructions will require a number of these resources.
31 //===----------------------------------------------------------------------===//
33 // Two cycle ALU vector operation that uses an entire superslice.
34 // Uses both ALU units (the even ALUE and odd ALUO units), two pipelines
35 // (EXECE, EXECO) and 1 dispatch (DISP) to the given superslice.
36 def : InstRW<[P9_ALUE_2C, P9_ALUO_2C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C],
38 (instregex "VADDU(B|H|W|D)M$"),
39 (instregex "VAND(C)?$"),
40 (instregex "VEXTS(B|H|W)2(D|W)(s)?$"),
41 (instregex "V_SET0(B|H)?$"),
42 (instregex "VS(R|L)(B|H|W|D)$"),
43 (instregex "VSUBU(B|H|W|D)M$"),
44 (instregex "VPOPCNT(B|H)$"),
45 (instregex "VRL(B|H|W|D)$"),
46 (instregex "VSRA(B|H|W|D)$"),
47 (instregex "XV(N)?ABS(D|S)P$"),
48 (instregex "XVCPSGN(D|S)P$"),
49 (instregex "XV(I|X)EXP(D|S)P$"),
50 (instregex "VRL(D|W)(MI|NM)$"),
51 (instregex "VMRG(E|O)W$"),
85 // Restricted Dispatch ALU operation for 3 cycles. The operation runs on a
86 // single slice. However, since it is Restricted, it requires all 3 dispatches
87 // (DISP) for that superslice.
88 def : InstRW<[P9_ALU_3C, IP_EXEC_1C, DISP_3SLOTS_1C],
90 (instregex "TABORT(D|W)C(I)?$"),
91 (instregex "MTFSB(0|1)$"),
92 (instregex "MFFSC(D)?RN(I)?$"),
93 (instregex "CMPRB(8)?$"),
94 (instregex "TD(I)?$"),
95 (instregex "TW(I)?$"),
96 (instregex "FCMPU(S|D)$"),
97 (instregex "XSTSTDC(S|D)P$"),
103 // Standard Dispatch ALU operation for 3 cycles. Only one slice used.
104 def : InstRW<[P9_ALU_3C, IP_EXEC_1C, DISP_1C],
106 (instregex "XSMAX(C|J)?DP$"),
107 (instregex "XSMIN(C|J)?DP$"),
108 (instregex "XSCMP(EQ|EXP|GE|GT|O|U)DP$"),
109 (instregex "CNT(L|T)Z(D|W)(8)?(o)?$"),
110 (instregex "POPCNT(D|W)$"),
111 (instregex "CMPB(8)?$"),
112 (instregex "SETB(8)?$"),
120 // Standard Dispatch ALU operation for 2 cycles. Only one slice used.
121 def : InstRW<[P9_ALU_2C, IP_EXEC_1C, DISP_1C],
123 (instregex "S(L|R)D$"),
124 (instregex "SRAD(I)?$"),
125 (instregex "EXTSWSLI_32_64$"),
126 (instregex "MFV(S)?RD$"),
127 (instregex "MTVSRD$"),
128 (instregex "MTVSRW(A|Z)$"),
129 (instregex "CMP(WI|LWI|W|LW)(8)?$"),
130 (instregex "CMP(L)?D(I)?$"),
131 (instregex "SUBF(I)?C(8)?$"),
132 (instregex "ANDI(S)?o(8)?$"),
133 (instregex "ADDC(8)?$"),
134 (instregex "ADDIC(8)?(o)?$"),
135 (instregex "ADD(8|4)(o)?$"),
136 (instregex "ADD(E|ME|ZE)(8)?(o)?$"),
137 (instregex "SUBF(E|ME|ZE)?(8)?(o)?$"),
138 (instregex "NEG(8)?(o)?$"),
139 (instregex "POPCNTB$"),
140 (instregex "ADD(I|IS)?(8)?$"),
141 (instregex "LI(S)?(8)?$"),
142 (instregex "(X)?OR(I|IS)?(8)?(o)?$"),
143 (instregex "NAND(8)?(o)?$"),
144 (instregex "AND(C)?(8)?(o)?$"),
145 (instregex "NOR(8)?(o)?$"),
146 (instregex "OR(C)?(8)?(o)?$"),
147 (instregex "EQV(8)?(o)?$"),
148 (instregex "EXTS(B|H|W)(8)?(_32)?(_64)?(o)?$"),
149 (instregex "ADD(4|8)(TLS)?(_)?$"),
150 (instregex "NEG(8)?$"),
151 (instregex "ADDI(S)?toc(HA|L)$"),
172 // Restricted Dispatch ALU operation for 2 cycles. The operation runs on a
173 // single slice. However, since it is Restricted, it requires all 3 dispatches
174 // (DISP) for that superslice.
175 def : InstRW<[P9_ALU_2C, IP_EXEC_1C, DISP_3SLOTS_1C],
177 (instregex "RLDC(L|R)$"),
178 (instregex "RLWIMI(8)?$"),
179 (instregex "RLDIC(L|R)(_32)?(_64)?$"),
180 (instregex "M(F|T)OCRF(8)?$"),
181 (instregex "CR(6)?(UN)?SET$"),
182 (instregex "CR(N)?(OR|AND)(C)?$"),
183 (instregex "S(L|R)W(8)?$"),
184 (instregex "RLW(INM|NM)(8)?$"),
185 (instregex "F(N)?ABS(D|S)$"),
186 (instregex "FNEG(D|S)$"),
187 (instregex "FCPSGN(D|S)$"),
188 (instregex "SRAW(I)?$"),
189 (instregex "ISEL(8)?$"),
200 // Three cycle ALU vector operation that uses an entire superslice.
201 // Uses both ALU units (the even ALUE and odd ALUO units), two pipelines
202 // (EXECE, EXECO) and 1 dispatch (DISP) to the given superslice.
203 def : InstRW<[P9_ALUE_3C, P9_ALUO_3C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C],
205 (instregex "M(T|F)VSCR$"),
206 (instregex "VCMPNEZ(B|H|W)$"),
207 (instregex "VCMPEQU(B|H|W|D)$"),
208 (instregex "VCMPNE(B|H|W)$"),
209 (instregex "VABSDU(B|H|W)$"),
210 (instregex "VADDU(B|H|W)S$"),
211 (instregex "VAVG(S|U)(B|H|W)$"),
212 (instregex "VCMP(EQ|GE|GT)FP(o)?$"),
213 (instregex "VCMPBFP(o)?$"),
214 (instregex "VC(L|T)Z(B|H|W|D)$"),
215 (instregex "VADDS(B|H|W)S$"),
216 (instregex "V(MIN|MAX)FP$"),
217 (instregex "V(MIN|MAX)(S|U)(B|H|W|D)$"),
285 // 7 cycle DP vector operation that uses an entire superslice.
286 // Uses both DP units (the even DPE and odd DPO units), two pipelines (EXECE,
287 // EXECO) and all three dispatches (DISP) to the given superslice.
288 def : InstRW<[P9_DPE_7C, P9_DPO_7C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C],
395 // 5 cycle Restricted DP operation. One DP unit, one EXEC pipeline and all three
396 // dispatch units for the superslice.
397 def : InstRW<[P9_DP_5C, IP_EXEC_1C, DISP_3SLOTS_1C],
399 (instregex "MADD(HD|HDU|LD|LD8)$"),
400 (instregex "MUL(HD|HW|LD|LI|LI8|LW)(U)?$")
403 // 7 cycle Restricted DP operation. One DP unit, one EXEC pipeline and all three
404 // dispatch units for the superslice.
405 def : InstRW<[P9_DP_7C, IP_EXEC_1C, DISP_3SLOTS_1C],
408 (instregex "FRI(N|P|Z|M)(D|S)$"),
409 (instregex "FRE(S)?$"),
410 (instregex "FADD(S)?$"),
411 (instregex "FMSUB(S)?$"),
412 (instregex "FMADD(S)?$"),
413 (instregex "FSUB(S)?$"),
414 (instregex "FCFID(U)?(S)?$"),
415 (instregex "FCTID(U)?(Z)?$"),
416 (instregex "FCTIW(U)?(Z)?$"),
417 (instregex "FRSQRTE(S)?$"),
446 // 7 cycle Restricted DP operation and one 3 cycle ALU operation.
447 // These operations can be done in parallel. The DP is restricted so we need a
448 // full 4 dispatches.
449 def : InstRW<[P9_DP_7C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
450 DISP_3SLOTS_1C, DISP_1C],
452 (instregex "FSEL(D|S)o$")
455 // 5 Cycle Restricted DP operation and one 2 cycle ALU operation.
456 def : InstRW<[P9_DPOpAndALUOp_7C, IP_EXEC_1C, IP_EXEC_1C,
457 DISP_3SLOTS_1C, DISP_1C],
459 (instregex "MUL(H|L)(D|W)(U)?o$")
462 // 7 cycle Restricted DP operation and one 3 cycle ALU operation.
463 // These operations must be done sequentially.The DP is restricted so we need a
464 // full 4 dispatches.
465 def : InstRW<[P9_DPOpAndALU2Op_10C, IP_EXEC_1C, IP_EXEC_1C,
466 DISP_3SLOTS_1C, DISP_1C],
468 (instregex "FRI(N|P|Z|M)(D|S)o$"),
469 (instregex "FRE(S)?o$"),
470 (instregex "FADD(S)?o$"),
471 (instregex "FSUB(S)?o$"),
472 (instregex "F(N)?MSUB(S)?o$"),
473 (instregex "F(N)?MADD(S)?o$"),
474 (instregex "FCFID(U)?(S)?o$"),
475 (instregex "FCTID(U)?(Z)?o$"),
476 (instregex "FCTIW(U)?(Z)?o$"),
477 (instregex "FMUL(S)?o$"),
478 (instregex "FRSQRTE(S)?o$"),
482 // 7 cycle DP operation. One DP unit, one EXEC pipeline and 1 dispatch units.
483 def : InstRW<[P9_DP_7C, IP_EXEC_1C, DISP_1C],
518 // Three Cycle PM operation. Only one PM unit per superslice so we use the whole
519 // superslice. That includes both exec pipelines (EXECO, EXECE) and one
521 def : InstRW<[P9_PM_3C, IP_EXECO_1C, IP_EXECE_1C, DISP_1C],
523 (instregex "LVS(L|R)$"),
524 (instregex "VSPLTIS(W|H|B)$"),
525 (instregex "VSPLT(W|H|B)(s)?$"),
526 (instregex "V_SETALLONES(B|H)?$"),
527 (instregex "VEXTRACTU(B|H|W)$"),
528 (instregex "VINSERT(B|H|W|D)$"),
626 // 12 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
627 // superslice. That includes both exec pipelines (EXECO, EXECE) and one
629 def : InstRW<[P9_DFU_12C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C],
650 // 23 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
651 // superslice. That includes both exec pipelines (EXECO, EXECE) and one
653 def : InstRW<[P9_DFU_23C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C],
658 // 24 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
659 // superslice. That includes both exec pipelines (EXECO, EXECE) and one
661 def : InstRW<[P9_DFU_24C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C],
675 // 37 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
676 // superslice. That includes both exec pipelines (EXECO, EXECE) and one
678 def : InstRW<[P9_DFU_37C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C],
683 // 58 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
684 // superslice. That includes both exec pipelines (EXECO, EXECE) and one
686 def : InstRW<[P9_DFU_58C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C],
692 // 76 Cycle DFU operation. Only one DFU unit per CPU so we use a whole
693 // superslice. That includes both exec pipelines (EXECO, EXECE) and all three
695 def : InstRW<[P9_DFU_76C, IP_EXECE_1C, IP_EXECO_1C, DISP_1C],
701 // 6 Cycle Load uses a single slice.
702 def : InstRW<[P9_LS_6C, IP_AGEN_1C, DISP_1C],
704 (instregex "LXVL(L)?")
707 // 5 Cycle Load uses a single slice.
708 def : InstRW<[P9_LS_5C, IP_AGEN_1C, DISP_1C],
710 (instregex "LVE(B|H|W)X$"),
711 (instregex "LVX(L)?"),
712 (instregex "LXSI(B|H)ZX$"),
726 // 4 Cycle Load uses a single slice.
727 def : InstRW<[P9_LS_4C, IP_AGEN_1C, DISP_1C],
729 (instregex "DCB(F|T|ST)(EP)?$"),
730 (instregex "DCBZ(L)?(EP)?$"),
731 (instregex "DCBTST(EP)?$"),
732 (instregex "CP_COPY(8)?$"),
733 (instregex "CP_PASTE(8)?$"),
734 (instregex "ICBI(EP)?$"),
735 (instregex "ICBT(LS)?$"),
736 (instregex "LBARX(L)?$"),
737 (instregex "LBZ(CIX|8|X|X8|XTLS|XTLS_32)?(_)?$"),
738 (instregex "LD(ARX|ARXL|BRX|CIX|X|XTLS)?(_)?$"),
739 (instregex "LH(A|B)RX(L)?(8)?$"),
740 (instregex "LHZ(8|CIX|X|X8|XTLS|XTLS_32)?(_)?$"),
741 (instregex "LWARX(L)?$"),
742 (instregex "LWBRX(8)?$"),
743 (instregex "LWZ(8|CIX|X|X8|XTLS|XTLS_32)?(_)?$"),
755 // 4 Cycle Restricted load uses a single slice but the dispatch for the whole
757 def : InstRW<[P9_LS_4C, IP_AGEN_1C, DISP_3SLOTS_1C],
764 // Cracked Load Instructions.
765 // Load instructions that can be done in parallel.
766 def : InstRW<[P9_LS_4C, P9_LS_4C, IP_AGEN_1C, IP_AGEN_1C,
777 // Cracked Load Instruction.
778 // Requires Load and ALU pieces totaling 6 cycles. The Load and ALU
779 // operations can be run in parallel.
780 def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_EXEC_1C, IP_AGEN_1C,
781 DISP_PAIR_1C, DISP_PAIR_1C],
783 (instregex "L(W|H)ZU(X)?(8)?$")
786 // Cracked TEND Instruction.
787 // Requires Load and ALU pieces totaling 6 cycles. The Load and ALU
788 // operations can be run in parallel.
789 def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_EXEC_1C, IP_AGEN_1C,
796 // Cracked Store Instruction
797 // Consecutive Store and ALU instructions. The store is restricted and requires
799 def : InstRW<[P9_StoreAndALUOp_3C, IP_EXEC_1C, IP_EXEC_1C, IP_AGEN_1C,
800 DISP_3SLOTS_1C, DISP_1C],
802 (instregex "ST(B|H|W|D)CX$")
805 // Cracked Load Instruction.
806 // Two consecutive load operations for a total of 8 cycles.
807 def : InstRW<[P9_LoadAndLoadOp_8C, IP_AGEN_1C, IP_AGEN_1C,
813 // Cracked Load instruction.
814 // Requires consecutive Load and ALU pieces totaling 6 cycles. The Load and ALU
815 // operations cannot be done at the same time and so their latencies are added.
816 def : InstRW<[P9_LoadAndALUOp_6C, IP_EXEC_1C, IP_AGEN_1C,
819 (instregex "LHA(X)?(8)?$"),
820 (instregex "CP_PASTE(8)?o$"),
821 (instregex "LWA(X)?(_32)?$"),
825 // Cracked Restricted Load instruction.
826 // Requires consecutive Load and ALU pieces totaling 6 cycles. The Load and ALU
827 // operations cannot be done at the same time and so their latencies are added.
828 // Full 6 dispatches are required as this is both cracked and restricted.
829 def : InstRW<[P9_LoadAndALUOp_6C, IP_EXEC_1C, IP_AGEN_1C,
830 DISP_3SLOTS_1C, DISP_3SLOTS_1C],
835 // Cracked Load instruction.
836 // Requires consecutive Load and ALU pieces totaling 7 cycles. The Load and ALU
837 // operations cannot be done at the same time and so their latencies are added.
838 // Full 4 dispatches are required as this is a cracked instruction.
839 def : InstRW<[P9_LoadAndALUOp_7C, IP_AGEN_1C, IP_EXEC_1C, DISP_1C, DISP_1C],
845 // Cracked Load instruction.
846 // Requires consecutive Load (4 cycles) and ALU (3 cycles) pieces totaling 7
847 // cycles. The Load and ALU operations cannot be done at the same time and so
848 // their latencies are added.
849 // Full 6 dispatches are required as this is a restricted instruction.
850 def : InstRW<[P9_LoadAndALU2Op_7C, IP_AGEN_1C, IP_EXEC_1C,
851 DISP_3SLOTS_1C, DISP_3SLOTS_1C],
857 // Cracked Load instruction.
858 // Requires consecutive Load and ALU pieces totaling 8 cycles. The Load and ALU
859 // operations cannot be done at the same time and so their latencies are added.
860 // Full 4 dispatches are required as this is a cracked instruction.
861 def : InstRW<[P9_LoadAndALU2Op_8C, IP_AGEN_1C, IP_EXEC_1C, DISP_1C, DISP_1C],
869 // Cracked 3-Way Load Instruction
870 // Load with two ALU operations that depend on each other
871 def : InstRW<[P9_LoadAndALUOp_6C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
872 DISP_PAIR_1C, DISP_PAIR_1C, DISP_1C],
874 (instregex "LHAU(X)?(8)?$"),
878 // Cracked Load that requires the PM resource.
879 // Since the Load and the PM cannot be done at the same time the latencies are
880 // added. Requires 8 cycles. Since the PM requires the full superslice we need
881 // both EXECE, EXECO pipelines as well as 1 dispatch for the PM. The Load
882 // requires the remaining 1 dispatch.
883 def : InstRW<[P9_LoadAndPMOp_8C, IP_AGEN_1C, IP_EXECE_1C, IP_EXECO_1C,
891 // Single slice Restricted store operation. The restricted operation requires
892 // all three dispatches for the superslice.
893 def : InstRW<[P9_LS_1C, IP_EXEC_1C, IP_AGEN_1C, DISP_3SLOTS_1C],
895 (instregex "STF(S|D|IWX|SX|DX)$"),
896 (instregex "STXS(D|DX|SPX|IWX|IBX|IHX|SP)(v)?$"),
897 (instregex "STW(8)?$"),
898 (instregex "(D|X)FSTORE(f32|f64)$"),
899 (instregex "ST(W|H|D)BRX$"),
900 (instregex "ST(B|H|D)(8)?$"),
901 (instregex "ST(B|W|H|D)(CI)?X(TLS|TLS_32)?(8)?(_)?$"),
909 // Vector Store Instruction
910 // Requires the whole superslice and therefore requires one dispatch
911 // as well as both the Even and Odd exec pipelines.
912 def : InstRW<[P9_LS_1C, IP_EXECE_1C, IP_EXECO_1C, IP_AGEN_1C, DISP_1C],
914 (instregex "STVE(B|H|W)X$"),
915 (instregex "STVX(L)?$"),
916 (instregex "STXV(B16X|H8X|W4X|D2X|L|LL|X)?$")
919 // 5 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
920 // superslice. That includes both exec pipelines (EXECO, EXECE) and two
922 def : InstRW<[P9_DIV_5C, IP_EXECE_1C, IP_EXECO_1C, DISP_EVEN_1C],
924 (instregex "MTCTR(8)?(loop)?$"),
925 (instregex "MTLR(8)?$")
928 // 12 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
929 // superslice. That includes both exec pipelines (EXECO, EXECE) and two
931 def : InstRW<[P9_DIV_12C, IP_EXECE_1C, IP_EXECO_1C, DISP_EVEN_1C],
933 (instregex "M(T|F)VRSAVE(v)?$"),
934 (instregex "M(T|F)PMR$"),
935 (instregex "M(T|F)TB(8)?$"),
936 (instregex "MF(SPR|CTR|LR)(8)?$"),
937 (instregex "M(T|F)MSR(D)?$"),
938 (instregex "MTSPR(8)?$")
941 // 16 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
942 // superslice. That includes both exec pipelines (EXECO, EXECE) and two
944 def : InstRW<[P9_DIV_16C_8, IP_EXECO_1C, IP_EXECE_1C, DISP_EVEN_1C],
951 // 24 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
952 // superslice. That includes both exec pipelines (EXECO, EXECE) and two
954 def : InstRW<[P9_DIV_24C_8, IP_EXECO_1C, IP_EXECE_1C, DISP_EVEN_1C],
965 // 40 Cycle DIV operation. Only one DIV unit per superslice so we use the whole
966 // superslice. That includes both exec pipelines (EXECO, EXECE) and all three
968 def : InstRW<[P9_DIV_40C_8, IP_EXECO_1C, IP_EXECE_1C, DISP_EVEN_1C],
974 // Cracked DIV and ALU operation. Requires one full slice for the ALU operation
975 // and one full superslice for the DIV operation since there is only one DIV per
976 // superslice. Latency of DIV plus ALU is 26.
977 def : InstRW<[P9_IntDivAndALUOp_18C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
978 DISP_EVEN_1C, DISP_1C],
980 (instregex "DIVW(U)?(O)?o$")
983 // Cracked DIV and ALU operation. Requires one full slice for the ALU operation
984 // and one full superslice for the DIV operation since there is only one DIV per
985 // superslice. Latency of DIV plus ALU is 26.
986 def : InstRW<[P9_IntDivAndALUOp_26C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
987 DISP_EVEN_1C, DISP_1C],
995 // Cracked DIV and ALU operation. Requires one full slice for the ALU operation
996 // and one full superslice for the DIV operation since there is only one DIV per
997 // superslice. Latency of DIV plus ALU is 42.
998 def : InstRW<[P9_IntDivAndALUOp_42C_8, IP_EXECE_1C, IP_EXECO_1C, IP_EXEC_1C,
999 DISP_EVEN_1C, DISP_1C],
1005 // CR access instructions in _BrMCR, IIC_BrMCRX.
1007 // Cracked, restricted, ALU operations.
1008 // Here the two ALU ops can actually be done in parallel and therefore the
1009 // latencies are not added together. Otherwise this is like having two
1010 // instructions running together on two pipelines and 6 dispatches. ALU ops are
1012 def : InstRW<[P9_ALU_2C, P9_ALU_2C, IP_EXEC_1C, IP_EXEC_1C,
1013 DISP_3SLOTS_1C, DISP_3SLOTS_1C],
1019 // Cracked ALU operations.
1020 // Here the two ALU ops can actually be done in parallel and therefore the
1021 // latencies are not added together. Otherwise this is like having two
1022 // instructions running together on two pipelines and 2 dispatches. ALU ops are
1024 def : InstRW<[P9_ALU_2C, P9_ALU_2C, IP_EXEC_1C, IP_EXEC_1C,
1027 (instregex "ADDC(8)?o$"),
1028 (instregex "SUBFC(8)?o$")
1031 // Cracked ALU operations.
1032 // Two ALU ops can be done in parallel.
1033 // One is three cycle ALU the ohter is a two cycle ALU.
1034 // One of the ALU ops is restricted the other is not so we have a total of
1036 def : InstRW<[P9_ALU_2C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
1037 DISP_3SLOTS_1C, DISP_1C],
1039 (instregex "F(N)?ABS(D|S)o$"),
1040 (instregex "FCPSGN(D|S)o$"),
1041 (instregex "FNEG(D|S)o$"),
1045 // Cracked ALU operations.
1046 // Here the two ALU ops can actually be done in parallel and therefore the
1047 // latencies are not added together. Otherwise this is like having two
1048 // instructions running together on two pipelines and 2 dispatches.
1049 // ALU ops are 3 cycles each.
1050 def : InstRW<[P9_ALU_3C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
1056 // Cracked Restricted ALU operations.
1057 // Here the two ALU ops can actually be done in parallel and therefore the
1058 // latencies are not added together. Otherwise this is like having two
1059 // instructions running together on two pipelines and 6 dispatches.
1060 // ALU ops are 3 cycles each.
1061 def : InstRW<[P9_ALU_3C, P9_ALU_3C, IP_EXEC_1C, IP_EXEC_1C,
1062 DISP_3SLOTS_1C, DISP_3SLOTS_1C],
1064 (instregex "MTFSF(b|o)?$"),
1065 (instregex "MTFSFI(o)?$")
1068 // Cracked instruction made of two ALU ops.
1069 // The two ops cannot be done in parallel.
1070 // One of the ALU ops is restricted and takes 3 dispatches.
1071 def : InstRW<[P9_ALUOpAndALUOp_4C, IP_EXEC_1C, IP_EXEC_1C,
1072 DISP_3SLOTS_1C, DISP_1C],
1074 (instregex "RLD(I)?C(R|L)o$"),
1075 (instregex "RLW(IMI|INM|NM)(8)?o$"),
1076 (instregex "SLW(8)?o$"),
1077 (instregex "SRAW(I)?o$"),
1078 (instregex "SRW(8)?o$"),
1083 // Cracked instruction made of two ALU ops.
1084 // The two ops cannot be done in parallel.
1085 // Both of the ALU ops are restricted and take 3 dispatches.
1086 def : InstRW<[P9_ALU2OpAndALU2Op_6C, IP_EXEC_1C, IP_EXEC_1C,
1087 DISP_3SLOTS_1C, DISP_3SLOTS_1C],
1089 (instregex "MFFS(L|CE|o)?$")
1092 // Cracked ALU instruction composed of three consecutive 2 cycle loads for a
1093 // total of 6 cycles. All of the ALU operations are also restricted so each
1094 // takes 3 dispatches for a total of 9.
1095 def : InstRW<[P9_ALUOpAndALUOpAndALUOp_6C, IP_EXEC_1C, IP_EXEC_1C, IP_EXEC_1C,
1096 DISP_3SLOTS_1C, DISP_3SLOTS_1C, DISP_3SLOTS_1C],
1098 (instregex "MFCR(8)?$")
1101 // Cracked instruction made of two ALU ops.
1102 // The two ops cannot be done in parallel.
1103 def : InstRW<[P9_ALUOpAndALUOp_4C, IP_EXEC_1C, IP_EXEC_1C, DISP_1C, DISP_1C],
1105 (instregex "EXTSWSLI_32_64o$"),
1106 (instregex "SRAD(I)?o$"),
1113 // 33 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
1114 def : InstRW<[P9_DP_33C_8, IP_EXEC_1C, DISP_3SLOTS_1C],
1119 // 33 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
1120 def : InstRW<[P9_DPOpAndALU2Op_36C_8, IP_EXEC_1C, IP_EXEC_1C,
1121 DISP_3SLOTS_1C, DISP_1C],
1126 // 36 Cycle DP Instruction.
1127 // Instruction can be done on a single slice.
1128 def : InstRW<[P9_DP_36C_10, IP_EXEC_1C, DISP_1C],
1133 // 36 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
1134 def : InstRW<[P9_DP_36C_10, IP_EXEC_1C, DISP_3SLOTS_1C],
1139 // 36 Cycle DP Vector Instruction.
1140 def : InstRW<[P9_DPE_36C_10, P9_DPO_36C_10, IP_EXECE_1C, IP_EXECO_1C,
1146 // 27 Cycle DP Vector Instruction.
1147 def : InstRW<[P9_DPE_27C_10, P9_DPO_27C_10, IP_EXECE_1C, IP_EXECO_1C,
1153 // 36 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
1154 def : InstRW<[P9_DPOpAndALU2Op_39C_10, IP_EXEC_1C, IP_EXEC_1C,
1155 DISP_3SLOTS_1C, DISP_1C],
1160 // 26 Cycle DP Instruction.
1161 def : InstRW<[P9_DP_26C_5, IP_EXEC_1C, DISP_1C],
1166 // 26 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
1167 def : InstRW<[P9_DP_26C_5, IP_EXEC_1C, DISP_3SLOTS_1C],
1172 // 26 Cycle DP Instruction Restricted and Cracked with 3 Cycle ALU.
1173 def : InstRW<[P9_DPOpAndALU2Op_29C_5, IP_EXEC_1C, IP_EXEC_1C,
1174 DISP_3SLOTS_1C, DISP_1C],
1179 // 33 Cycle DP Instruction. Takes one slice and 1 dispatch.
1180 def : InstRW<[P9_DP_33C_8, IP_EXEC_1C, DISP_1C],
1185 // 22 Cycle DP Instruction Restricted. Takes one slice and 3 dispatches.
1186 def : InstRW<[P9_DP_22C_5, IP_EXEC_1C, DISP_3SLOTS_1C],
1191 // 22 Cycle DP Instruction Restricted and Cracked with 2 Cycle ALU.
1192 def : InstRW<[P9_DPOpAndALU2Op_25C_5, IP_EXEC_1C, IP_EXEC_1C,
1193 DISP_3SLOTS_1C, DISP_1C],
1198 // 22 Cycle DP Instruction. Takes one slice and 1 dispatch.
1199 def : InstRW<[P9_DP_22C_5, IP_EXEC_1C, DISP_1C],
1204 // 24 Cycle DP Vector Instruction. Takes one full superslice.
1205 // Includes both EXECE, EXECO pipelines and 1 dispatch for the given
1207 def : InstRW<[P9_DPE_24C_8, P9_DPO_24C_8, IP_EXECE_1C, IP_EXECO_1C,
1213 // 33 Cycle DP Vector Instruction. Takes one full superslice.
1214 // Includes both EXECE, EXECO pipelines and 1 dispatch for the given
1216 def : InstRW<[P9_DPE_33C_8, P9_DPO_33C_8, IP_EXECE_1C, IP_EXECO_1C,
1222 // Instruction cracked into three pieces. One Load and two ALU operations.
1223 // The Load and one of the ALU ops cannot be run at the same time and so the
1224 // latencies are added together for 6 cycles. The remainaing ALU is 2 cycles.
1225 // Both the load and the ALU that depends on it are restricted and so they take
1226 // a total of 7 dispatches. The final 2 dispatches come from the second ALU op.
1227 // The two EXEC pipelines are for the 2 ALUs while the AGEN is for the load.
1228 def : InstRW<[P9_LoadAndALU2Op_7C, P9_ALU_2C,
1229 IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
1230 DISP_3SLOTS_1C, DISP_3SLOTS_1C, DISP_1C],
1232 (instregex "LF(SU|SUX)$")
1235 // Cracked instruction made up of a Store and an ALU. The ALU does not depend on
1236 // the store and so it can be run at the same time as the store. The store is
1238 def : InstRW<[P9_LS_1C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C, IP_EXEC_1C,
1239 DISP_3SLOTS_1C, DISP_1C],
1241 (instregex "STF(S|D)U(X)?$"),
1242 (instregex "ST(B|H|W|D)U(X)?(8)?$")
1245 // Cracked instruction made up of a Load and an ALU. The ALU does not depend on
1246 // the load and so it can be run at the same time as the load.
1247 def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C,
1248 DISP_PAIR_1C, DISP_PAIR_1C],
1250 (instregex "LBZU(X)?(8)?$"),
1251 (instregex "LDU(X)?$")
1254 // Cracked instruction made up of a Load and an ALU. The ALU does not depend on
1255 // the load and so it can be run at the same time as the load. The load is also
1256 // restricted. 3 dispatches are from the restricted load while the other two
1257 // are from the ALU. The AGEN pipeline is from the load and the EXEC pipeline
1258 // is required for the ALU.
1259 def : InstRW<[P9_LS_4C, P9_ALU_2C, IP_AGEN_1C, IP_EXEC_1C,
1260 DISP_3SLOTS_1C, DISP_1C],
1262 (instregex "LF(DU|DUX)$")
1265 // Crypto Instructions
1267 // 6 Cycle CY operation. Only one CY unit per CPU so we use a whole
1268 // superslice. That includes both exec pipelines (EXECO, EXECE) and one
1270 def : InstRW<[P9_CY_6C, IP_EXECO_1C, IP_EXECE_1C, DISP_1C],
1272 (instregex "VPMSUM(B|H|W|D)$"),
1273 (instregex "V(N)?CIPHER(LAST)?$"),
1277 // Branch Instructions
1280 def : InstRW<[P9_BR_2C, DISP_BR_1C],
1282 (instregex "BCCCTR(L)?(8)?$"),
1283 (instregex "BCCL(A|R|RL)?$"),
1284 (instregex "BCCTR(L)?(8)?(n)?$"),
1285 (instregex "BD(N)?Z(8|A|Am|Ap|m|p)?$"),
1286 (instregex "BD(N)?ZL(A|Am|Ap|R|R8|RL|RLm|RLp|Rm|Rp|m|p)?$"),
1287 (instregex "BL(_TLS|_NOP)?$"),
1288 (instregex "BL8(_TLS|_NOP|_NOP_TLS|_TLS_)?$"),
1289 (instregex "BLA(8|8_NOP)?$"),
1290 (instregex "BLR(8|L)?$"),
1291 (instregex "TAILB(A)?(8)?$"),
1292 (instregex "TAILBCTR(8)?$"),
1293 (instregex "gBC(A|Aat|CTR|CTRL|L|LA|LAat|LR|LRL|Lat|at)?$"),
1294 (instregex "BCLR(L)?(n)?$"),
1295 (instregex "BCTR(L)?(8)?$"),
1309 // Five Cycle Branch with a 2 Cycle ALU Op
1310 // Operations must be done consecutively and not in parallel.
1311 def : InstRW<[P9_BROpAndALUOp_7C, IP_EXEC_1C, DISP_BR_1C, DISP_1C],
1316 // Special Extracted Instructions For Atomics
1319 def : InstRW<[P9_LS_1C, P9_LS_1C, P9_LS_4C, P9_LS_4C, P9_LS_4C,
1320 IP_EXEC_1C, IP_EXEC_1C, IP_AGEN_1C, IP_AGEN_1C, IP_AGEN_1C,
1321 IP_AGEN_1C, IP_AGEN_1C, DISP_1C, DISP_3SLOTS_1C,
1322 DISP_3SLOTS_1C, DISP_1C, DISP_1C, DISP_1C],
1324 (instregex "L(D|W)AT$")
1328 def : InstRW<[P9_LS_1C, P9_LS_4C, P9_LS_4C, IP_EXEC_1C, IP_AGEN_1C, IP_AGEN_1C,
1329 IP_AGEN_1C, DISP_1C, DISP_3SLOTS_1C, DISP_1C],
1331 (instregex "ST(D|W)AT$")
1334 // Signal Processing Engine (SPE) Instructions
1335 // These instructions are not supported on Power 9
1344 (instregex "EVADD(I)?W$"),
1345 (instregex "EVADD(SM|SS|UM|US)IAAW$"),
1346 (instregex "EVAND(C)?$"),
1347 (instregex "EVCMP(EQ|GTS|GTU|LTS|LTU)$"),
1348 (instregex "EVCNTL(S|Z)W$"),
1349 (instregex "EVDIVW(S|U)$"),
1350 (instregex "EVEXTS(B|H)$"),
1351 (instregex "EVLD(H|W|D)(X)?$"),
1352 (instregex "EVLHH(E|OS|OU)SPLAT(X)?$"),
1353 (instregex "EVLWHE(X)?$"),
1354 (instregex "EVLWHO(S|U)(X)?$"),
1355 (instregex "EVLW(H|W)SPLAT(X)?$"),
1356 (instregex "EVMERGE(HI|LO|HILO|LOHI)$"),
1357 (instregex "EVMHEG(S|U)M(F|I)A(A|N)$"),
1358 (instregex "EVMHES(M|S)(F|I)(A|AA|AAW|ANW)?$"),
1359 (instregex "EVMHEU(M|S)I(A|AA|AAW|ANW)?$"),
1360 (instregex "EVMHOG(U|S)M(F|I)A(A|N)$"),
1361 (instregex "EVMHOS(M|S)(F|I)(A|AA|AAW|ANW)?$"),
1362 (instregex "EVMHOU(M|S)I(A|AA|ANW|AAW)?$"),
1363 (instregex "EVMWHS(M|S)(F|FA|I|IA)$"),
1364 (instregex "EVMWHUMI(A)?$"),
1365 (instregex "EVMWLS(M|S)IA(A|N)W$"),
1366 (instregex "EVMWLU(M|S)I(A|AA|AAW|ANW)?$"),
1367 (instregex "EVMWSM(F|I)(A|AA|AN)?$"),
1368 (instregex "EVMWSSF(A|AA|AN)?$"),
1369 (instregex "EVMWUMI(A|AA|AN)?$"),
1370 (instregex "EV(N|X)?OR(C)?$"),
1371 (instregex "EVR(LW|LWI|NDW)$"),
1372 (instregex "EVSLW(I)?$"),
1373 (instregex "EVSPLAT(F)?I$"),
1374 (instregex "EVSRW(I)?(S|U)$"),
1375 (instregex "EVST(DD|DH|DW|WHE|WHO|WWE|WWO)(X)?$"),
1376 (instregex "EVSUBF(S|U)(M|S)IAAW$"),
1377 (instregex "EVSUB(I)?FW$")
1378 )> { let Unsupported = 1; }
1380 // General Instructions without scheduling support.
1383 (instregex "(H)?RFI(D)?$"),
1384 (instregex "DSS(ALL)?$"),
1385 (instregex "DST(ST)?(T)?(64)?$"),
1386 (instregex "ICBL(C|Q)$"),
1387 (instregex "L(W|H|B)EPX$"),
1388 (instregex "ST(W|H|B)EPX$"),
1389 (instregex "(L|ST)FDEPX$"),
1390 (instregex "M(T|F)SR(IN)?$"),
1391 (instregex "M(T|F)DCR$"),
1392 (instregex "NOP_GT_PWR(6|7)$"),
1393 (instregex "TLB(IA|IVAX|SX|SX2|SX2D|LD|LI|RE|RE2|WE|WE2)$"),
1394 (instregex "WRTEE(I)?$"),
1413 )> { let Unsupported = 1; }