[all-commits] [llvm/llvm-project] 135a92: [Clang][LoongArch] Handle -march/-m{single, double, ...

Gong LingQin via All-commits all-commits at lists.llvm.org
Thu Nov 10 01:31:03 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 135a9272a4c99b7f960086d0bf9d7e7da4c0396d
      https://github.com/llvm/llvm-project/commit/135a9272a4c99b7f960086d0bf9d7e7da4c0396d
  Author: Weining Lu <luweining at loongson.cn>
  Date:   2022-11-10 (Thu, 10 Nov 2022)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticDriverKinds.td
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/ToolChains/Arch/LoongArch.cpp
    M clang/lib/Driver/ToolChains/Arch/LoongArch.h
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Driver/ToolChains/Linux.cpp
    M clang/test/Driver/loongarch-default-features.c
    A clang/test/Driver/loongarch-march-error.c
    A clang/test/Driver/loongarch-march.c
    A clang/test/Driver/loongarch-mdouble-float.c
    A clang/test/Driver/loongarch-mfpu-error.c
    A clang/test/Driver/loongarch-mfpu.c
    A clang/test/Driver/loongarch-msingle-float.c
    A clang/test/Driver/loongarch-msoft-float.c
    A llvm/include/llvm/Support/LoongArchTargetParser.def
    A llvm/include/llvm/Support/LoongArchTargetParser.h
    M llvm/lib/Support/CMakeLists.txt
    A llvm/lib/Support/LoongArchTargetParser.cpp

  Log Message:
  -----------
  [Clang][LoongArch] Handle -march/-m{single,double,soft}-float/-mfpu options

This patch adds options -march, -msingle-float, -mdouble-float,
-msoft-float and -mfpu for LoongArch.

Clang options `msingle_float` and `mdouble_float` are moved from
`m_mips_Features_Group` to `m_Group` because now more than targets use
them.

Reference:
https://github.com/loongson/LoongArch-Documentation/blob/main/docs/LoongArch-toolchain-conventions-EN.adoc

TODO: add -mtune.

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


  Commit: 60e5cfe2a4eba3bf0a642aeeb53a3f37dfed5fdb
      https://github.com/llvm/llvm-project/commit/60e5cfe2a4eba3bf0a642aeeb53a3f37dfed5fdb
  Author: Weining Lu <luweining at loongson.cn>
  Date:   2022-11-10 (Thu, 10 Nov 2022)

  Changed paths:
    M clang/lib/Basic/Targets/LoongArch.cpp
    M clang/lib/Basic/Targets/LoongArch.h
    M clang/test/Preprocessor/init-loongarch.c

  Log Message:
  -----------
  [Clang][LoongArch] Define more LoongArch specific built-in macros

Define below macros according to LoongArch toolchain conventions [1].

* `__loongarch_grlen`
* `__loongarch_frlen`
* `__loongarch_lp64`
* `__loongarch_hard_float`
* `__loongarch_soft_float`
* `__loongarch_single_float`
* `__loongarch_double_float`

Note:
1. `__loongarch__` has been defined in earlier patch.
2. `__loongarch_arch` is not defined because I don't know how `TargetInfo` can get the arch name specified by `-march`.
3. `__loongarch_tune` will be defined in future.

[1]: https://loongson.github.io/LoongArch-Documentation/LoongArch-toolchain-conventions-EN.html

Depends on D136146

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


  Commit: 85f08c4197aea68b2444e6874524b5f8b4067cfd
      https://github.com/llvm/llvm-project/commit/85f08c4197aea68b2444e6874524b5f8b4067cfd
  Author: gonglingqin <gonglingqin at loongson.cn>
  Date:   2022-11-10 (Thu, 10 Nov 2022)

  Changed paths:
    A clang/include/clang/Basic/BuiltinsLoongArch.def
    M clang/include/clang/Basic/TargetBuiltins.h
    M clang/include/clang/module.modulemap
    M clang/lib/Basic/Targets/LoongArch.cpp
    M clang/lib/Basic/Targets/LoongArch.h
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/CodeGen/CodeGenFunction.h
    M clang/lib/Headers/CMakeLists.txt
    A clang/lib/Headers/larchintrin.h
    A clang/test/CodeGen/LoongArch/intrinsic.c
    M llvm/include/llvm/IR/IntrinsicsLoongArch.td
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.h
    M llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
    A llvm/test/CodeGen/LoongArch/intrinsic-error.ll
    A llvm/test/CodeGen/LoongArch/intrinsic.ll

  Log Message:
  -----------
  [Clang][LoongArch] Implement __builtin_loongarch_dbar builtin

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


Compare: https://github.com/llvm/llvm-project/compare/098e20134af5...85f08c4197ae


More information about the All-commits mailing list