commit 15a6b279571a02b5b31451c0200d09578ea99995 (tree)
parent 583afd6f0c01336c20dcd218cb7d14aad6894ab1
Author: Ryan Liptak <squeek502@hotmail.com>
Date: Wed, 8 Nov 2023 16:23:40 -0800
std.unicode: Disable utf8 -> utf16 ASCII fast path on mips
Fixes a compile error when the target is mips, since std.simd.interlace does not work correctly on mips and raises a compile error if it is used.
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/std/unicode.zig b/lib/std/unicode.zig
@@ -942,7 +942,8 @@ pub fn utf8ToUtf16LeWithNull(allocator: mem.Allocator, utf8: []const u8) ![:0]u1
errdefer result.deinit();
var remaining = utf8;
- if (builtin.zig_backend != .stage2_x86_64) {
+ // Need support for std.simd.interlace
+ if (builtin.zig_backend != .stage2_x86_64 and comptime !builtin.cpu.arch.isMIPS()) {
const chunk_len = std.simd.suggestVectorSize(u8) orelse 1;
const Chunk = @Vector(chunk_len, u8);
@@ -986,7 +987,8 @@ pub fn utf8ToUtf16Le(utf16le: []u16, utf8: []const u8) !usize {
var dest_i: usize = 0;
var remaining = utf8;
- if (builtin.zig_backend != .stage2_x86_64) {
+ // Need support for std.simd.interlace
+ if (builtin.zig_backend != .stage2_x86_64 and comptime !builtin.cpu.arch.isMIPS()) {
const chunk_len = std.simd.suggestVectorSize(u8) orelse 1;
const Chunk = @Vector(chunk_len, u8);