curl https://webinstall.dev/ollama
source ~/.config/envman/PATH.env
ollama serve
ollama run deepseek-coder-v2
curl https://webinstall.dev/ollama
source ~/.config/envman/PATH.env
ollama serve
ollama run deepseek-coder-v2
const std = @import("std"); | |
const builtin = @import("builtin"); | |
const assert = std.debug.assert; | |
const has_native_carryless_multiply = switch (builtin.cpu.arch) { | |
.x86_64 => std.Target.x86.featureSetHas(builtin.cpu.features, .pclmul), | |
.aarch64 => std.Target.aarch64.featureSetHas(builtin.cpu.features, .aes), | |
.riscv64 => std.Target.riscv.featureSetHas(builtin.cpu.features, .zbc), | |
//.sparc64 => std.Target.sparc.featureSetHas(builtin.cpu.features, .vis3), | |
else => false, |
fn tbl4( | |
table_part_1: @Vector(16, u8), | |
table_part_2: @Vector(16, u8), | |
table_part_3: @Vector(16, u8), | |
table_part_4: @Vector(16, u8), | |
indices: @Vector(8, u8) | |
) @TypeOf(indices) { | |
return struct { | |
extern fn @"llvm.aarch64.neon.tbl4"(@TypeOf(table_part_1), @TypeOf(table_part_2), @TypeOf(table_part_3), @TypeOf(table_part_4), @TypeOf(indices)) @TypeOf(indices); | |
}.@"llvm.aarch64.neon.tbl4"(table_part_1, table_part_2, table_part_3, table_part_4, indices); |
const std = @import("std"); | |
fn cmtst(a: anytype, comptime b: @TypeOf(a)) @TypeOf(a) { | |
return @select(u8, (a & b) != @as(@TypeOf(a), @splat(0)), @as(@TypeOf(a), @splat(0xff)), @as(@TypeOf(a), @splat(0))); | |
} | |
fn unmovemask(x: u64) @Vector(64, u8) { | |
const vec = @as(@Vector(8, u8), @bitCast(x)); | |
const interlaced_vec = std.simd.interlace(.{ vec, vec }); |
export fn st4(vec: @Vector(64, u8), ptr: [*]u8) void { | |
const chunks: [4]@Vector(16, u8) = @bitCast(vec); | |
return struct { | |
extern fn @"llvm.aarch64.neon.st4.v16i8.p0"( | |
@Vector(16, u8), | |
@Vector(16, u8), | |
@Vector(16, u8), | |
@Vector(16, u8), | |
[*]u8 | |
) void; |
"use strict"; | |
// Adapted from | |
// github.com/dashpay/dash/tree/develop/src/governance/common.cpp | |
// USAGE | |
// node ./gobject-hash-debugger.js | |
var GObj = module.exports; |
export fn cls(e: u64) @TypeOf(e) { | |
const e2: @TypeOf(e) = @bitCast(@as(std.meta.Int(.signed, @bitSizeOf(@TypeOf(e))), @bitCast(e)) >> (@bitSizeOf(@TypeOf(e)) - 1)); | |
return @clz(((e ^ e2) << 1) | 1); | |
} |
/* | |
Language: Zig | |
Author: fwx <[email protected]> | |
*/ | |
export const zigLanguageSupport = (hljs) => { | |
const LITERALS = ["true", "false", "null", "undefined"]; | |
const BUILT_INS = [ | |
"@This", | |
"@import", |
Here is an overview of which ISA's support these instructions I compiled for an upcoming presentation:
fn swarGe(x: anytype, y: @TypeOf(x)) @TypeOf(x) { | |
const msb: @TypeOf(x) = @bitCast(@as(@Vector(@sizeOf(@TypeOf(x)), u8), @splat(0x80))); | |
return (((x ^ y) & x) | (~(x ^ y) & ((x | msb) -% (y & ~msb)))); | |
} | |
fn swarLe(x: anytype, y: @TypeOf(x)) @TypeOf(x) { | |
return swarGe(y, x); | |
} | |
fn swarEq(x: anytype, y: @TypeOf(x)) @TypeOf(x) { |