[all-commits] [llvm/llvm-project] 48ac3d: [LoongArch] Add support for vector FP_ROUND from v...

Zhaoxin Yang via All-commits all-commits at lists.llvm.org
Tue Apr 14 02:10:27 PDT 2026


  Branch: refs/heads/users/ylzsx/opt-vector-fptrunc
  Home:   https://github.com/llvm/llvm-project
  Commit: 48ac3dc1e6f583f4afe477917470cb7c7a28993f
      https://github.com/llvm/llvm-project/commit/48ac3dc1e6f583f4afe477917470cb7c7a28993f
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2026-04-14 (Tue, 14 Apr 2026)

  Changed paths:
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.h
    M llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td
    M llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
    M llvm/test/CodeGen/LoongArch/lasx/ir-instruction/fptrunc.ll
    M llvm/test/CodeGen/LoongArch/lsx/ir-instruction/fptrunc.ll

  Log Message:
  -----------
  [LoongArch] Add support for vector FP_ROUND from vxf64 to vxf32

In LoongArch, [x]vfcvt.s.d intstructions require two vector registers
for v4f64->v4f32, v8f64->v8f32 conversions.

This patch handles these cases:
- For FP_ROUND v2f64->v2f32(illegal), add a customized v2f32 widening
  to convert it into a target-specific LoongArchISD::VFCVT.
- For FP_ROUND v4f64->v4f32, on LSX platforms, v4f64 is illegal and will
  be split into two v2f64->v2f32, resulting in two LoongArchISD::VFCVT.
  Finally, they are combined into a single node during combining
  LoongArchISD::VPACKEV. On LASX platforms, v4f64->v4f32 can directly
  lower to vfcvt.s.d in lowerFP_ROUND.
- For FP_ROUND v8f64->v8f32, on LASX platforms, v8f64 is illegal and
  will be split into two v4f64->v4f32 and then combine using
  ISD::CONCAT_VECTORS, so xvfcvt.s.d is generated during its
  combination.


  Commit: 763ad5353141cff5fa29206a34aa8e631a54fcc8
      https://github.com/llvm/llvm-project/commit/763ad5353141cff5fa29206a34aa8e631a54fcc8
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2026-04-14 (Tue, 14 Apr 2026)

  Changed paths:
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
    M llvm/test/CodeGen/LoongArch/lasx/ir-instruction/fptrunc.ll
    M llvm/test/CodeGen/LoongArch/lsx/ir-instruction/fptrunc.ll

  Log Message:
  -----------
  fixes according reviews


  Commit: efaff2aa9eea08cf8dd119e6cc7b17f7e8cd0ec1
      https://github.com/llvm/llvm-project/commit/efaff2aa9eea08cf8dd119e6cc7b17f7e8cd0ec1
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2026-04-14 (Tue, 14 Apr 2026)

  Changed paths:
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp

  Log Message:
  -----------
  stricter restrictions on original types


Compare: https://github.com/llvm/llvm-project/compare/1c3a017fb5d4...efaff2aa9eea

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list