blob: 48d693217fff5f53b0cedefa740cbe7b1f142b98 [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct atomic_compare_exchange_result_i32 {
int old_value;
bool exchanged;
};
struct SB_RW {
atomic_int arg_0;
};
struct tint_module_vars_struct {
device SB_RW* sb_rw;
};
atomic_compare_exchange_result_i32 v(device atomic_int* const atomic_ptr, int cmp, int val) {
int old_value = cmp;
bool const v_1 = atomic_compare_exchange_weak_explicit(atomic_ptr, (&old_value), val, memory_order_relaxed, memory_order_relaxed);
return atomic_compare_exchange_result_i32{.old_value=old_value, .exchanged=v_1};
}
void atomicCompareExchangeWeak_1bd40a(tint_module_vars_struct tint_module_vars) {
int arg_1 = 1;
int arg_2 = 1;
atomic_compare_exchange_result_i32 res = v((&(*tint_module_vars.sb_rw).arg_0), arg_1, arg_2);
}
fragment void fragment_main(device SB_RW* sb_rw [[buffer(0)]]) {
tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.sb_rw=sb_rw};
atomicCompareExchangeWeak_1bd40a(tint_module_vars);
}
kernel void compute_main(device SB_RW* sb_rw [[buffer(0)]]) {
tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.sb_rw=sb_rw};
atomicCompareExchangeWeak_1bd40a(tint_module_vars);
}