fix: unconditionally test sw pext impl, not hw

This commit is contained in:
Rekai Nyangadzayi Musuka 2023-12-13 02:28:07 -06:00
parent 64e1daf31f
commit 4363360ce4
1 changed files with 2 additions and 2 deletions

View File

@ -364,8 +364,8 @@ const pext = struct {
test pext { test pext {
const builtin = @import("builtin"); const builtin = @import("builtin");
try std.testing.expectEqual(@as(u32, 0x0001_2567), pext.hw(u32, 0x12345678, 0xFF00FFF0)); try std.testing.expectEqual(@as(u32, 0x0001_2567), pext.sw(u32, 0x12345678, 0xFF00FFF0));
try std.testing.expectEqual(@as(u64, 0x0001_2567), pext.hw(u64, 0x12345678, 0xFF00FFF0)); try std.testing.expectEqual(@as(u64, 0x0001_2567), pext.sw(u64, 0x12345678, 0xFF00FFF0));
switch (builtin.cpu.arch) { switch (builtin.cpu.arch) {
.x86_64 => if (std.Target.x86.featureSetHas(builtin.cpu.features, .bmi2)) { .x86_64 => if (std.Target.x86.featureSetHas(builtin.cpu.features, .bmi2)) {