historical/m0-applesillicon.git/xnu-qemu-arm64-5.1.0/scripts/coccinelle/simplify_muldiv64.cocci

12 lines
220 B
Text
Raw Normal View History

2024-01-16 17:20:27 +00:00
// 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