[all-commits] [llvm/llvm-project] c01285: [TableGen][X86] Add Size field to X86MemOperand class

Amir Ayupov via All-commits all-commits at lists.llvm.org
Sun Jun 19 11:47:10 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c0128549b00f8dbe3ed1b5519e9b89f1370ae5e8
      https://github.com/llvm/llvm-project/commit/c0128549b00f8dbe3ed1b5519e9b89f1370ae5e8
  Author: Amir Ayupov <aaupov at fb.com>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  Changed paths:
    M llvm/lib/Target/X86/X86InstrInfo.td
    M llvm/utils/TableGen/InstrInfoEmitter.cpp
    M llvm/utils/TableGen/X86RecognizableInstr.cpp

  Log Message:
  -----------
  [TableGen][X86] Add Size field to X86MemOperand class

Set Size appropriately in operand definitions and query it for dumping memory
operand size table `getMemOperandSize` (follow-up use D126116) and
`X86Disassembler::getMemOperandSize`.

Excerpt from a produced `getMemOperandSize` table for X86:

```
static int getMemOperandSize(int OpType) {
  switch (OpType) {
  default: return 0;
  case OpTypes::i8mem:
  case OpTypes::i8mem_NOREX:
    return 8;

  case OpTypes::f16mem:
  case OpTypes::i16mem:
    return 16;

  case OpTypes::f32mem:
  case OpTypes::i32mem:
    return 32;
...
```

Reviewed By: skan, pengfei

Differential Revision: https://reviews.llvm.org/D127787




More information about the All-commits mailing list