PPCSchedule440.td 34.6 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600
//===-- PPCSchedule440.td - PPC 440 Scheduling Definitions -*- tablegen -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// Primary reference:
// PowerPC 440x6 Embedded Processor Core User's Manual.
// IBM (as updated in) 2010.

// The basic PPC 440 does not include a floating-point unit; the pipeline
// timings here are constructed to match the FP2 unit shipped with the
// PPC-440- and PPC-450-based Blue Gene (L and P) supercomputers.
// References:
// S. Chatterjee, et al. Design and exploitation of a high-performance
// SIMD floating-point unit for Blue Gene/L.
// IBM J. Res. & Dev. 49 (2/3) March/May 2005.
// also:
// Carlos Sosa and Brant Knudson. IBM System Blue Gene Solution:
// Blue Gene/P Application Development.
// IBM (as updated in) 2009.

//===----------------------------------------------------------------------===//
// Functional units on the PowerPC 440/450 chip sets
//
def P440_DISS1  : FuncUnit; // Issue unit 1
def P440_DISS2  : FuncUnit; // Issue unit 2
def P440_LRACC  : FuncUnit; // Register access and dispatch for
                            // the simple integer (J-pipe) and
                            // load/store (L-pipe) pipelines
def P440_IRACC  : FuncUnit; // Register access and dispatch for
                            // the complex integer (I-pipe) pipeline
def P440_FRACC  : FuncUnit; // Register access and dispatch for
                            // the floating-point execution (F-pipe) pipeline
def P440_IEXE1  : FuncUnit; // Execution stage 1 for the I pipeline
def P440_IEXE2  : FuncUnit; // Execution stage 2 for the I pipeline
def P440_IWB    : FuncUnit; // Write-back unit for the I pipeline
def P440_JEXE1  : FuncUnit; // Execution stage 1 for the J pipeline
def P440_JEXE2  : FuncUnit; // Execution stage 2 for the J pipeline
def P440_JWB    : FuncUnit; // Write-back unit for the J pipeline
def P440_AGEN   : FuncUnit; // Address generation for the L pipeline
def P440_CRD    : FuncUnit; // D-cache access for the L pipeline
def P440_LWB    : FuncUnit; // Write-back unit for the L pipeline
def P440_FEXE1  : FuncUnit; // Execution stage 1 for the F pipeline
def P440_FEXE2  : FuncUnit; // Execution stage 2 for the F pipeline
def P440_FEXE3  : FuncUnit; // Execution stage 3 for the F pipeline
def P440_FEXE4  : FuncUnit; // Execution stage 4 for the F pipeline
def P440_FEXE5  : FuncUnit; // Execution stage 5 for the F pipeline
def P440_FEXE6  : FuncUnit; // Execution stage 6 for the F pipeline
def P440_FWB    : FuncUnit; // Write-back unit for the F pipeline

def P440_LWARX_Hold : FuncUnit; // This is a pseudo-unit which is used
                                // to make sure that no lwarx/stwcx.
                                // instructions are issued while another
                                // lwarx/stwcx. is in the L pipe.

def P440_GPR_Bypass : Bypass; // The bypass for general-purpose regs.
def P440_FPR_Bypass : Bypass; // The bypass for floating-point regs.

// Notes:
// Instructions are held in the FRACC, LRACC and IRACC pipeline
// stages until their source operands become ready. Exceptions:
//  - Store instructions will hold in the AGEN stage
//  - The integer multiply-accumulate instruction will hold in
//    the IEXE1 stage
//
// For most I-pipe operations, the result is available at the end of
// the IEXE1 stage. Operations such as multiply and divide must
// continue to execute in IEXE2 and IWB. Divide resides in IWB for
// 33 cycles (multiply also calculates its result in IWB). For all
// J-pipe instructions, the result is available
// at the end of the JEXE1 stage. Loads have a 3-cycle latency
// (data is not available until after the LWB stage).
//
// The L1 cache hit latency is four cycles for floating point loads
// and three cycles for integer loads.
//
// The stwcx. instruction requires both the LRACC and the IRACC
// dispatch stages. It must be issued from DISS0.
//
// All lwarx/stwcx. instructions hold in LRACC if another
// uncommitted lwarx/stwcx. is in AGEN, CRD, or LWB.
//
// msync (a.k.a. sync) and mbar will hold in LWB until all load/store
// resources are empty. AGEN and CRD are held empty until the msync/mbar
// commits.
//
// Most floating-point instructions, computational and move,
// have a 5-cycle latency. Divide takes longer (30 cycles). Instructions that
// update the CR take 2 cycles. Stores take 3 cycles and, as mentioned above,
// loads take 4 cycles (for L1 hit).

