[all-commits] [llvm/llvm-project] 43c7dc: [X86] .code16: temporarily set Mode32Bit when matc...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Oct 6 08:32:24 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 43c7dc52f12973b306910a161bcf150d70d33504
      https://github.com/llvm/llvm-project/commit/43c7dc52f12973b306910a161bcf150d70d33504
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-10-06 (Tue, 06 Oct 2020)

  Changed paths:
    M llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
    M llvm/test/MC/X86/data-prefix-fail.s
    M llvm/test/MC/X86/x86-16.s

  Log Message:
  -----------
  [X86] .code16: temporarily set Mode32Bit when matching an instruction with the data32 prefix

PR47632

This allows MC to match `data32 ...` as one instruction instead of two (data32 without insn + insn).

The compatibility with GNU as improves: `data32 ljmp` will be matched as ljmpl.
`data32 lgdt 4(%eax)` will be matched as `lgdtl` (prefixes: 0x67 0x66, instead
of 0x66 0x67).

GNU as supports many other `data32 *w` as `*l`. We currently just hard code
`data32 callw` and `data32 ljmpw`.  Generalizing the suffix replacement is
tricky and requires a think about the "bwlq" appending suffix rules in MatchAndEmitATTInstruction.

Reviewed By: craig.topper

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




More information about the All-commits mailing list