Commit 5e3bfc4
Automerge: [PowerPC] Exploit xxeval instruction for operations of the form ternary(A,X, XOR(B,C)) and ternary(A,X, OR(B,C)) (#157909)
Adds support for ternary equivalent operations of the form
- `ternary(A, X, xor(B,C))` where `X=[and(B,C)| nor(B,C)| or(B,C)| B |
C]`.
- `ternary(A, X, or(B,C))` where `X = [and(B,C)| eqv(B,C)| not(B)|
not(C)| nand(B,C)| B | C]`.
The following are the patterns involved and the imm values:
```
ternary(A, and(B,C), xor(B,C)) 97
ternary(A, B, xor(B,C)) 99
ternary(A, C, xor(B,C)) 101
ternary(A, or(B,C), xor(B,C)) 103
ternary(A, nor(B,C), xor(B,C)) 104
ternary(A, and(B,C), or(B,C)) 113
ternary(A, B, or(B,C)) 115
ternary(A, C, or(B,C)) 117
ternary(A, eqv(B,C), or(B,C)) 121
ternary(A, not(C), or(B,C)) 122
ternary(A, not(B), or(B,C)) 124
ternary(A, nand(B,C), or(B,C)) 126
```
eg. `xxeval XT, XA, XB, XC, 97`
performs the ternary operation: `XA ? and(XB, XC) : xor(XB, XC)` and
places the result in `XT`.
This is the continuation of:
- [[PowerPC] Exploit xxeval instruction for ternary patterns -
ternary(A, X,
and(B,C))](llvm/llvm-project#141733 (comment))
- [[PowerPC] Exploit xxeval instruction for operations of the form
ternary(A,X,B) and
ternary(A,X,C).](llvm/llvm-project#152956 (comment))
---------
Co-authored-by: Tony Varghese <[email protected]>File tree
4 files changed
+139
-133
lines changed- llvm
- lib/Target/PowerPC
- test/CodeGen/PowerPC
4 files changed
+139
-133
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2326 | 2326 | | |
2327 | 2327 | | |
2328 | 2328 | | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
2329 | 2414 | | |
2330 | 2415 | | |
2331 | 2416 | | |
| |||
2438 | 2523 | | |
2439 | 2524 | | |
2440 | 2525 | | |
2441 | | - | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
2442 | 2529 | | |
2443 | 2530 | | |
2444 | 2531 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | 177 | | |
179 | 178 | | |
180 | | - | |
| 179 | + | |
181 | 180 | | |
182 | 181 | | |
183 | 182 | | |
| |||
0 commit comments