//
// This file defines the itinerary class data for the PPC 440 processor.
//
//===----------------------------------------------------------------------===//


def PPC440Itineraries : ProcessorItineraries<
  [P440_DISS1, P440_DISS2, P440_FRACC, P440_IRACC, P440_IEXE1, P440_IEXE2,
   P440_IWB, P440_LRACC, P440_JEXE1, P440_JEXE2, P440_JWB, P440_AGEN, P440_CRD,
   P440_LWB, P440_FEXE1, P440_FEXE2, P440_FEXE3, P440_FEXE4, P440_FEXE5,
   P440_FEXE6, P440_FWB, P440_LWARX_Hold],
  [P440_GPR_Bypass, P440_FPR_Bypass], [
  InstrItinData<IIC_IntSimple,  [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC, P440_LRACC]>,
                                 InstrStage<1, [P440_IEXE1, P440_JEXE1]>,
                                 InstrStage<1, [P440_IEXE2, P440_JEXE2]>,
                                 InstrStage<1, [P440_IWB, P440_JWB]>],
                                [2, 0, 0],
                                [P440_GPR_Bypass,
                                 P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_IntGeneral, [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC, P440_LRACC]>,
                                 InstrStage<1, [P440_IEXE1, P440_JEXE1]>,
                                 InstrStage<1, [P440_IEXE2, P440_JEXE2]>,
                                 InstrStage<1, [P440_IWB, P440_JWB]>],
                                [2, 0, 0],
                                [P440_GPR_Bypass,
                                 P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_IntISEL,    [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC, P440_LRACC]>,
                                 InstrStage<1, [P440_IEXE1, P440_JEXE1]>,
                                 InstrStage<1, [P440_IEXE2, P440_JEXE2]>,
                                 InstrStage<1, [P440_IWB, P440_JWB]>],
                                [2, 0, 0, 0],
                                [P440_GPR_Bypass,
                                 P440_GPR_Bypass, P440_GPR_Bypass, NoBypass]>,
  InstrItinData<IIC_IntCompare, [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC, P440_LRACC]>,
                                 InstrStage<1, [P440_IEXE1, P440_JEXE1]>,
                                 InstrStage<1, [P440_IEXE2, P440_JEXE2]>,
                                 InstrStage<1, [P440_IWB, P440_JWB]>],
                                [2, 0, 0],
                                [NoBypass, P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_IntDivW,    [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<33, [P440_IWB]>],
                                [36, 0, 0],
                                [NoBypass, P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_IntMFFS,    [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [3, 0, 0],
                                [P440_GPR_Bypass,
                                 P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_IntMTFSB0,  [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [3, 0, 0],
                                [P440_GPR_Bypass,
                                 P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_IntMulHW,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [4, 0, 0],
                                [NoBypass, P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_IntMulHWU,  [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [4, 0, 0],
                                [NoBypass, P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_IntMulLI,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [4, 0, 0],
                                [NoBypass, P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_IntRotate,  [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC, P440_LRACC]>,
                                 InstrStage<1, [P440_IEXE1, P440_JEXE1]>,
                                 InstrStage<1, [P440_IEXE2, P440_JEXE2]>,
                                 InstrStage<1, [P440_IWB, P440_JWB]>],
                                [2, 0, 0],
                                [P440_GPR_Bypass,
                                 P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_IntShift,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC, P440_LRACC]>,
                                 InstrStage<1, [P440_IEXE1, P440_JEXE1]>,
                                 InstrStage<1, [P440_IEXE2, P440_JEXE2]>,
                                 InstrStage<1, [P440_IWB, P440_JWB]>],
                                [2, 0, 0],
                                [P440_GPR_Bypass,
                                 P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_IntTrapW,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [2, 0],
                                [P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_BrB,        [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [4, 0],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_BrCR,       [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [4, 0, 0],
                                [NoBypass, P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_BrMCR,      [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [4, 0, 0],
                                [NoBypass, P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_BrMCRX,     [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [4, 0, 0],
                                [NoBypass, P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStDCBA,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStDCBF,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStDCBI,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStLoad,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<2, [P440_LWB]>],
                                [5, 1, 1],
                                [P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStLoadUpd,[InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<2, [P440_LWB]>],
                                [5, 2, 1, 1],
                                [P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStLoadUpdX,[InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<2, [P440_LWB]>],
                                [5, 2, 1, 1],
                                [P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStStore,  [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<2, [P440_LWB]>],
                                [1, 1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStICBI,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [4, 1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStSTFD,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [1, 1, 1],
                                [NoBypass, P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStSTFDU,  [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [2, 1, 1, 1],
                                [NoBypass, P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStLFD,    [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<2, [P440_LWB]>],
                                [5, 1, 1],
                                [NoBypass, P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStLFDU,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [5, 2, 1, 1],
                                [NoBypass, P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStLFDUX,  [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [5, 2, 1, 1],
                                [NoBypass, P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStLHA,    [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [4, 1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStLHAU,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [4, 1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStLHAUX,  [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [4, 1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStLMW,    [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [4, 1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStLWARX,  [InstrStage<1, [P440_DISS1]>,
                                 InstrStage<1, [P440_IRACC], 0>,
                                 InstrStage<4, [P440_LWARX_Hold], 0>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [4, 1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStSTD,    [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<2, [P440_LWB]>],
                                [4, 1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStSTU,    [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<2, [P440_LWB]>],
                                [2, 1, 1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStSTUX,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<2, [P440_LWB]>],
                                [2, 1, 1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStSTDCX,  [InstrStage<1, [P440_DISS1]>,
                                 InstrStage<1, [P440_IRACC], 0>,
                                 InstrStage<4, [P440_LWARX_Hold], 0>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [4, 1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStSTWCX,  [InstrStage<1, [P440_DISS1]>,
                                 InstrStage<1, [P440_IRACC], 0>,
                                 InstrStage<4, [P440_LWARX_Hold], 0>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<1, [P440_AGEN]>,
                                 InstrStage<1, [P440_CRD]>,
                                 InstrStage<1, [P440_LWB]>],
                                [4, 1, 1],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_LdStSync,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_LRACC]>,
                                 InstrStage<3, [P440_AGEN], 1>,
                                 InstrStage<2, [P440_CRD],  1>,
                                 InstrStage<1, [P440_LWB]>]>,
  InstrItinData<IIC_SprISYNC,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_FRACC], 0>,
                                 InstrStage<1, [P440_LRACC], 0>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_FEXE1], 0>,
                                 InstrStage<1, [P440_AGEN],  0>,
                                 InstrStage<1, [P440_JEXE1], 0>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_FEXE2], 0>,
                                 InstrStage<1, [P440_CRD],   0>,
                                 InstrStage<1, [P440_JEXE2], 0>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<6, [P440_FEXE3], 0>,
                                 InstrStage<6, [P440_LWB],   0>,
                                 InstrStage<6, [P440_JWB],   0>,
                                 InstrStage<6, [P440_IWB]>]>,
  InstrItinData<IIC_SprMFSR,    [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [2, 0],
                                [P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_SprMTMSR,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [2, 0],
                                [P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_SprMTSR,    [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<3, [P440_IWB]>],
                                [5, 0],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_SprTLBSYNC, [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>]>,
  InstrItinData<IIC_SprMFCR,    [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [4, 0],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_SprMFMSR,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [3, 0],
                                [P440_GPR_Bypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_SprMFSPR,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<3, [P440_IWB]>],
                                [6, 0],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_SprMFTB,    [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<3, [P440_IWB]>],
                                [6, 0],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_SprMTSPR,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<3, [P440_IWB]>],
                                [6, 0],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_SprMTSRIN,  [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<3, [P440_IWB]>],
                                [6, 0],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_SprRFI,     [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [4, 0],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_SprSC,      [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_IRACC]>,
                                 InstrStage<1, [P440_IEXE1]>,
                                 InstrStage<1, [P440_IEXE2]>,
                                 InstrStage<1, [P440_IWB]>],
                                [4, 0],
                                [NoBypass, P440_GPR_Bypass]>,
  InstrItinData<IIC_FPGeneral,  [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_FRACC]>,
                                 InstrStage<1, [P440_FEXE1]>,
                                 InstrStage<1, [P440_FEXE2]>,
                                 InstrStage<1, [P440_FEXE3]>,
                                 InstrStage<1, [P440_FEXE4]>,
                                 InstrStage<1, [P440_FEXE5]>,
                                 InstrStage<1, [P440_FEXE6]>,
                                 InstrStage<1, [P440_FWB]>],
                                [6, 0, 0],
                                [P440_FPR_Bypass,
                                 P440_FPR_Bypass, P440_FPR_Bypass]>,
  InstrItinData<IIC_FPAddSub,   [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_FRACC]>,
                                 InstrStage<1, [P440_FEXE1]>,
                                 InstrStage<1, [P440_FEXE2]>,
                                 InstrStage<1, [P440_FEXE3]>,
                                 InstrStage<1, [P440_FEXE4]>,
                                 InstrStage<1, [P440_FEXE5]>,
                                 InstrStage<1, [P440_FEXE6]>,
                                 InstrStage<1, [P440_FWB]>],
                                [6, 0, 0],
                                [P440_FPR_Bypass,
                                 P440_FPR_Bypass, P440_FPR_Bypass]>,
  InstrItinData<IIC_FPCompare,  [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_FRACC]>,
                                 InstrStage<1, [P440_FEXE1]>,
                                 InstrStage<1, [P440_FEXE2]>,
                                 InstrStage<1, [P440_FEXE3]>,
                                 InstrStage<1, [P440_FEXE4]>,
                                 InstrStage<1, [P440_FEXE5]>,
                                 InstrStage<1, [P440_FEXE6]>,
                                 InstrStage<1, [P440_FWB]>],
                                [6, 0, 0],
                                [P440_FPR_Bypass, P440_FPR_Bypass,
                                 P440_FPR_Bypass]>,
  InstrItinData<IIC_FPDivD,     [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_FRACC]>,
                                 InstrStage<1, [P440_FEXE1]>,
                                 InstrStage<1, [P440_FEXE2]>,
                                 InstrStage<1, [P440_FEXE3]>,
                                 InstrStage<1, [P440_FEXE4]>,
                                 InstrStage<1, [P440_FEXE5]>,
                                 InstrStage<1, [P440_FEXE6]>,
                                 InstrStage<25, [P440_FWB]>],
                                [31, 0, 0],
                                [NoBypass, P440_FPR_Bypass, P440_FPR_Bypass]>,
  InstrItinData<IIC_FPDivS,     [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_FRACC]>,
                                 InstrStage<1, [P440_FEXE1]>,
                                 InstrStage<1, [P440_FEXE2]>,
                                 InstrStage<1, [P440_FEXE3]>,
                                 InstrStage<1, [P440_FEXE4]>,
                                 InstrStage<1, [P440_FEXE5]>,
                                 InstrStage<1, [P440_FEXE6]>,
                                 InstrStage<13, [P440_FWB]>],
                                [19, 0, 0],
                                [NoBypass, P440_FPR_Bypass, P440_FPR_Bypass]>,
  InstrItinData<IIC_FPFused,    [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_FRACC]>,
                                 InstrStage<1, [P440_FEXE1]>,
                                 InstrStage<1, [P440_FEXE2]>,
                                 InstrStage<1, [P440_FEXE3]>,
                                 InstrStage<1, [P440_FEXE4]>,
                                 InstrStage<1, [P440_FEXE5]>,
                                 InstrStage<1, [P440_FEXE6]>,
                                 InstrStage<1, [P440_FWB]>],
                                [6, 0, 0, 0],
                                [P440_FPR_Bypass,
                                 P440_FPR_Bypass, P440_FPR_Bypass,
                                 P440_FPR_Bypass]>,
  InstrItinData<IIC_FPRes,      [InstrStage<1, [P440_DISS1, P440_DISS2]>,
                                 InstrStage<1, [P440_FRACC]>,
                                 InstrStage<1, [P440_FEXE1]>,
                                 InstrStage<1, [P440_FEXE2]>,
                                 InstrStage<1, [P440_FEXE3]>,
                                 InstrStage<1, [P440_FEXE4]>,
                                 InstrStage<1, [P440_FEXE5]>,
                                 InstrStage<1, [P440_FEXE6]>,
                                 InstrStage<1, [P440_FWB]>],
                                [6, 0],
                                [P440_FPR_Bypass, P440_FPR_Bypass]>
]>;

// ===---------------------------------------------------------------------===//
// PPC440 machine model for scheduling and other instruction cost heuristics.

def PPC440Model : SchedMachineModel {
  let IssueWidth = 2;  // 2 instructions are dispatched per cycle.
  let LoadLatency = 5; // Optimistic load latency assuming bypass.
                       // This is overriden by OperandCycles if the
                       // Itineraries are queried instead.

  let CompleteModel = 0;

  let Itineraries = PPC440Itineraries;
}