[all-commits] [llvm/llvm-project] cfaeee: release/18.x: [SystemZ] Fix overflow flag for i12...

Ulrich Weigand via All-commits all-commits at lists.llvm.org
Wed Mar 27 16:23:00 PDT 2024


  Branch: refs/heads/release/18.x
  Home:   https://github.com/llvm/llvm-project
  Commit: cfaeee6a899485a578375f5c918a99a852ec759e
      https://github.com/llvm/llvm-project/commit/cfaeee6a899485a578375f5c918a99a852ec759e
  Author: Ulrich Weigand <ulrich.weigand at de.ibm.com>
  Date:   2024-03-27 (Wed, 27 Mar 2024)

  Changed paths:
    M llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
    M llvm/test/CodeGen/SystemZ/int-usub-12.ll
    M llvm/test/CodeGen/SystemZ/int-usub-13.ll

  Log Message:
  -----------
   release/18.x: [SystemZ] Fix overflow flag for i128 USUBO (#86491)

We use the VSCBIQ/VSBIQ/VSBCBIQ family of instructions to implement
USUBO/USUBO_CARRY for the i128 data type. However, these instructions
use an inverted sense of the borrow indication flag (a value of 1
indicates *no* borrow, while a value of 0 indicated borrow). This does
not match the semantics of the boolean "overflow" flag of the
USUBO/USUBO_CARRY ISD nodes.

Fix this by generating code to explicitly invert the flag. These cancel
out of the result of USUBO feeds into an USUBO_CARRY.

To avoid unnecessary zero-extend operations, also improve the DAGCombine
handling of ZERO_EXTEND to optimize (zext (xor (trunc))) sequences where
appropriate.

Fixes: https://github.com/llvm/llvm-project/issues/83268



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