[PATCH] D159183: [LoongArch] Support llvm.is.fpclass for f32 and f64

Lu Weining via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 30 02:58:18 PDT 2023


SixWeining created this revision.
SixWeining added reviewers: xen0n, xry111, arsenm, wangleiat.
Herald added a subscriber: hiraditya.
Herald added a project: All.
SixWeining requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

The result encoding (least significant 10-bits) of `fclass.[sd]` [1]
exactly matches the second argument definition of llvm intrinsic
`llvm.is.fpclass`. So we can simply select:

is_fpclass (fj, mask)
->
sltu (r0, and (movfr2gr.[sd] (fclass.[sd] fj), mask))

[1]: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#_fclass_sd


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159183

Files:
  llvm/lib/Target/LoongArch/LoongArchFloat32InstrInfo.td
  llvm/lib/Target/LoongArch/LoongArchFloat64InstrInfo.td
  llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
  llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
  llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
  llvm/test/CodeGen/LoongArch/is_fpclass_f32.ll
  llvm/test/CodeGen/LoongArch/is_fpclass_f64.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159183.554649.patch
Type: text/x-patch
Size: 75533 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230830/1210435a/attachment.bin>


More information about the llvm-commits mailing list