authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-03-05 02:58:15-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-06 08:09:32-05:00
log27701596060c7a8018f9a9add21952a6d7f83d96
treed6ddaf9165ed31431031415d90a2aa3fff1fa6a1
parentc29c4c6f70ccde441ff8e40e94c2848fef1f86da

std: reenable vectorized code with the C backend


3 files changed, 4 insertions(+), 12 deletions(-)

lib/std/crypto/blake3.zig+1-1
......@@ -200,7 +200,7 @@ const CompressGeneric = struct {
200200 }
201201};
202202
203const compress = if (builtin.cpu.arch == .x86_64 and builtin.zig_backend != .stage2_c)
203const compress = if (builtin.cpu.arch == .x86_64)
204204 CompressVectorized.compress
205205else
206206 CompressGeneric.compress;
lib/std/crypto/gimli.zig+1-1
......@@ -152,7 +152,7 @@ pub const State = struct {
152152 self.endianSwap();
153153 }
154154
155 pub const permute = if (builtin.cpu.arch == .x86_64 and builtin.zig_backend != .stage2_c) impl: {
155 pub const permute = if (builtin.cpu.arch == .x86_64) impl: {
156156 break :impl permute_vectorized;
157157 } else if (builtin.mode == .ReleaseSmall) impl: {
158158 break :impl permute_small;
lib/std/target.zig+2-10
......@@ -719,11 +719,7 @@ pub const Target = struct {
719719
720720 /// Adds the specified feature set but not its dependencies.
721721 pub fn addFeatureSet(set: *Set, other_set: Set) void {
722 if (builtin.zig_backend == .stage2_c) {
723 for (&set.ints, 0..) |*int, i| int.* |= other_set.ints[i];
724 } else {
725 set.ints = @as(@Vector(usize_count, usize), set.ints) | @as(@Vector(usize_count, usize), other_set.ints);
726 }
722 set.ints = @as(@Vector(usize_count, usize), set.ints) | @as(@Vector(usize_count, usize), other_set.ints);
727723 }
728724
729725 /// Removes the specified feature but not its dependents.
......@@ -735,11 +731,7 @@ pub const Target = struct {
735731
736732 /// Removes the specified feature but not its dependents.
737733 pub fn removeFeatureSet(set: *Set, other_set: Set) void {
738 if (builtin.zig_backend == .stage2_c) {
739 for (&set.ints, 0..) |*int, i| int.* &= ~other_set.ints[i];
740 } else {
741 set.ints = @as(@Vector(usize_count, usize), set.ints) & ~@as(@Vector(usize_count, usize), other_set.ints);
742 }
734 set.ints = @as(@Vector(usize_count, usize), set.ints) & ~@as(@Vector(usize_count, usize), other_set.ints);
743735 }
744736
745737 pub fn populateDependencies(set: *Set, all_features_list: []const Cpu.Feature) void {