Commit 6e7088d
committed
i386: Fix up __builtin_ia32_b{extr{,i}_u{32,64},zhi_{s,d}i} folding [PR116287]
The GENERIC folding of these builtins have cases where it folds to a
constant regardless of the value of the first operand. If so, we need
to use omit_one_operand to avoid throwing away side-effects in the first
operand if any. The cases which verify the first argument is INTEGER_CST
don't need that, INTEGER_CST doesn't have side-effects.
2024-08-09 Jakub Jelinek <[email protected]>
PR target/116287
* config/i386/i386.cc (ix86_fold_builtin) <case IX86_BUILTIN_BEXTR32>:
When folding into zero without checking whether first argument is
constant, use omit_one_operand.
(ix86_fold_builtin) <case IX86_BUILTIN_BZHI32>: Likewise.
* gcc.target/i386/bmi-pr116287.c: New test.
* gcc.target/i386/bmi2-pr116287.c: New test.
* gcc.target/i386/tbm-pr116287.c: New test.1 parent b5a09a6 commit 6e7088d
File tree
4 files changed
+89
-4
lines changed- gcc
- config/i386
- testsuite/gcc.target/i386
4 files changed
+89
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18549 | 18549 | | |
18550 | 18550 | | |
18551 | 18551 | | |
| 18552 | + | |
18552 | 18553 | | |
18553 | 18554 | | |
18554 | | - | |
| 18555 | + | |
| 18556 | + | |
18555 | 18557 | | |
18556 | 18558 | | |
18557 | 18559 | | |
| |||
18560 | 18562 | | |
18561 | 18563 | | |
18562 | 18564 | | |
18563 | | - | |
| 18565 | + | |
18564 | 18566 | | |
18565 | 18567 | | |
18566 | 18568 | | |
| |||
18570 | 18572 | | |
18571 | 18573 | | |
18572 | 18574 | | |
| 18575 | + | |
18573 | 18576 | | |
18574 | 18577 | | |
18575 | 18578 | | |
18576 | | - | |
| 18579 | + | |
| 18580 | + | |
18577 | 18581 | | |
18578 | 18582 | | |
18579 | 18583 | | |
18580 | 18584 | | |
18581 | | - | |
| 18585 | + | |
18582 | 18586 | | |
18583 | 18587 | | |
18584 | 18588 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments