From 4e409e85f10db832746846e6279b8a0f4ec3b042 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Tue, 10 Nov 2026 01:47:45 -0800 Subject: [PATCH] Fixture pfx_fetch: its companions from scripts/regen-air-fixtures Regenerated on the M3 (job m3-max-13401, Metal 32023.922, SDK 27.2, LLVM 21). (cherry picked from commit 67bc2d50f0df5bbfc7bf6063412a3abce681fcfe) (cherry picked from commit f991e6031a3591105fc2156b7e76db55e920bbaa) (cherry picked from commit c9d2958d65853e87a83c887c7d23ac93a10f5fa1) --- .../fixtures/public/engine/TOOLCHAIN | 1 + .../fixtures/public/engine/pfx_fetch.air.ll | 121 ++++++++++++++++++ .../fixtures/public/engine/pfx_fetch.ll | 121 ++++++++++++++++++ 3 files changed, 243 insertions(+) create mode 100644 crates/metal2vulkan-validation/fixtures/public/engine/pfx_fetch.air.ll create mode 100644 crates/metal2vulkan-validation/fixtures/public/engine/pfx_fetch.ll diff --git a/crates/metal2vulkan-validation/fixtures/public/engine/TOOLCHAIN b/crates/metal2vulkan-validation/fixtures/public/engine/TOOLCHAIN index 5e405df91..f1edc5799 100644 --- a/crates/metal2vulkan-validation/fixtures/public/engine/TOOLCHAIN +++ b/crates/metal2vulkan-validation/fixtures/public/engine/TOOLCHAIN @@ -253,6 +253,7 @@ fixture ob3_texture_array: metal: Apple metal version 32023.921 (metalfe-32023.9 fixture ob3_vertex_input: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425) fixture pdc_compare_clamp: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425) fixture pdc_post_depth_coverage: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425) +fixture pfx_fetch: metal: Apple metal version 32023.922 (metalfe-32023.922.4); macosx-sdk: 27.2 (26B118) fixture primitive_ids: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425) fixture psb_reads: metal: Apple metal version 32023.922 (metalfe-32023.922.4); macosx-sdk: 27.2 (26B118) fixture psc_sample_coverage: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425) diff --git a/crates/metal2vulkan-validation/fixtures/public/engine/pfx_fetch.air.ll b/crates/metal2vulkan-validation/fixtures/public/engine/pfx_fetch.air.ll new file mode 100644 index 000000000..aefc8a1e7 --- /dev/null +++ b/crates/metal2vulkan-validation/fixtures/public/engine/pfx_fetch.air.ll @@ -0,0 +1,121 @@ +; Generated by scripts/regen-air-fixtures from pfx_fetch.metal (typed pointers; xcrun metal-as reassembles it). Do not edit. +; ModuleID = '-' +source_filename = "-" +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32" +target triple = "air64_v28-apple-macosx26.0.0" + +; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn +define <{ <4 x float> }> @pfx_fetch_vertex(i32 noundef %0) local_unnamed_addr #0 { + %2 = and i32 %0, 1 + %3 = tail call fast float @air.convert.f.f32.u.i32(i32 %2) #5 + %4 = insertelement <2 x float> undef, float %3, i64 0 + %5 = lshr i32 %0, 1 + %6 = tail call fast float @air.convert.f.f32.u.i32(i32 %5) #5 + %7 = insertelement <2 x float> %4, float %6, i64 1 + %8 = fmul fast <2 x float> %7, + %9 = fadd fast <2 x float> %8, + %10 = shufflevector <2 x float> %9, <2 x float> poison, <4 x i32> + %11 = shufflevector <4 x float> %10, <4 x float> , <4 x i32> + %12 = insertvalue <{ <4 x float> }> undef, <4 x float> %11, 0 + ret <{ <4 x float> }> %12 +} + +; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn +declare float @air.convert.f.f32.u.i32(i32) local_unnamed_addr #1 + +; Function Attrs: argmemonly mustprogress nofree nosync nounwind readonly willreturn +define <{ <4 x float> }> @pfx_fetch_fill(<4 x float> %0, <4 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %1, i32 addrspace(2)* nocapture noundef readonly align 4 dereferenceable(4) "air-buffer-no-alias" %2) local_unnamed_addr #2 { + %4 = extractelement <4 x float> %0, i64 0 + %5 = tail call i32 @air.convert.u.i32.f.f32(float %4) #5 + %6 = extractelement <4 x float> %0, i64 1 + %7 = tail call i32 @air.convert.u.i32.f.f32(float %6) #5 + %8 = load i32, i32 addrspace(2)* %2, align 4, !tbaa !36, !alias.scope !40, !noalias !43 + %9 = mul i32 %8, %7 + %10 = add i32 %9, %5 + %11 = zext i32 %10 to i64 + %12 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %1, i64 %11 + %13 = load <4 x float>, <4 x float> addrspace(1)* %12, align 16, !tbaa !45, !alias.scope !43, !noalias !40 + %14 = insertvalue <{ <4 x float> }> undef, <4 x float> %13, 0 + ret <{ <4 x float> }> %14 +} + +; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn +declare i32 @air.convert.u.i32.f.f32(float) local_unnamed_addr #1 + +; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn +define <{ <4 x float> }> @pfx_fetch_read(<4 x float> %0, <4 x float> noundef %1) local_unnamed_addr #3 { + %3 = insertvalue <{ <4 x float> }> undef, <4 x float> %1, 0 + ret <{ <4 x float> }> %3 +} + +; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn +define <{ <4 x float> }> @pfx_fetch_read_half(<4 x float> %0, <4 x half> noundef %1) local_unnamed_addr #4 { + %3 = tail call fast <4 x float> @air.convert.f.v4f32.f.v4f16(<4 x half> %1) #5 + %4 = insertvalue <{ <4 x float> }> undef, <4 x float> %3, 0 + ret <{ <4 x float> }> %4 +} + +; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn +declare <4 x float> @air.convert.f.v4f32.f.v4f16(<4 x half>) local_unnamed_addr #1 + +attributes #0 = { mustprogress nofree nosync nounwind readnone willreturn "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="0" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" } +attributes #1 = { mustprogress nofree nosync nounwind readnone willreturn } +attributes #2 = { argmemonly mustprogress nofree nosync nounwind readonly willreturn "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" } +attributes #3 = { mustprogress nofree norecurse nosync nounwind readnone willreturn "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" } +attributes #4 = { mustprogress nofree nosync nounwind readnone willreturn "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" } +attributes #5 = { nounwind readnone willreturn } + +!llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7, !8} +!air.vertex = !{!9} +!air.fragment = !{!14, !21, !27} +!air.compile_options = !{!30, !31, !32} +!llvm.ident = !{!33} +!air.version = !{!34} +!air.language_version = !{!35} + +!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 27, i32 2]} +!1 = !{i32 1, !"wchar_size", i32 4} +!2 = !{i32 7, !"frame-pointer", i32 2} +!3 = !{i32 7, !"air.max_device_buffers", i32 31} +!4 = !{i32 7, !"air.max_constant_buffers", i32 31} +!5 = !{i32 7, !"air.max_threadgroup_buffers", i32 31} +!6 = !{i32 7, !"air.max_textures", i32 128} +!7 = !{i32 7, !"air.max_read_write_textures", i32 8} +!8 = !{i32 7, !"air.max_samplers", i32 16} +!9 = !{<{ <4 x float> }> (i32)* @pfx_fetch_vertex, !10, !12} +!10 = !{!11} +!11 = !{!"air.position", !"air.arg_type_name", !"float4", !"air.arg_name", !"position"} +!12 = !{!13} +!13 = !{i32 0, !"air.vertex_id", !"air.arg_type_name", !"uint", !"air.arg_name", !"id"} +!14 = !{<{ <4 x float> }> (<4 x float>, <4 x float> addrspace(1)*, i32 addrspace(2)*)* @pfx_fetch_fill, !15, !17} +!15 = !{!16} +!16 = !{!"air.render_target", i32 0, i32 0, !"air.arg_type_name", !"float4", !"air.arg_name", !"color"} +!17 = !{!18, !19, !20} +!18 = !{i32 0, !"air.position", !"air.center", !"air.no_perspective", !"air.arg_type_name", !"float4", !"air.arg_name", !"position"} +!19 = !{i32 1, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 16, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"float4", !"air.arg_name", !"values"} +!20 = !{i32 2, !"air.buffer", !"air.buffer_size", i32 4, !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 2, !"air.arg_type_size", i32 4, !"air.arg_type_align_size", i32 4, !"air.arg_type_name", !"uint", !"air.arg_name", !"width"} +!21 = !{<{ <4 x float> }> (<4 x float>, <4 x float>)* @pfx_fetch_read, !22, !24} +!22 = !{!23} +!23 = !{!"air.render_target", i32 1, i32 0, !"air.arg_type_name", !"float4", !"air.arg_name", !"color"} +!24 = !{!25, !26} +!25 = !{i32 0, !"air.position", !"air.center", !"air.no_perspective", !"air.arg_type_name", !"float4", !"air.arg_name", !"position", !"air.arg_unused"} +!26 = !{i32 1, !"air.render_target", i32 0, !"air.arg_type_name", !"float4", !"air.arg_name", !"previous"} +!27 = !{<{ <4 x float> }> (<4 x float>, <4 x half>)* @pfx_fetch_read_half, !22, !28} +!28 = !{!25, !29} +!29 = !{i32 1, !"air.render_target", i32 0, !"air.arg_type_name", !"half4", !"air.arg_name", !"previous"} +!30 = !{!"air.compile.denorms_disable"} +!31 = !{!"air.compile.fast_math_enable"} +!32 = !{!"air.compile.framebuffer_fetch_enable"} +!33 = !{!"Apple metal version 32023.922 (metalfe-32023.922.4)"} +!34 = !{i32 2, i32 8, i32 0} +!35 = !{!"Metal", i32 4, i32 0, i32 0} +!36 = !{!37, !37, i64 0} +!37 = !{!"int", !38, i64 0} +!38 = !{!"omnipotent char", !39, i64 0} +!39 = !{!"Simple C++ TBAA"} +!40 = !{!41} +!41 = distinct !{!41, !42, !"air-alias-scope-arg(2)"} +!42 = distinct !{!42, !"air-alias-scopes(pfx_fetch_fill)"} +!43 = !{!44} +!44 = distinct !{!44, !42, !"air-alias-scope-arg(1)"} +!45 = !{!38, !38, i64 0} diff --git a/crates/metal2vulkan-validation/fixtures/public/engine/pfx_fetch.ll b/crates/metal2vulkan-validation/fixtures/public/engine/pfx_fetch.ll new file mode 100644 index 000000000..a9e0c57e5 --- /dev/null +++ b/crates/metal2vulkan-validation/fixtures/public/engine/pfx_fetch.ll @@ -0,0 +1,121 @@ +; Generated by scripts/regen-air-fixtures from pfx_fetch.metal (llvm-dis of pfx_fetch.air). Do not edit. +; ModuleID = '' +source_filename = "-" +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32" +target triple = "air64_v28-apple-macosx26.0.0" + +; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) +define <{ <4 x float> }> @pfx_fetch_vertex(i32 noundef %0) local_unnamed_addr #0 { + %2 = and i32 %0, 1 + %3 = tail call fast float @air.convert.f.f32.u.i32(i32 %2) #5 + %4 = insertelement <2 x float> undef, float %3, i64 0 + %5 = lshr i32 %0, 1 + %6 = tail call fast float @air.convert.f.f32.u.i32(i32 %5) #5 + %7 = insertelement <2 x float> %4, float %6, i64 1 + %8 = fmul fast <2 x float> %7, splat (float 4.000000e+00) + %9 = fadd fast <2 x float> %8, splat (float -1.000000e+00) + %10 = shufflevector <2 x float> %9, <2 x float> poison, <4 x i32> + %11 = shufflevector <4 x float> %10, <4 x float> , <4 x i32> + %12 = insertvalue <{ <4 x float> }> undef, <4 x float> %11, 0 + ret <{ <4 x float> }> %12 +} + +; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) +declare float @air.convert.f.f32.u.i32(i32) local_unnamed_addr #1 + +; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) +define <{ <4 x float> }> @pfx_fetch_fill(<4 x float> %0, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(2) noundef readonly align 4 captures(none) dereferenceable(4) "air-buffer-no-alias" %2) local_unnamed_addr #2 { + %4 = extractelement <4 x float> %0, i64 0 + %5 = tail call i32 @air.convert.u.i32.f.f32(float %4) #5 + %6 = extractelement <4 x float> %0, i64 1 + %7 = tail call i32 @air.convert.u.i32.f.f32(float %6) #5 + %8 = load i32, ptr addrspace(2) %2, align 4, !tbaa !36, !alias.scope !40, !noalias !43 + %9 = mul i32 %8, %7 + %10 = add i32 %9, %5 + %11 = zext i32 %10 to i64 + %12 = getelementptr inbounds <4 x float>, ptr addrspace(1) %1, i64 %11 + %13 = load <4 x float>, ptr addrspace(1) %12, align 16, !tbaa !45, !alias.scope !43, !noalias !40 + %14 = insertvalue <{ <4 x float> }> undef, <4 x float> %13, 0 + ret <{ <4 x float> }> %14 +} + +; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) +declare i32 @air.convert.u.i32.f.f32(float) local_unnamed_addr #1 + +; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +define <{ <4 x float> }> @pfx_fetch_read(<4 x float> %0, <4 x float> noundef %1) local_unnamed_addr #3 { + %3 = insertvalue <{ <4 x float> }> undef, <4 x float> %1, 0 + ret <{ <4 x float> }> %3 +} + +; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) +define <{ <4 x float> }> @pfx_fetch_read_half(<4 x float> %0, <4 x half> noundef %1) local_unnamed_addr #4 { + %3 = tail call fast <4 x float> @air.convert.f.v4f32.f.v4f16(<4 x half> %1) #5 + %4 = insertvalue <{ <4 x float> }> undef, <4 x float> %3, 0 + ret <{ <4 x float> }> %4 +} + +; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) +declare <4 x float> @air.convert.f.v4f32.f.v4f16(<4 x half>) local_unnamed_addr #1 + +attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="0" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" } +attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) } +attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" } +attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" } +attributes #4 = { mustprogress nofree nosync nounwind willreturn memory(none) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" } +attributes #5 = { nounwind willreturn memory(none) } + +!llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7, !8} +!air.vertex = !{!9} +!air.fragment = !{!14, !21, !27} +!air.compile_options = !{!30, !31, !32} +!llvm.ident = !{!33} +!air.version = !{!34} +!air.language_version = !{!35} + +!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 27, i32 2]} +!1 = !{i32 1, !"wchar_size", i32 4} +!2 = !{i32 7, !"frame-pointer", i32 2} +!3 = !{i32 7, !"air.max_device_buffers", i32 31} +!4 = !{i32 7, !"air.max_constant_buffers", i32 31} +!5 = !{i32 7, !"air.max_threadgroup_buffers", i32 31} +!6 = !{i32 7, !"air.max_textures", i32 128} +!7 = !{i32 7, !"air.max_read_write_textures", i32 8} +!8 = !{i32 7, !"air.max_samplers", i32 16} +!9 = !{ptr @pfx_fetch_vertex, !10, !12} +!10 = !{!11} +!11 = !{!"air.position", !"air.arg_type_name", !"float4", !"air.arg_name", !"position"} +!12 = !{!13} +!13 = !{i32 0, !"air.vertex_id", !"air.arg_type_name", !"uint", !"air.arg_name", !"id"} +!14 = !{ptr @pfx_fetch_fill, !15, !17} +!15 = !{!16} +!16 = !{!"air.render_target", i32 0, i32 0, !"air.arg_type_name", !"float4", !"air.arg_name", !"color"} +!17 = !{!18, !19, !20} +!18 = !{i32 0, !"air.position", !"air.center", !"air.no_perspective", !"air.arg_type_name", !"float4", !"air.arg_name", !"position"} +!19 = !{i32 1, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 16, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"float4", !"air.arg_name", !"values"} +!20 = !{i32 2, !"air.buffer", !"air.buffer_size", i32 4, !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 2, !"air.arg_type_size", i32 4, !"air.arg_type_align_size", i32 4, !"air.arg_type_name", !"uint", !"air.arg_name", !"width"} +!21 = !{ptr @pfx_fetch_read, !22, !24} +!22 = !{!23} +!23 = !{!"air.render_target", i32 1, i32 0, !"air.arg_type_name", !"float4", !"air.arg_name", !"color"} +!24 = !{!25, !26} +!25 = !{i32 0, !"air.position", !"air.center", !"air.no_perspective", !"air.arg_type_name", !"float4", !"air.arg_name", !"position", !"air.arg_unused"} +!26 = !{i32 1, !"air.render_target", i32 0, !"air.arg_type_name", !"float4", !"air.arg_name", !"previous"} +!27 = !{ptr @pfx_fetch_read_half, !22, !28} +!28 = !{!25, !29} +!29 = !{i32 1, !"air.render_target", i32 0, !"air.arg_type_name", !"half4", !"air.arg_name", !"previous"} +!30 = !{!"air.compile.denorms_disable"} +!31 = !{!"air.compile.fast_math_enable"} +!32 = !{!"air.compile.framebuffer_fetch_enable"} +!33 = !{!"Apple metal version 32023.922 (metalfe-32023.922.4)"} +!34 = !{i32 2, i32 8, i32 0} +!35 = !{!"Metal", i32 4, i32 0, i32 0} +!36 = !{!37, !37, i64 0} +!37 = !{!"int", !38, i64 0} +!38 = !{!"omnipotent char", !39, i64 0} +!39 = !{!"Simple C++ TBAA"} +!40 = !{!41} +!41 = distinct !{!41, !42, !"air-alias-scope-arg(2)"} +!42 = distinct !{!42, !"air-alias-scopes(pfx_fetch_fill)"} +!43 = !{!44} +!44 = distinct !{!44, !42, !"air-alias-scope-arg(1)"} +!45 = !{!38, !38, i64 0}