[all-commits] [llvm/llvm-project] b2ec41: [ARM] Fix NaN behaviour for MVE compare intrinsics...

Oliver Stannard via All-commits all-commits at lists.llvm.org
Tue Nov 19 02:23:35 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b2ec416aa5bcd89c4bc295163d60e5a2ecb99212
      https://github.com/llvm/llvm-project/commit/b2ec416aa5bcd89c4bc295163d60e5a2ecb99212
  Author: Oliver Stannard <oliver.stannard at arm.com>
  Date:   2024-11-19 (Tue, 19 Nov 2024)

  Changed paths:
    M clang/include/clang/Basic/arm_mve.td
    M clang/include/clang/Basic/arm_mve_defs.td
    M clang/test/CodeGen/arm-mve-intrinsics/compare.c

  Log Message:
  -----------
  [ARM] Fix NaN behaviour for MVE compare intrinsics (#116371)

The MVE intrinsics are defined as having the same behaviour as the
instructions which they correspond to. In particular, the vcmpleq and
vcmpltq intrinsics correspond to the VCMP instruction with the LE or LT
condition. However, these instructions with these two conditions do not
match the normal IEEE754 behaviour for NaNs, they return true if either
operand is a NaN, instead of false. Therefore we need to generate `fcmp`
IR instructions with the `ule` and `ult` conditions, instead of `ole`
and `olt`.

This differs from AdvSIMD, where only instructions with the EQ, GE and
GT conditions are available, and the intrinsics for the others are
defined by swapping the condition and operand order, so the results
match the IEEE754 behaviour for NaNs.



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