[Clang][LoongArch] Add inline asm support for constraints k/m/ZB/ZC
authorWeining Lu <luweining@loongson.cn>
Thu, 29 Sep 2022 06:47:24 +0000 (14:47 +0800)
committerWeining Lu <luweining@loongson.cn>
Thu, 29 Sep 2022 07:02:08 +0000 (15:02 +0800)
commitb7baddc7557e5c35a0f6a604a134d849265a99d4
tree15b1eda18d34264670e31a8c01c08be920ae2257
parent346de23ec9db3d144647d0c587cf82eacd21382d
[Clang][LoongArch] Add inline asm support for constraints k/m/ZB/ZC

k: A memory operand whose address is formed by a base register and
(optionally scaled) index register.

m: A memory operand whose address is formed by a base register and
offset that is suitable for use in instructions with the same
addressing mode as st.w and ld.w.

ZB: An address that is held in a general-purpose register. The offset
is zero.

ZC: A memory operand whose address is formed by a base register and
offset that is suitable for use in instructions with the same
addressing mode as ll.w and sc.w.

Differential Revision: https://reviews.llvm.org/D134638
14 files changed:
clang/lib/Basic/Targets/LoongArch.cpp
clang/lib/Basic/Targets/LoongArch.h
clang/test/CodeGen/LoongArch/inline-asm-constraints.c
llvm/include/llvm/IR/InlineAsm.h
llvm/lib/Target/LoongArch/LoongArchAsmPrinter.cpp
llvm/lib/Target/LoongArch/LoongArchAsmPrinter.h
llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.cpp
llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.h
llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
llvm/lib/Target/LoongArch/LoongArchISelLowering.h
llvm/test/CodeGen/LoongArch/inline-asm-constraint-ZB.ll [new file with mode: 0644]
llvm/test/CodeGen/LoongArch/inline-asm-constraint-ZC.ll [new file with mode: 0644]
llvm/test/CodeGen/LoongArch/inline-asm-constraint-k.ll [new file with mode: 0644]
llvm/test/CodeGen/LoongArch/inline-asm-constraint-m.ll [new file with mode: 0644]