X86InstrKL.td 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. //===---------------------------*-tablegen-*-------------------------------===//
  2. //===------------- X86InstrKL.td - KL Instruction Set Extension -----------===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // This file describes the instructions that make up the Intel key locker
  11. // instruction set.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. //===----------------------------------------------------------------------===//
  15. // Key Locker instructions
  16. let SchedRW = [WriteSystem], Predicates = [HasKL] in {
  17. let Uses = [XMM0, EAX], Defs = [EFLAGS] in {
  18. def LOADIWKEY : I<0xDC, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2),
  19. "loadiwkey\t{$src2, $src1|$src1, $src2}",
  20. [(int_x86_loadiwkey XMM0, VR128:$src1, VR128:$src2, EAX)]>, T8XS,
  21. NotMemoryFoldable;
  22. }
  23. let Uses = [XMM0], Defs = [XMM0, XMM1, XMM2, XMM4, XMM5, XMM6, EFLAGS] in {
  24. def ENCODEKEY128 : I<0xFA, MRMSrcReg, (outs GR32:$dst), (ins GR32:$src),
  25. "encodekey128\t{$src, $dst|$dst, $src}", []>, T8XS,
  26. NotMemoryFoldable;
  27. }
  28. let Uses = [XMM0, XMM1], Defs = [XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, EFLAGS] in {
  29. def ENCODEKEY256 : I<0xFB, MRMSrcReg, (outs GR32:$dst), (ins GR32:$src),
  30. "encodekey256\t{$src, $dst|$dst, $src}", []>, T8XS,
  31. NotMemoryFoldable;
  32. }
  33. let Constraints = "$src1 = $dst",
  34. Defs = [EFLAGS] in {
  35. def AESENC128KL : I<0xDC, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, opaquemem:$src2),
  36. "aesenc128kl\t{$src2, $src1|$src1, $src2}",
  37. [(set VR128:$dst, EFLAGS,
  38. (X86aesenc128kl VR128:$src1, addr:$src2))]>, T8XS,
  39. NotMemoryFoldable;
  40. def AESDEC128KL : I<0xDD, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, opaquemem:$src2),
  41. "aesdec128kl\t{$src2, $src1|$src1, $src2}",
  42. [(set VR128:$dst, EFLAGS,
  43. (X86aesdec128kl VR128:$src1, addr:$src2))]>, T8XS,
  44. NotMemoryFoldable;
  45. def AESENC256KL : I<0xDE, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, opaquemem:$src2),
  46. "aesenc256kl\t{$src2, $src1|$src1, $src2}",
  47. [(set VR128:$dst, EFLAGS,
  48. (X86aesenc256kl VR128:$src1, addr:$src2))]>, T8XS,
  49. NotMemoryFoldable;
  50. def AESDEC256KL : I<0xDF, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, opaquemem:$src2),
  51. "aesdec256kl\t{$src2, $src1|$src1, $src2}",
  52. [(set VR128:$dst, EFLAGS,
  53. (X86aesdec256kl VR128:$src1, addr:$src2))]>, T8XS,
  54. NotMemoryFoldable;
  55. }
  56. } // SchedRW, Predicates
  57. let SchedRW = [WriteSystem], Predicates = [HasWIDEKL] in {
  58. let Uses = [XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7],
  59. Defs = [EFLAGS, XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7],
  60. mayLoad = 1 in {
  61. def AESENCWIDE128KL : I<0xD8, MRM0m, (outs), (ins opaquemem:$src),
  62. "aesencwide128kl\t$src", []>, T8XS,
  63. NotMemoryFoldable;
  64. def AESDECWIDE128KL : I<0xD8, MRM1m, (outs), (ins opaquemem:$src),
  65. "aesdecwide128kl\t$src", []>, T8XS,
  66. NotMemoryFoldable;
  67. def AESENCWIDE256KL : I<0xD8, MRM2m, (outs), (ins opaquemem:$src),
  68. "aesencwide256kl\t$src", []>, T8XS,
  69. NotMemoryFoldable;
  70. def AESDECWIDE256KL : I<0xD8, MRM3m, (outs), (ins opaquemem:$src),
  71. "aesdecwide256kl\t$src", []>, T8XS,
  72. NotMemoryFoldable;
  73. }
  74. } // SchedRW, Predicates