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

Zhaoxin Yang via All-commits all-commits at lists.llvm.org
Fri Apr 17 02:43:07 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 935413c3cb8eabf3e69181c986c8899affa13d7a
      https://github.com/llvm/llvm-project/commit/935413c3cb8eabf3e69181c986c8899affa13d7a
  Author: Zhaoxin Yang <yangzhaoxin at loongson.cn>
  Date:   2026-04-17 (Fri, 17 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 (#164059)

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 we combine two ISD::FP_ROUND to
LoongArchISD::VFCVT in this phase.



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