| 659 | |
| 660 | |
| 661 | static unsigned parse_binop_flags(token op_token) { |
| 662 | switch (op_token) { |
| 663 | case ADD: |
| 664 | case SUB: |
| 665 | case MUL: |
| 666 | case SHL: |
| 667 | return parse_nsw_nuw(); |
| 668 | case SDIV: |
| 669 | case UDIV: |
| 670 | case LSHR: |
| 671 | case ASHR: |
| 672 | return parse_exact(); |
| 673 | case FADD: |
| 674 | case FSUB: |
| 675 | case FMUL: |
| 676 | case FDIV: |
| 677 | case FREM: |
| 678 | case FMAX: |
| 679 | case FMIN: |
| 680 | case FMAXIMUM: |
| 681 | case FMINIMUM: |
| 682 | case FMAXIMUMNUM: |
| 683 | case FMINIMUMNUM: |
| 684 | case SREM: |
| 685 | case UREM: |
| 686 | case UADD_SAT: |
| 687 | case SADD_SAT: |
| 688 | case USUB_SAT: |
| 689 | case SSUB_SAT: |
| 690 | case USHL_SAT: |
| 691 | case SSHL_SAT: |
| 692 | case AND: |
| 693 | case OR: |
| 694 | case XOR: |
| 695 | case CTTZ: |
| 696 | case CTLZ: |
| 697 | case SADD_OVERFLOW: |
| 698 | case UADD_OVERFLOW: |
| 699 | case SSUB_OVERFLOW: |
| 700 | case USUB_OVERFLOW: |
| 701 | case SMUL_OVERFLOW: |
| 702 | case UMUL_OVERFLOW: |
| 703 | case UMIN: |
| 704 | case UMAX: |
| 705 | case SMIN: |
| 706 | case SMAX: |
| 707 | case ABS: |
| 708 | case UCMP: |
| 709 | case SCMP: |
| 710 | return BinOp::None; |
| 711 | default: |
| 712 | UNREACHABLE(); |
| 713 | } |
| 714 | } |
| 715 | |
| 716 | static unique_ptr<Instr> parse_binop(string_view name, token op_token) { |
| 717 | auto flags = parse_binop_flags(op_token); |
no test coverage detected