[all-commits] [llvm/llvm-project] a7ec7f: [LoongArch] Support parsing la* pseudo instructions

wanglei via All-commits all-commits at lists.llvm.org
Sun Nov 20 23:34:38 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a7ec7f6d773218f2fef81130f1acc700dcdb3966
      https://github.com/llvm/llvm-project/commit/a7ec7f6d773218f2fef81130f1acc700dcdb3966
  Author: wanglei <wanglei at loongson.cn>
  Date:   2022-11-21 (Mon, 21 Nov 2022)

  Changed paths:
    M llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp
    M llvm/lib/Target/LoongArch/LoongArch.td
    M llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
    M llvm/lib/Target/LoongArch/LoongArchSubtarget.h
    A llvm/test/MC/LoongArch/Macros/aliases-la-bad.s
    A llvm/test/MC/LoongArch/Macros/aliases-la.s
    A llvm/test/MC/LoongArch/Macros/macros-la-bad.s
    A llvm/test/MC/LoongArch/Macros/macros-la.s

  Log Message:
  -----------
  [LoongArch] Support parsing la* pseudo instructions

This patch makes `IAS` compatible with `GAS`. It accepts `la*` pseudo
instructions, and expands `la{,.local,.global}` into different
instructions according to different features.

```
 Default:
     la = la.global = la.got
     la.local = la.pcrel
 With feature "+la-global-with-pcrel":
     la = la.global = la.pcrel
 With feature "+la-global-with-abs":
     la = la.global = la.abs
 With feature "+la-local-with-abs":
     la.local = la.abs
 With features "+la-global-with-pcrel,+la-global-with-abs"(disorder):
     la = la.global = la.pcrel
```
Note: To keep consistent with `GAS` behavior, the "la" can only have
      one register operand.

Reviewed By: SixWeining

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




More information about the All-commits mailing list