mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 22:41:07 +01:00
[msl] use expression index as name for statement results in remaining
places
This commit is contained in:
1 parent
93cd1193c2
commit
f0c49fbe8e
6 files changed
+82
-82
No files matched your search
@@ -4288,7 +4288,7 @@ impl<W: Write> Writer<W> {
|
||||
self.write_barrier(crate::Barrier::WORK_GROUP, level)?;
|
||||
|
||||
write!(self.out, "{level}")?;
|
||||
let name = self.namer.call("");
|
||||
let name = Baked(result).to_string();
|
||||
self.start_baking_expression(result, &context.expression, &name)?;
|
||||
self.put_load(pointer, &context.expression, true)?;
|
||||
self.named_expressions.insert(result, name);
|
||||
@@ -4301,7 +4301,7 @@ impl<W: Write> Writer<W> {
|
||||
}
|
||||
crate::Statement::SubgroupBallot { result, predicate } => {
|
||||
write!(self.out, "{level}")?;
|
||||
let name = self.namer.call("");
|
||||
let name = Baked(result).to_string();
|
||||
self.start_baking_expression(result, &context.expression, &name)?;
|
||||
self.named_expressions.insert(result, name);
|
||||
write!(
|
||||
@@ -4322,7 +4322,7 @@ impl<W: Write> Writer<W> {
|
||||
result,
|
||||
} => {
|
||||
write!(self.out, "{level}")?;
|
||||
let name = self.namer.call("");
|
||||
let name = Baked(result).to_string();
|
||||
self.start_baking_expression(result, &context.expression, &name)?;
|
||||
self.named_expressions.insert(result, name);
|
||||
match (collective_op, op) {
|
||||
@@ -4380,7 +4380,7 @@ impl<W: Write> Writer<W> {
|
||||
result,
|
||||
} => {
|
||||
write!(self.out, "{level}")?;
|
||||
let name = self.namer.call("");
|
||||
let name = Baked(result).to_string();
|
||||
self.start_baking_expression(result, &context.expression, &name)?;
|
||||
self.named_expressions.insert(result, name);
|
||||
match mode {
|
||||
|
||||
@@ -12,27 +12,27 @@ void function(
|
||||
uint _e5 = global_2;
|
||||
uint _e6 = global_3;
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_none);
|
||||
metal::uint4 unnamed = metal::uint4((uint64_t)metal::simd_ballot((_e6 & 1u) == 1u), 0, 0, 0);
|
||||
metal::uint4 unnamed_1 = metal::uint4((uint64_t)metal::simd_ballot(true), 0, 0, 0);
|
||||
bool unnamed_2 = metal::simd_all(_e6 != 0u);
|
||||
bool unnamed_3 = metal::simd_any(_e6 == 0u);
|
||||
uint unnamed_4 = metal::simd_sum(_e6);
|
||||
uint unnamed_5 = metal::simd_product(_e6);
|
||||
uint unnamed_6 = metal::simd_min(_e6);
|
||||
uint unnamed_7 = metal::simd_max(_e6);
|
||||
uint unnamed_8 = metal::simd_and(_e6);
|
||||
uint unnamed_9 = metal::simd_or(_e6);
|
||||
uint unnamed_10 = metal::simd_xor(_e6);
|
||||
uint unnamed_11 = metal::simd_prefix_exclusive_sum(_e6);
|
||||
uint unnamed_12 = metal::simd_prefix_exclusive_product(_e6);
|
||||
uint unnamed_13 = metal::simd_prefix_inclusive_sum(_e6);
|
||||
uint unnamed_14 = metal::simd_prefix_inclusive_product(_e6);
|
||||
uint unnamed_15 = metal::simd_broadcast_first(_e6);
|
||||
uint unnamed_16 = metal::simd_broadcast(_e6, 4u);
|
||||
uint unnamed_17 = metal::simd_shuffle(_e6, (_e5 - 1u) - _e6);
|
||||
uint unnamed_18 = metal::simd_shuffle_down(_e6, 1u);
|
||||
uint unnamed_19 = metal::simd_shuffle_up(_e6, 1u);
|
||||
uint unnamed_20 = metal::simd_shuffle_xor(_e6, _e5 - 1u);
|
||||
metal::uint4 _e9 = metal::uint4((uint64_t)metal::simd_ballot((_e6 & 1u) == 1u), 0, 0, 0);
|
||||
metal::uint4 _e10 = metal::uint4((uint64_t)metal::simd_ballot(true), 0, 0, 0);
|
||||
bool _e12 = metal::simd_all(_e6 != 0u);
|
||||
bool _e14 = metal::simd_any(_e6 == 0u);
|
||||
uint _e15 = metal::simd_sum(_e6);
|
||||
uint _e16 = metal::simd_product(_e6);
|
||||
uint _e17 = metal::simd_min(_e6);
|
||||
uint _e18 = metal::simd_max(_e6);
|
||||
uint _e19 = metal::simd_and(_e6);
|
||||
uint _e20 = metal::simd_or(_e6);
|
||||
uint _e21 = metal::simd_xor(_e6);
|
||||
uint _e22 = metal::simd_prefix_exclusive_sum(_e6);
|
||||
uint _e23 = metal::simd_prefix_exclusive_product(_e6);
|
||||
uint _e24 = metal::simd_prefix_inclusive_sum(_e6);
|
||||
uint _e25 = metal::simd_prefix_inclusive_product(_e6);
|
||||
uint _e26 = metal::simd_broadcast_first(_e6);
|
||||
uint _e27 = metal::simd_broadcast(_e6, 4u);
|
||||
uint _e30 = metal::simd_shuffle(_e6, (_e5 - 1u) - _e6);
|
||||
uint _e31 = metal::simd_shuffle_down(_e6, 1u);
|
||||
uint _e32 = metal::simd_shuffle_up(_e6, 1u);
|
||||
uint _e34 = metal::simd_shuffle_xor(_e6, _e5 - 1u);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -270,39 +270,39 @@ struct main_Input {
|
||||
output.final_value = _e6 + static_cast<ushort>(_e8);
|
||||
sg_val = static_cast<short>(subgroup_invocation_id);
|
||||
short _e13 = sg_val;
|
||||
short unnamed = metal::simd_sum(_e13);
|
||||
sg_val = unnamed;
|
||||
short _e14 = metal::simd_sum(_e13);
|
||||
sg_val = _e14;
|
||||
short _e15 = sg_val;
|
||||
short unnamed_1 = metal::simd_product(_e15);
|
||||
sg_val = unnamed_1;
|
||||
short _e16 = metal::simd_product(_e15);
|
||||
sg_val = _e16;
|
||||
short _e17 = sg_val;
|
||||
short unnamed_2 = metal::simd_min(_e17);
|
||||
sg_val = unnamed_2;
|
||||
short _e18 = metal::simd_min(_e17);
|
||||
sg_val = _e18;
|
||||
short _e19 = sg_val;
|
||||
short unnamed_3 = metal::simd_max(_e19);
|
||||
sg_val = unnamed_3;
|
||||
short _e20 = metal::simd_max(_e19);
|
||||
sg_val = _e20;
|
||||
short _e21 = sg_val;
|
||||
short unnamed_4 = metal::simd_prefix_exclusive_sum(_e21);
|
||||
sg_val = unnamed_4;
|
||||
short _e22 = metal::simd_prefix_exclusive_sum(_e21);
|
||||
sg_val = _e22;
|
||||
short _e23 = sg_val;
|
||||
short unnamed_5 = metal::simd_prefix_inclusive_sum(_e23);
|
||||
sg_val = unnamed_5;
|
||||
short _e24 = metal::simd_prefix_inclusive_sum(_e23);
|
||||
sg_val = _e24;
|
||||
short _e25 = sg_val;
|
||||
short unnamed_6 = metal::simd_broadcast_first(_e25);
|
||||
sg_val = unnamed_6;
|
||||
short _e26 = metal::simd_broadcast_first(_e25);
|
||||
sg_val = _e26;
|
||||
short _e27 = sg_val;
|
||||
short unnamed_7 = metal::simd_broadcast(_e27, 4u);
|
||||
sg_val = unnamed_7;
|
||||
short _e29 = metal::simd_broadcast(_e27, 4u);
|
||||
sg_val = _e29;
|
||||
sg_uval = static_cast<ushort>(subgroup_invocation_id);
|
||||
ushort _e32 = sg_uval;
|
||||
ushort unnamed_8 = metal::simd_sum(_e32);
|
||||
sg_uval = unnamed_8;
|
||||
ushort _e33 = metal::simd_sum(_e32);
|
||||
sg_uval = _e33;
|
||||
ushort _e34 = sg_uval;
|
||||
ushort unnamed_9 = metal::simd_min(_e34);
|
||||
sg_uval = unnamed_9;
|
||||
ushort _e35 = metal::simd_min(_e34);
|
||||
sg_uval = _e35;
|
||||
ushort _e36 = sg_uval;
|
||||
ushort unnamed_10 = metal::simd_max(_e36);
|
||||
sg_uval = unnamed_10;
|
||||
ushort _e37 = metal::simd_max(_e36);
|
||||
sg_uval = _e37;
|
||||
short _e40 = sg_val;
|
||||
output.val_i16_ = _e40;
|
||||
ushort _e43 = sg_uval;
|
||||
|
||||
@@ -18,30 +18,30 @@ struct main_Input {
|
||||
, uint subgroup_invocation_id [[thread_index_in_simdgroup]]
|
||||
) {
|
||||
const Structure sizes = { num_subgroups, subgroup_size };
|
||||
metal::uint4 unnamed = metal::uint4((uint64_t)metal::simd_ballot((subgroup_invocation_id & 1u) == 1u), 0, 0, 0);
|
||||
metal::uint4 unnamed_1 = metal::uint4((uint64_t)metal::simd_ballot(true), 0, 0, 0);
|
||||
bool unnamed_2 = metal::simd_all(subgroup_invocation_id != 0u);
|
||||
bool unnamed_3 = metal::simd_any(subgroup_invocation_id == 0u);
|
||||
uint unnamed_4 = metal::simd_sum(subgroup_invocation_id);
|
||||
uint unnamed_5 = metal::simd_product(subgroup_invocation_id);
|
||||
uint unnamed_6 = metal::simd_min(subgroup_invocation_id);
|
||||
uint unnamed_7 = metal::simd_max(subgroup_invocation_id);
|
||||
uint unnamed_8 = metal::simd_and(subgroup_invocation_id);
|
||||
uint unnamed_9 = metal::simd_or(subgroup_invocation_id);
|
||||
uint unnamed_10 = metal::simd_xor(subgroup_invocation_id);
|
||||
uint unnamed_11 = metal::simd_prefix_exclusive_sum(subgroup_invocation_id);
|
||||
uint unnamed_12 = metal::simd_prefix_exclusive_product(subgroup_invocation_id);
|
||||
uint unnamed_13 = metal::simd_prefix_inclusive_sum(subgroup_invocation_id);
|
||||
uint unnamed_14 = metal::simd_prefix_inclusive_product(subgroup_invocation_id);
|
||||
uint unnamed_15 = metal::simd_broadcast_first(subgroup_invocation_id);
|
||||
uint unnamed_16 = metal::simd_broadcast(subgroup_invocation_id, 4u);
|
||||
uint unnamed_17 = metal::simd_shuffle(subgroup_invocation_id, (sizes.subgroup_size - 1u) - subgroup_invocation_id);
|
||||
uint unnamed_18 = metal::simd_shuffle_down(subgroup_invocation_id, 1u);
|
||||
uint unnamed_19 = metal::simd_shuffle_up(subgroup_invocation_id, 1u);
|
||||
uint unnamed_20 = metal::simd_shuffle_xor(subgroup_invocation_id, sizes.subgroup_size - 1u);
|
||||
uint unnamed_21 = metal::quad_broadcast(subgroup_invocation_id, 4u);
|
||||
uint unnamed_22 = metal::quad_shuffle_xor(subgroup_invocation_id, 1u);
|
||||
uint unnamed_23 = metal::quad_shuffle_xor(subgroup_invocation_id, 2u);
|
||||
uint unnamed_24 = metal::quad_shuffle_xor(subgroup_invocation_id, 3u);
|
||||
metal::uint4 _e7 = metal::uint4((uint64_t)metal::simd_ballot((subgroup_invocation_id & 1u) == 1u), 0, 0, 0);
|
||||
metal::uint4 _e8 = metal::uint4((uint64_t)metal::simd_ballot(true), 0, 0, 0);
|
||||
bool _e11 = metal::simd_all(subgroup_invocation_id != 0u);
|
||||
bool _e14 = metal::simd_any(subgroup_invocation_id == 0u);
|
||||
uint _e15 = metal::simd_sum(subgroup_invocation_id);
|
||||
uint _e16 = metal::simd_product(subgroup_invocation_id);
|
||||
uint _e17 = metal::simd_min(subgroup_invocation_id);
|
||||
uint _e18 = metal::simd_max(subgroup_invocation_id);
|
||||
uint _e19 = metal::simd_and(subgroup_invocation_id);
|
||||
uint _e20 = metal::simd_or(subgroup_invocation_id);
|
||||
uint _e21 = metal::simd_xor(subgroup_invocation_id);
|
||||
uint _e22 = metal::simd_prefix_exclusive_sum(subgroup_invocation_id);
|
||||
uint _e23 = metal::simd_prefix_exclusive_product(subgroup_invocation_id);
|
||||
uint _e24 = metal::simd_prefix_inclusive_sum(subgroup_invocation_id);
|
||||
uint _e25 = metal::simd_prefix_inclusive_product(subgroup_invocation_id);
|
||||
uint _e26 = metal::simd_broadcast_first(subgroup_invocation_id);
|
||||
uint _e28 = metal::simd_broadcast(subgroup_invocation_id, 4u);
|
||||
uint _e33 = metal::simd_shuffle(subgroup_invocation_id, (sizes.subgroup_size - 1u) - subgroup_invocation_id);
|
||||
uint _e35 = metal::simd_shuffle_down(subgroup_invocation_id, 1u);
|
||||
uint _e37 = metal::simd_shuffle_up(subgroup_invocation_id, 1u);
|
||||
uint _e41 = metal::simd_shuffle_xor(subgroup_invocation_id, sizes.subgroup_size - 1u);
|
||||
uint _e43 = metal::quad_broadcast(subgroup_invocation_id, 4u);
|
||||
uint _e44 = metal::quad_shuffle_xor(subgroup_invocation_id, 1u);
|
||||
uint _e45 = metal::quad_shuffle_xor(subgroup_invocation_id, 2u);
|
||||
uint _e46 = metal::quad_shuffle_xor(subgroup_invocation_id, 3u);
|
||||
return;
|
||||
}
|
||||
@@ -41,31 +41,31 @@ kernel void test_atomic_workgroup_uniform_load(
|
||||
int _e22 = metal::atomic_fetch_add_explicit(&wg_struct.atomic_arr.inner[0], 1, metal::memory_order_relaxed);
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
||||
uint unnamed = metal::atomic_load_explicit(&wg_scalar, metal::memory_order_relaxed);
|
||||
uint _e24 = metal::atomic_load_explicit(&wg_scalar, metal::memory_order_relaxed);
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
||||
int unnamed_1 = metal::atomic_load_explicit(&wg_signed, metal::memory_order_relaxed);
|
||||
int _e26 = metal::atomic_load_explicit(&wg_signed, metal::memory_order_relaxed);
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
||||
uint unnamed_2 = metal::atomic_load_explicit(&wg_struct.atomic_scalar, metal::memory_order_relaxed);
|
||||
uint _e29 = metal::atomic_load_explicit(&wg_struct.atomic_scalar, metal::memory_order_relaxed);
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
||||
int unnamed_3 = metal::atomic_load_explicit(&wg_struct.atomic_arr.inner[0], metal::memory_order_relaxed);
|
||||
int _e33 = metal::atomic_load_explicit(&wg_struct.atomic_arr.inner[0], metal::memory_order_relaxed);
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
||||
if (unnamed == 0u) {
|
||||
local = unnamed_1 > 0;
|
||||
if (_e24 == 0u) {
|
||||
local = _e26 > 0;
|
||||
} else {
|
||||
local = false;
|
||||
}
|
||||
bool _e41 = local;
|
||||
if (_e41) {
|
||||
local_1 = unnamed_2 > 0u;
|
||||
local_1 = _e29 > 0u;
|
||||
} else {
|
||||
local_1 = false;
|
||||
}
|
||||
bool _e47 = local_1;
|
||||
if (_e47) {
|
||||
local_2 = unnamed_3 > 0;
|
||||
local_2 = _e33 > 0;
|
||||
} else {
|
||||
local_2 = false;
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@ kernel void test_workgroupUniformLoad(
|
||||
}
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
||||
int unnamed = arr_i32_.inner[workgroup_id.x];
|
||||
int _e4 = arr_i32_.inner[workgroup_id.x];
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
||||
if (unnamed > 10) {
|
||||
if (_e4 > 10) {
|
||||
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
|
||||
return;
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user