Projet_SETI_RISC-V/riscv-gnu-toolchain/qemu/scripts/coccinelle/simplify_muldiv64.cocci
2023-03-06 14:48:14 +01:00

11 lines
220 B
Text

// replace muldiv64(i32, i32, x) by (uint64_t)i32 * i32 / x
@@
typedef uint32_t;
typedef int32_t;
{ uint32_t, int32_t, int, unsigned int } a, b;
typedef uint64_t;
expression c;
@@
-muldiv64(a,b,c)
+(uint64_t) a * b / c