Skip to content

Instantly share code, notes, and snippets.

@Validark
Created June 24, 2025 20:44
Show Gist options
  • Save Validark/24f22bd71581ee72b747584625360ec1 to your computer and use it in GitHub Desktop.
Save Validark/24f22bd71581ee72b747584625360ec1 to your computer and use it in GitHub Desktop.
vp2intersect in zig
const std = @import("std");
const builtin = @import("builtin");
const IntersectResult = extern struct { mask1: @Vector(16, bool), mask2: @Vector(16, bool) };
export fn vp2intersectd(a: @Vector(16, i32), b: @Vector(16, i32)) IntersectResult {
return struct {
extern fn @"llvm.x86.avx512.vp2intersect.d.512"(@Vector(16, i32), @Vector(16, i32)) callconv(.{ .x86_64_vectorcall = .{} }) IntersectResult;
}.@"llvm.x86.avx512.vp2intersect.d.512"(a, b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment