X86InstrTSX.td 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //===-- X86InstrVMX.td - TSX Instruction Set Extension -----*- tablegen -*-===//
  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 describes the instructions that make up the Intel TSX instruction
  10. // set.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //===----------------------------------------------------------------------===//
  14. // TSX instructions
  15. def X86xtest: SDNode<"X86ISD::XTEST", SDTypeProfile<1, 0, [SDTCisVT<0, i32>]>,
  16. [SDNPHasChain, SDNPSideEffect]>;
  17. let SchedRW = [WriteSystem] in {
  18. let usesCustomInserter = 1 in
  19. def XBEGIN : I<0, Pseudo, (outs GR32:$dst), (ins),
  20. "# XBEGIN", [(set GR32:$dst, (int_x86_xbegin))]>,
  21. Requires<[HasRTM]>;
  22. let isBranch = 1, isTerminator = 1, Defs = [EAX] in {
  23. def XBEGIN_2 : Ii16PCRel<0xc7, MRM_F8, (outs), (ins brtarget16:$dst),
  24. "xbegin\t$dst", []>, OpSize16;
  25. def XBEGIN_4 : Ii32PCRel<0xc7, MRM_F8, (outs), (ins brtarget32:$dst),
  26. "xbegin\t$dst", []>, OpSize32;
  27. }
  28. // Pseudo instruction to fake the definition of EAX on the fallback code path.
  29. let isPseudo = 1, Defs = [EAX] in {
  30. def XABORT_DEF : I<0, Pseudo, (outs), (ins), "# XABORT DEF", []>;
  31. }
  32. def XEND : I<0x01, MRM_D5, (outs), (ins),
  33. "xend", [(int_x86_xend)]>, PS, Requires<[HasRTM]>;
  34. let Defs = [EFLAGS] in
  35. def XTEST : I<0x01, MRM_D6, (outs), (ins),
  36. "xtest", [(set EFLAGS, (X86xtest))]>, PS, Requires<[HasRTM]>;
  37. def XABORT : Ii8<0xc6, MRM_F8, (outs), (ins i8imm:$imm),
  38. "xabort\t$imm",
  39. [(int_x86_xabort timm:$imm)]>, Requires<[HasRTM]>;
  40. } // SchedRW
  41. // HLE prefixes
  42. let SchedRW = [WriteSystem] in {
  43. // XACQUIRE and XRELEASE reuse REPNE and REP respectively.
  44. // For now, just prefer the REP versions.
  45. let isAsmParserOnly = 1 in {
  46. def XACQUIRE_PREFIX : I<0xF2, PrefixByte, (outs), (ins), "xacquire", []>;
  47. def XRELEASE_PREFIX : I<0xF3, PrefixByte, (outs), (ins), "xrelease", []>;
  48. }
  49. } // SchedRW