PPCMacroFusion.def 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //=== ---- PPCMacroFusion.def - PowerPC MacroFuson Candidates -v-*- C++ -*-===//
  2. //
  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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file contains descriptions of the macro-fusion pair for PowerPC.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. // NOTE: NO INCLUDE GUARD DESIRED!
  13. #ifndef FUSION_FEATURE
  14. // Each FUSION_FEATURE is assigned with one TYPE, and can be enabled/disabled
  15. // by HAS_FEATURE. The instructions pair is fusable only when the opcode
  16. // of the first instruction is in OPSET1, and the second instruction opcode is
  17. // in OPSET2. And if DEP_OP_IDX >=0, we will check the result of first OP is
  18. // the operand of the second op with DEP_OP_IDX as its operand index. We assume
  19. // that the result of the first op is its operand zero.
  20. #define FUSION_FEATURE(TYPE, HAS_FEATURE, DEP_OP_IDX, OPSET1, OPSET2)
  21. #endif
  22. #ifndef FUSION_OP_SET
  23. #define FUSION_OP_SET(...) __VA_ARGS__
  24. #endif
  25. // Power8 User Manual Section 10.1.12, Instruction Fusion
  26. // {addi} followed by one of these {lxvd2x, lxvw4x, lxvdsx, lvebx, lvehx,
  27. // lvewx, lvx, lxsdx}
  28. FUSION_FEATURE(AddiLoad, hasAddiLoadFusion, 2, \
  29. FUSION_OP_SET(ADDI, ADDI8, ADDItocL), \
  30. FUSION_OP_SET(LXVD2X, LXVW4X, LXVDSX, LVEBX, LVEHX, LVEWX, \
  31. LVX, LXSDX))
  32. // {addis) followed by one of these {ld, lbz, lhz, lwz}
  33. FUSION_FEATURE(AddisLoad, hasAddisLoadFusion, 2, \
  34. FUSION_OP_SET(ADDIS, ADDIS8, ADDIStocHA8), \
  35. FUSION_OP_SET(LD, LBZ, LBZ8, LHZ, LHZ8, LWZ, LWZ8))
  36. #undef FUSION_FEATURE
  37. #undef FUSION_OP_SET