simd: utf8 validation

This commit is contained in:
Mitchell Hashimoto
2024-01-29 20:40:05 -08:00
parent dc041f86fd
commit 987c5d213e
3 changed files with 353 additions and 9 deletions

View File

@@ -1,17 +1,16 @@
const std = @import("std");
pub const isa = @import("isa.zig");
pub const utf8 = @import("utf8.zig");
const index_of = @import("index_of.zig");
pub usingnamespace index_of;
// const utf8 = @import("utf8.zig");
// pub usingnamespace utf8;
pub fn main() !void {
//std.log.warn("ISA={}", .{isa.ISA.detect()});
const input = "1234567\x1b1234567\x1b";
//const input = "1234567812345678";
std.log.warn("result={any}", .{index_of.indexOf(input, 0x1B)});
std.log.warn("result={any}", .{utf8.utf8Validate(input)});
}
test {