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.
This commit is contained in:
Ryan Liptak 2023-11-08 16:23:40 -08:00 committed by Veikka Tuominen
parent 583afd6f0c
commit 15a6b27957

View File

@ -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);