[all-commits] [llvm/llvm-project] 416474: [PowerPC] Fix an LowerADDSUBO_CARRY error when con...
zhijian lin via All-commits
all-commits at lists.llvm.org
Wed Apr 30 07:39:30 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 41647412c6a4091080fd47b0f554adc5c54b4b54
https://github.com/llvm/llvm-project/commit/41647412c6a4091080fd47b0f554adc5c54b4b54
Author: zhijian lin <zhijian at ca.ibm.com>
Date: 2025-04-30 (Wed, 30 Apr 2025)
Changed paths:
M llvm/lib/Target/PowerPC/PPCISelLowering.cpp
A llvm/test/CodeGen/PowerPC/usubo_carry.ll
Log Message:
-----------
[PowerPC] Fix an LowerADDSUBO_CARRY error when converting carry bit for usubo_carry (#137809)
In PowerPC, if a borrow occurs during a subtraction, the carry bit is
zero (unset). The carry bit is set if no borrow occurs.
For ISD::USUBO_CARRY, the nodes produce two results: the normal result
of the addition or subtraction, and a boolean value that is 1 if and
only if there is an outgoing carry or borrow.
Therefore, we need to convert a 1 (which indicates a borrow in
ISD::USUBO_CARRY) to 0 to match PowerPC's definition of borrow.
Similarly, we need to convert a 0 (no borrow in ISD::USUBO_CARRY) to 1
for PowerPC.
To perform this conversion, we use XOR 1 instead of XOR
DAG.getAllOnesConstant(DL, CarryOp.getValueType()).
`
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