authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2023-11-08 16:23:40-08:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-11-21 13:51:03+02:00
log15a6b279571a02b5b31451c0200d09578ea99995
tree7e9141a580633019f41ebb80e2566ebce2509a0c
parent583afd6f0c01336c20dcd218cb7d14aad6894ab1

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.

1 files changed, 4 insertions(+), 2 deletions(-)

lib/std/unicode.zig+4-2
......@@ -942,7 +942,8 @@ pub fn utf8ToUtf16LeWithNull(allocator: mem.Allocator, utf8: []const u8) ![:0]u1
942942 errdefer result.deinit();
943943
944944 var remaining = utf8;
945 if (builtin.zig_backend != .stage2_x86_64) {
945 // Need support for std.simd.interlace
946 if (builtin.zig_backend != .stage2_x86_64 and comptime !builtin.cpu.arch.isMIPS()) {
946947 const chunk_len = std.simd.suggestVectorSize(u8) orelse 1;
947948 const Chunk = @Vector(chunk_len, u8);
948949
......@@ -986,7 +987,8 @@ pub fn utf8ToUtf16Le(utf16le: []u16, utf8: []const u8) !usize {
986987 var dest_i: usize = 0;
987988
988989 var remaining = utf8;
989 if (builtin.zig_backend != .stage2_x86_64) {
990 // Need support for std.simd.interlace
991 if (builtin.zig_backend != .stage2_x86_64 and comptime !builtin.cpu.arch.isMIPS()) {
990992 const chunk_len = std.simd.suggestVectorSize(u8) orelse 1;
991993 const Chunk = @Vector(chunk_len, u8);
992994