authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-30 02:55:49+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-01 20:58:08+02:00
log7d88bd0b9c4ca12235769a04c45842dab3b54827
tree7c04752f5de9ff83e44d2083ecfbf241760bbef0
parenta9c78185120fd1dd731c00f1bd961f0b2e2b2c83
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.simd: Fix an isARM() check to use isArmOrThumb() instead.

Thumb can have NEON instructions too.

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

lib/std/simd.zig+1-1
...@@ -18,7 +18,7 @@ pub fn suggestVectorLengthForCpu(comptime T: type, comptime cpu: std.Target.Cpu)...@@ -18,7 +18,7 @@ pub fn suggestVectorLengthForCpu(comptime T: type, comptime cpu: std.Target.Cpu)
18 if (std.Target.x86.featureSetHasAny(cpu.features, .{ .prefer_256_bit, .avx2 }) and !std.Target.x86.featureSetHas(cpu.features, .prefer_128_bit)) break :blk 256;18 if (std.Target.x86.featureSetHasAny(cpu.features, .{ .prefer_256_bit, .avx2 }) and !std.Target.x86.featureSetHas(cpu.features, .prefer_128_bit)) break :blk 256;
19 if (std.Target.x86.featureSetHas(cpu.features, .sse)) break :blk 128;19 if (std.Target.x86.featureSetHas(cpu.features, .sse)) break :blk 128;
20 if (std.Target.x86.featureSetHasAny(cpu.features, .{ .mmx, .@"3dnow" })) break :blk 64;20 if (std.Target.x86.featureSetHasAny(cpu.features, .{ .mmx, .@"3dnow" })) break :blk 64;
21 } else if (cpu.arch.isARM()) {21 } else if (cpu.arch.isArmOrThumb()) {
22 if (std.Target.arm.featureSetHas(cpu.features, .neon)) break :blk 128;22 if (std.Target.arm.featureSetHas(cpu.features, .neon)) break :blk 128;
23 } else if (cpu.arch.isAARCH64()) {23 } else if (cpu.arch.isAARCH64()) {
24 // SVE allows up to 2048 bits in the specification, as of 2022 the most powerful machine has implemented 512-bit24 // SVE allows up to 2048 bits in the specification, as of 2022 the most powerful machine has implemented 512-bit