[all-commits] [llvm/llvm-project] 63d468: [LoongArch] Add intrinsics for MOVFCSR2GR and MOVG...

Xiaodong Liu via All-commits all-commits at lists.llvm.org
Tue Jan 3 22:12:47 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 63d46869ea5769693f7895be066f042929512e06
      https://github.com/llvm/llvm-project/commit/63d46869ea5769693f7895be066f042929512e06
  Author: Xiaodong Liu <liuxiaodong at loongson.cn>
  Date:   2023-01-04 (Wed, 04 Jan 2023)

  Changed paths:
    M clang/include/clang/Basic/BuiltinsLoongArch.def
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/Headers/larchintrin.h
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/CodeGen/LoongArch/intrinsic-la32-error.c
    M clang/test/CodeGen/LoongArch/intrinsic-la32.c
    M clang/test/CodeGen/LoongArch/intrinsic-la64-error.c
    M clang/test/CodeGen/LoongArch/intrinsic-la64.c
    M llvm/include/llvm/IR/IntrinsicsLoongArch.td
    M llvm/lib/Target/LoongArch/LoongArchFloat32InstrInfo.td
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.h
    M llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
    M llvm/test/CodeGen/LoongArch/intrinsic-error.ll
    M llvm/test/CodeGen/LoongArch/intrinsic-not-constant-error.ll
    M llvm/test/CodeGen/LoongArch/intrinsic.ll

  Log Message:
  -----------
  [LoongArch] Add intrinsics for MOVFCSR2GR and MOVGR2FCSR instructions

Instruction formats:
`movgr2fcsr fcsr, rj`
`movfcsr2gr rd, fcsr`
MOVGR2FCSR modifies the value of the software writable field
corresponding to the FCSR (floating-point control and status
register) `fcsr` according to the value of the lower 32 bits of
the GR (general purpose register) `rj`.
MOVFCSR2GR sign extends the 32-bit value of the FCSR `fcsr`
and writes it into the GR `rd`.

Add "i32 @llvm.loongarch.movfcsr2gr(i32)" intrinsic for MOVFCSR2GR
instruction. The argument is FCSR register number. The return value
is the value in the FCSR.
Add "void @llvm.loongarch.movgr2fcsr(i32, i32)" intrinsic for MOVGR2FCSR
instruction. The first argument is the FCSR number, the second argument
is the value in GR.

Reviewed By: SixWeining, xen0n

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




More information about the All-commits mailing list