Commit 5097faa
arm32, bpf: add support for 32-bit signed division
The cpuv4 added a new BPF_SDIV instruction that does signed division.
The encoding is similar to BPF_DIV but BPF_SDIV sets offset=1.
ARM32 already supports 32-bit BPF_DIV which can be easily extended to
support BPF_SDIV as ARM32 has the SDIV instruction. When the CPU is not
ARM-v7, we implement that SDIV/SMOD with the function call similar to
the implementation of DIV/MOD.
Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20230907230550.1417590-6-puranjay12@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>1 parent 1cfb7ea commit 5097faa
2 files changed
+32
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
231 | 241 | | |
232 | 242 | | |
233 | 243 | | |
| |||
477 | 487 | | |
478 | 488 | | |
479 | 489 | | |
480 | | - | |
| 490 | + | |
481 | 491 | | |
482 | 492 | | |
483 | 493 | | |
| 494 | + | |
484 | 495 | | |
485 | 496 | | |
486 | 497 | | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
491 | 502 | | |
492 | 503 | | |
493 | 504 | | |
| |||
515 | 526 | | |
516 | 527 | | |
517 | 528 | | |
518 | | - | |
519 | | - | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
520 | 542 | | |
521 | 543 | | |
522 | 544 | | |
| |||
1551 | 1573 | | |
1552 | 1574 | | |
1553 | 1575 | | |
1554 | | - | |
| 1576 | + | |
1555 | 1577 | | |
1556 | 1578 | | |
1557 | 1579 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
| 271 | + | |
270 | 272 | | |
271 | 273 | | |
272 | 274 | | |
| |||
0 commit comments