|
350 | 350 | ;; (x * C) (==/!=) D --> x (==/!=) (D / C) when C is odd and divides D |
351 | 351 | (rule |
352 | 352 | (simplify (ne ty (iconst_u ty1 x) (imul ty1 y (iconst_u ty1 z)))) |
353 | | - (if-let 0 (u64_rem x z)) |
| 353 | + (if-let 0 (u64_checked_rem x z)) |
354 | 354 | (if-let 1 (u64_rem z 2)) |
355 | 355 | (ne ty y (iconst ty1 (imm64 (u64_div x z))))) |
356 | 356 | (rule |
357 | 357 | (simplify (ne ty (iconst_u ty1 x) (imul ty1 (iconst_u ty1 y) z))) |
358 | | - (if-let 0 (u64_rem x y)) |
| 358 | + (if-let 0 (u64_checked_rem x y)) |
359 | 359 | (if-let 1 (u64_rem y 2)) |
360 | 360 | (ne ty z (iconst ty1 (imm64 (u64_div x y))))) |
361 | 361 | (rule |
362 | 362 | (simplify (ne ty (imul ty1 x (iconst_u ty1 y)) (iconst_u ty1 z))) |
363 | | - (if-let 0 (u64_rem z y)) |
| 363 | + (if-let 0 (u64_checked_rem z y)) |
364 | 364 | (if-let 1 (u64_rem y 2)) |
365 | 365 | (ne ty x (iconst ty1 (imm64 (u64_div z y))))) |
366 | 366 | (rule |
367 | 367 | (simplify (ne ty (imul ty1 (iconst_u ty1 x) y) (iconst_u ty1 z))) |
368 | | - (if-let 0 (u64_rem z x)) |
| 368 | + (if-let 0 (u64_checked_rem z x)) |
369 | 369 | (if-let 1 (u64_rem x 2)) |
370 | 370 | (ne ty y (iconst ty1 (imm64 (u64_div z x))))) |
371 | 371 |
|
372 | 372 |
|
373 | 373 | (rule |
374 | 374 | (simplify (eq ty (iconst_u ty1 x) (imul ty1 y (iconst_u ty1 z)))) |
375 | | - (if-let 0 (u64_rem x z)) |
| 375 | + (if-let 0 (u64_checked_rem x z)) |
376 | 376 | (if-let 1 (u64_rem z 2)) |
377 | 377 | (eq ty y (iconst ty1 (imm64 (u64_div x z))))) |
378 | 378 | (rule |
379 | 379 | (simplify (eq ty (iconst_u ty1 x) (imul ty1 (iconst_u ty1 y) z))) |
380 | | - (if-let 0 (u64_rem x y)) |
| 380 | + (if-let 0 (u64_checked_rem x y)) |
381 | 381 | (if-let 1 (u64_rem y 2)) |
382 | 382 | (eq ty z (iconst ty1 (imm64 (u64_div x y))))) |
383 | 383 | (rule |
384 | 384 | (simplify (eq ty (imul ty1 x (iconst_u ty1 y)) (iconst_u ty1 z))) |
385 | | - (if-let 0 (u64_rem z y)) |
| 385 | + (if-let 0 (u64_checked_rem z y)) |
386 | 386 | (if-let 1 (u64_rem y 2)) |
387 | 387 | (eq ty x (iconst ty1 (imm64 (u64_div z y))))) |
388 | 388 | (rule |
389 | 389 | (simplify (eq ty (imul ty1 (iconst_u ty1 x) y) (iconst_u ty1 z))) |
390 | | - (if-let 0 (u64_rem z x)) |
| 390 | + (if-let 0 (u64_checked_rem z x)) |
391 | 391 | (if-let 1 (u64_rem x 2)) |
392 | 392 | (eq ty y (iconst ty1 (imm64 (u64_div z x))))) |
393 | | - |
394 | | - |
0 commit comments