#include <metal_stdlib> | |
using namespace metal; | |
struct S { | |
int a; | |
}; | |
struct tint_module_vars_struct { | |
device S* v; | |
}; | |
int tint_mod_i32(int lhs, int rhs) { | |
int const v_1 = select(rhs, 1, ((rhs == 0) | ((lhs == (-2147483647 - 1)) & (rhs == -1)))); | |
return (lhs - ((lhs / v_1) * v_1)); | |
} | |
void foo(tint_module_vars_struct tint_module_vars) { | |
(*tint_module_vars.v).a = tint_mod_i32((*tint_module_vars.v).a, 2); | |
} |