#include <metal_stdlib> | |
using namespace metal; | |
struct tint_module_vars_struct { | |
thread half* t; | |
}; | |
half m(tint_module_vars_struct tint_module_vars) { | |
(*tint_module_vars.t) = 1.0h; | |
return half((*tint_module_vars.t)); | |
} | |
int tint_f16_to_i32(half value) { | |
return select(2147483647, select((-2147483647 - 1), int(value), (value >= -65504.0h)), (value <= 65504.0h)); | |
} | |
void f(tint_module_vars_struct tint_module_vars) { | |
int v = tint_f16_to_i32(m(tint_module_vars)); | |
} |