blob: 431a06ae23249499a6e24791b7342c945475b38d [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
struct strided_arr {
/* 0x0000 */ float el;
/* 0x0004 */ tint_array<int8_t, 4> tint_pad;
};
#define TINT_ISOLATE_UB(VOLATILE_NAME) \
volatile bool VOLATILE_NAME = true; \
if (VOLATILE_NAME)
struct strided_arr_1 {
/* 0x0000 */ tint_array<tint_array<strided_arr, 2>, 3> el;
/* 0x0030 */ tint_array<int8_t, 80> tint_pad_1;
};
struct S {
/* 0x0000 */ tint_array<strided_arr_1, 4> a;
};
struct tint_module_vars_struct {
device S* s;
};
void tint_store_and_preserve_padding_4(device strided_arr* const target, strided_arr value_param) {
(*target).el = value_param.el;
}
void tint_store_and_preserve_padding_3(device tint_array<strided_arr, 2>* const target, tint_array<strided_arr, 2> value_param) {
{
uint v = 0u;
v = 0u;
TINT_ISOLATE_UB(tint_volatile_true) while(true) {
uint const v_1 = v;
if ((v_1 >= 2u)) {
break;
}
tint_store_and_preserve_padding_4((&(*target)[v_1]), value_param[v_1]);
{
v = (v_1 + 1u);
}
continue;
}
}
}
void tint_store_and_preserve_padding_2(device tint_array<tint_array<strided_arr, 2>, 3>* const target, tint_array<tint_array<strided_arr, 2>, 3> value_param) {
{
uint v_2 = 0u;
v_2 = 0u;
TINT_ISOLATE_UB(tint_volatile_true_1) while(true) {
uint const v_3 = v_2;
if ((v_3 >= 3u)) {
break;
}
tint_store_and_preserve_padding_3((&(*target)[v_3]), value_param[v_3]);
{
v_2 = (v_3 + 1u);
}
continue;
}
}
}
void tint_store_and_preserve_padding_1(device strided_arr_1* const target, strided_arr_1 value_param) {
tint_store_and_preserve_padding_2((&(*target).el), value_param.el);
}
void tint_store_and_preserve_padding(device tint_array<strided_arr_1, 4>* const target, tint_array<strided_arr_1, 4> value_param) {
{
uint v_4 = 0u;
v_4 = 0u;
TINT_ISOLATE_UB(tint_volatile_true_2) while(true) {
uint const v_5 = v_4;
if ((v_5 >= 4u)) {
break;
}
tint_store_and_preserve_padding_1((&(*target)[v_5]), value_param[v_5]);
{
v_4 = (v_5 + 1u);
}
continue;
}
}
}
void f_1(tint_module_vars_struct tint_module_vars) {
tint_array<strided_arr_1, 4> const x_19 = (*tint_module_vars.s).a;
tint_array<tint_array<strided_arr, 2>, 3> const x_24 = (*tint_module_vars.s).a[3].el;
tint_array<strided_arr, 2> const x_28 = (*tint_module_vars.s).a[3].el[2];
float const x_32 = (*tint_module_vars.s).a[3].el[2][1].el;
tint_store_and_preserve_padding((&(*tint_module_vars.s).a), tint_array<strided_arr_1, 4>{});
(*tint_module_vars.s).a[3].el[2][1].el = 5.0f;
}
kernel void f(device S* s [[buffer(0)]]) {
tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.s=s};
f_1(tint_module_vars);
}