| 821 | } |
| 822 | |
| 823 | expr expr::ssub_sat(const expr &rhs) const { |
| 824 | expr sub_ext = sext(1) - rhs.sext(1); |
| 825 | auto bw = bits(); |
| 826 | auto min = IntSMin(bw); |
| 827 | auto max = IntSMax(bw); |
| 828 | return mkIf(sub_ext.sle(min.sext(1)), |
| 829 | min, |
| 830 | mkIf(sub_ext.sge(max.sext(1)), |
| 831 | max, |
| 832 | *this - rhs)); |
| 833 | } |
| 834 | |
| 835 | expr expr::usub_sat(const expr &rhs) const { |
| 836 | C(); |