| 459 | } |
| 460 | |
| 461 | static void |
| 462 | eval_xor(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, size_t opsz, |
| 463 | uint64_t msk) |
| 464 | { |
| 465 | /* both operands are constants */ |
| 466 | if (rd->u.min == rd->u.max && rs->u.min == rs->u.max) { |
| 467 | rd->u.min ^= rs->u.min; |
| 468 | rd->u.max ^= rs->u.max; |
| 469 | } else { |
| 470 | rd->u.max = eval_uor_max(rd->u.max, rs->u.max, opsz); |
| 471 | rd->u.min = 0; |
| 472 | } |
| 473 | |
| 474 | /* both operands are constants */ |
| 475 | if (rd->s.min == rd->s.max && rs->s.min == rs->s.max) { |
| 476 | rd->s.min ^= rs->s.min; |
| 477 | rd->s.max ^= rs->s.max; |
| 478 | |
| 479 | /* both operands are non-negative */ |
| 480 | } else if (rd->s.min >= 0 || rs->s.min >= 0) { |
| 481 | rd->s.max = eval_uor_max(rd->s.max, rs->s.max, opsz); |
| 482 | rd->s.min = 0; |
| 483 | } else |
| 484 | eval_smax_bound(rd, msk); |
| 485 | } |
| 486 | |
| 487 | static void |
| 488 | eval_mul(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, size_t opsz, |
no test coverage detected