.L21
ret
Tested on both RV32 and RV64 with no regressions.
2024-09-02 Jovan Vukic
gcc/ChangeLog:
PR target/113248
* config/riscv/riscv.md (*branch_shiftedarith_equals_shifted):
New pattern.
gcc/testsuite/ChangeLog:
PR target/113248
* gcc.target/riscv/branch
> It's worth noting there is a newer way which is usually slightly simpler
> than a match_operator. Specifically code iterators.
Thank you for the very detailed feedback. It is not a problem to add code
iterators. I would add iterators for "eq" and "ne" in riscv/iterators.md since
they don't cur
placed by the inverse
operation x > y (y < x), which requires replacing the following addi
instruction with an xori instruction as well, as proposed by the patch.
Tested on both RV32 and RV64 with no regressions.
2024-09-17 Jovan Vukic
PR target/108038
gcc/ChangeLog:
*
a5,a0,11
andia5,a5,1023
li a4,569
beq a5,a4,.L5
f6:
srlia5,a0,11
andia5,a5,1663
li a4,544
beq a5,a4,.L9
2024-10-09 Jovan Vukic
PR target/115921
gcc/ChangeLog:
* config/riscv/iterators.md
ersion.
Regardless, the necessary check has been added, so if a negative case
exists, an unrecognized instruction will not be created.
2024-09-30 Jovan Vukic
PR target/115921
gcc/ChangeLog:
* config/riscv/iterators.md (any_eq): New code iterator.
* config/riscv/riscv.h
enerated assembly for RISC-V is:
foo:
bgt a0, a2, .L4
bne a0, a1, .L4
ret
.L4:
mv a0, a1
ret
After the patch, the generated assembly becomes:
foo:
mv a0, a1
ret
2024-10-22 Jovan Vukic
gcc/ChangeLog:
* tree-ssa-
function after successfully
setting the value of *code within the rhs_is_fed_for_value_replacement
function to EQ_EXPR.
For BIT_IOR_EXPR, the same check is performed for A NE B, except now
*code remains NE_EXPR, and then value_replacement returns the second
operand (i.e.
On 11/02/24, Jeff Law wrote:
>This is well understood. The key in my mind is that for AND we always
>select the FALSE arm. For IOR we always select the TRUE arm.
Yes, I agree.
>> e = (code == NE_EXPR ? true_edge : false_edge);
>If I understand everything correctly your assertion is that w
The patch simplifies expressions (a - 1) & -a, (a - 1) | -a, and (a - 1) ^ -a
to the constants 0, -1, and -1, respectively.
Currently, GCC does not perform these simplifications.
Bootstrapped and tested on x86-linux-gnu with no regressions.
gcc/ChangeLog:
* match.pd: New pattern.
gcc/t
The patch makes the following simplifications:
((X - 1) & ~X) < 0 -> X == 0
((X - 1) & ~X) >= 0 -> X != 0
On x86, the number of instructions is reduced from 4 to 3,
but on platforms like RISC-V, it reduces to a single instruction.
Bootstrapped and tested on x86-linux-gnu with no regressions.
gcc
if 2 * (A & B) == 0.
In our case, we have A == X ^ C1, B == C2 and X is either 0 or 1.
2024-09-27 Jovan Vukic
PR target/108038
gcc/ChangeLog:
* simplify-rtx.cc (simplify_context::simplify_binary_operation_1): New
simplification.
gcc/testsuite/ChangeLog:
*
ny issues with
match.pd missing any simplifications, but if that happens, the code in
simplify-rtx.cc should help.
Bootstrapped and tested on x86-linux-gnu with no regressions.
2024-11-26 Jovan Vukic
gcc/ChangeLog:
* match.pd: New pattern.
* simplify-rtx.cc (simplif
patch.
2024-12-03 Jovan Vukic
gcc/ChangeLog:
* match.pd: New pattern.
* simplify-rtx.cc (match_plus_neg_pattern): New helper function.
(simplify_context::simplify_binary_operation_1): New
code to handle (a - 1) & -a, (a - 1) | -a and (a - 1) ^ -a.
gcc/tests
13 matches
Mail list logo