[all-commits] [llvm/llvm-project] 17ff25: [X86][NFC] Not infer OpSize from Xi8|16|32|64

Shengchen Kan via All-commits all-commits at lists.llvm.org
Sat Dec 23 20:01:36 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 17ff25a58ee4f29816d932fdb75f0d305718069f
      https://github.com/llvm/llvm-project/commit/17ff25a58ee4f29816d932fdb75f0d305718069f
  Author: Shengchen Kan <shengchen.kan at intel.com>
  Date:   2023-12-24 (Sun, 24 Dec 2023)

  Changed paths:
    M llvm/lib/Target/X86/X86InstrArithmetic.td
    M llvm/lib/Target/X86/X86InstrFormats.td
    M llvm/lib/Target/X86/X86InstrUtils.td

  Log Message:
  -----------
  [X86][NFC] Not infer OpSize from Xi8|16|32|64

For legacy (arithmetic) instructions, the operand size override prefix (0x66)
is used to switch the operand data size from 32b to 16b (in 32/64-bit mode),
16b to 32b (in 16-bit mode). That's why we set OpSize16 for 16-bit instructions
and set OpSize32 for 32-bit instructions.

But it's not a generic rule any more after APX. APX adds 4 variants for
arithmetic instructions: promoted EVEX, NDD (new data destination), NF (no flag),
NF_NDD. All the 4 variants are in EVEX space and only legal in 64-bit
mode. EVEX.pp is set to 01 for the 16-bit instructions to encode 0x66.
For APX, we should set OpSizeFixed for 8/16/32/64-bit variants and set PD for
the 16-bit variants.

Hence, to reuse the classes ITy and its subclasses BinOp* for APX instructions,
we extract the OpSize setting from the class ITy.




More information about the All-commits mailing list