[all-commits] [llvm/llvm-project] eb48e1: [ARM] Fix undefined behaviour in bf16->float conve...

Oliver Stannard via All-commits all-commits at lists.llvm.org
Thu Nov 21 02:15:55 PST 2024


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

  Changed paths:
    M clang/include/clang/Basic/arm_neon.td
    M clang/test/CodeGen/arm-bf16-convert-intrinsics.c

  Log Message:
  -----------
  [ARM] Fix undefined behaviour in bf16->float conversion (#116985)

This was implementing the bf16->float conversion function using a
left-shift of a signed integer, so for negative floating-point values a
1 was being shifted into the sign bit of the signed integer intermediate
value. This is undefined behaviour, and was caught by UBSan.

The vector versions are code-generated via Neon builtin functions, so
probably don't have the same UB problem, but I've updated them anyway to
be consistent.

Fixes #61983.



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