X86InstrVMX.td 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //===-- X86InstrVMX.td - VMX 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 VMX instruction
  10. // set.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //===----------------------------------------------------------------------===//
  14. // VMX instructions
  15. let SchedRW = [WriteSystem] in {
  16. // 66 0F 38 80
  17. def INVEPT32 : I<0x80, MRMSrcMem, (outs), (ins GR32:$src1, i128mem:$src2),
  18. "invept\t{$src2, $src1|$src1, $src2}", []>, T8PD,
  19. Requires<[Not64BitMode]>;
  20. def INVEPT64 : I<0x80, MRMSrcMem, (outs), (ins GR64:$src1, i128mem:$src2),
  21. "invept\t{$src2, $src1|$src1, $src2}", []>, T8PD,
  22. Requires<[In64BitMode]>;
  23. // 66 0F 38 81
  24. def INVVPID32 : I<0x81, MRMSrcMem, (outs), (ins GR32:$src1, i128mem:$src2),
  25. "invvpid\t{$src2, $src1|$src1, $src2}", []>, T8PD,
  26. Requires<[Not64BitMode]>;
  27. def INVVPID64 : I<0x81, MRMSrcMem, (outs), (ins GR64:$src1, i128mem:$src2),
  28. "invvpid\t{$src2, $src1|$src1, $src2}", []>, T8PD,
  29. Requires<[In64BitMode]>;
  30. // 0F 01 C1
  31. def VMCALL : I<0x01, MRM_C1, (outs), (ins), "vmcall", []>, TB;
  32. def VMCLEARm : I<0xC7, MRM6m, (outs), (ins i64mem:$vmcs),
  33. "vmclear\t$vmcs", []>, PD;
  34. // OF 01 D4
  35. def VMFUNC : I<0x01, MRM_D4, (outs), (ins), "vmfunc", []>, PS;
  36. // 0F 01 C2
  37. def VMLAUNCH : I<0x01, MRM_C2, (outs), (ins), "vmlaunch", []>, TB;
  38. // 0F 01 C3
  39. def VMRESUME : I<0x01, MRM_C3, (outs), (ins), "vmresume", []>, TB;
  40. def VMPTRLDm : I<0xC7, MRM6m, (outs), (ins i64mem:$vmcs),
  41. "vmptrld\t$vmcs", []>, PS;
  42. def VMPTRSTm : I<0xC7, MRM7m, (outs), (ins i64mem:$vmcs),
  43. "vmptrst\t$vmcs", []>, PS;
  44. def VMREAD64rr : I<0x78, MRMDestReg, (outs GR64:$dst), (ins GR64:$src),
  45. "vmread{q}\t{$src, $dst|$dst, $src}", []>, PS, Requires<[In64BitMode]>,
  46. NotMemoryFoldable;
  47. def VMREAD32rr : I<0x78, MRMDestReg, (outs GR32:$dst), (ins GR32:$src),
  48. "vmread{l}\t{$src, $dst|$dst, $src}", []>, PS, Requires<[Not64BitMode]>,
  49. NotMemoryFoldable;
  50. let mayStore = 1 in {
  51. def VMREAD64mr : I<0x78, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src),
  52. "vmread{q}\t{$src, $dst|$dst, $src}", []>, PS, Requires<[In64BitMode]>,
  53. NotMemoryFoldable;
  54. def VMREAD32mr : I<0x78, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src),
  55. "vmread{l}\t{$src, $dst|$dst, $src}", []>, PS, Requires<[Not64BitMode]>,
  56. NotMemoryFoldable;
  57. } // mayStore
  58. def VMWRITE64rr : I<0x79, MRMSrcReg, (outs GR64:$dst), (ins GR64:$src),
  59. "vmwrite{q}\t{$src, $dst|$dst, $src}", []>, PS, Requires<[In64BitMode]>,
  60. NotMemoryFoldable;
  61. def VMWRITE32rr : I<0x79, MRMSrcReg, (outs GR32:$dst), (ins GR32:$src),
  62. "vmwrite{l}\t{$src, $dst|$dst, $src}", []>, PS, Requires<[Not64BitMode]>,
  63. NotMemoryFoldable;
  64. let mayLoad = 1 in {
  65. def VMWRITE64rm : I<0x79, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$src),
  66. "vmwrite{q}\t{$src, $dst|$dst, $src}", []>, PS, Requires<[In64BitMode]>,
  67. NotMemoryFoldable;
  68. def VMWRITE32rm : I<0x79, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$src),
  69. "vmwrite{l}\t{$src, $dst|$dst, $src}", []>, PS, Requires<[Not64BitMode]>,
  70. NotMemoryFoldable;
  71. } // mayLoad
  72. // 0F 01 C4
  73. def VMXOFF : I<0x01, MRM_C4, (outs), (ins), "vmxoff", []>, TB;
  74. def VMXON : I<0xC7, MRM6m, (outs), (ins i64mem:$vmxon),
  75. "vmxon\t$vmxon", []>, XS;
  76. } // SchedRW