Commit cfaeee6
authored
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: #832681 parent 767b61c commit cfaeee6
File tree
3 files changed
+58
-0
lines changed- llvm
- lib/Target/SystemZ
- test/CodeGen/SystemZ
3 files changed
+58
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4252 | 4252 | | |
4253 | 4253 | | |
4254 | 4254 | | |
| 4255 | + | |
4255 | 4256 | | |
4256 | 4257 | | |
4257 | 4258 | | |
| |||
4261 | 4262 | | |
4262 | 4263 | | |
4263 | 4264 | | |
| 4265 | + | |
4264 | 4266 | | |
4265 | 4267 | | |
4266 | 4268 | | |
4267 | 4269 | | |
4268 | 4270 | | |
4269 | 4271 | | |
4270 | 4272 | | |
| 4273 | + | |
| 4274 | + | |
| 4275 | + | |
4271 | 4276 | | |
4272 | 4277 | | |
4273 | 4278 | | |
| |||
4340 | 4345 | | |
4341 | 4346 | | |
4342 | 4347 | | |
| 4348 | + | |
4343 | 4349 | | |
4344 | 4350 | | |
4345 | 4351 | | |
| |||
4349 | 4355 | | |
4350 | 4356 | | |
4351 | 4357 | | |
| 4358 | + | |
4352 | 4359 | | |
4353 | 4360 | | |
| 4361 | + | |
| 4362 | + | |
| 4363 | + | |
4354 | 4364 | | |
4355 | 4365 | | |
4356 | 4366 | | |
4357 | 4367 | | |
4358 | 4368 | | |
4359 | 4369 | | |
| 4370 | + | |
| 4371 | + | |
| 4372 | + | |
4360 | 4373 | | |
4361 | 4374 | | |
4362 | 4375 | | |
| |||
6611 | 6624 | | |
6612 | 6625 | | |
6613 | 6626 | | |
| 6627 | + | |
| 6628 | + | |
| 6629 | + | |
| 6630 | + | |
| 6631 | + | |
| 6632 | + | |
| 6633 | + | |
| 6634 | + | |
| 6635 | + | |
| 6636 | + | |
| 6637 | + | |
| 6638 | + | |
| 6639 | + | |
| 6640 | + | |
| 6641 | + | |
| 6642 | + | |
| 6643 | + | |
| 6644 | + | |
| 6645 | + | |
| 6646 | + | |
| 6647 | + | |
6614 | 6648 | | |
6615 | 6649 | | |
6616 | 6650 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
49 | 70 | | |
| 71 | + | |
50 | 72 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
0 commit comments