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 {...@@ -200,7 +200,7 @@ const CompressGeneric = struct {
200 }200 }
201};201};
202202
203const compress = if (builtin.cpu.arch == .x86_64 and builtin.zig_backend != .stage2_c)203const compress = if (builtin.cpu.arch == .x86_64)
204 CompressVectorized.compress204 CompressVectorized.compress
205else205else
206 CompressGeneric.compress;206 CompressGeneric.compress;
lib/std/crypto/gimli.zig+1-1
...@@ -152,7 +152,7 @@ pub const State = struct {...@@ -152,7 +152,7 @@ pub const State = struct {
152 self.endianSwap();152 self.endianSwap();
153 }153 }
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: {
156 break :impl permute_vectorized;156 break :impl permute_vectorized;
157 } else if (builtin.mode == .ReleaseSmall) impl: {157 } else if (builtin.mode == .ReleaseSmall) impl: {
158 break :impl permute_small;158 break :impl permute_small;
lib/std/target.zig+2-10
...@@ -719,11 +719,7 @@ pub const Target = struct {...@@ -719,11 +719,7 @@ pub const Target = struct {
719719
720 /// Adds the specified feature set but not its dependencies.720 /// Adds the specified feature set but not its dependencies.
721 pub fn addFeatureSet(set: *Set, other_set: Set) void {721 pub fn addFeatureSet(set: *Set, other_set: Set) void {
722 if (builtin.zig_backend == .stage2_c) {722 set.ints = @as(@Vector(usize_count, usize), set.ints) | @as(@Vector(usize_count, usize), other_set.ints);
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 }
727 }723 }
728724
729 /// Removes the specified feature but not its dependents.725 /// Removes the specified feature but not its dependents.
...@@ -735,11 +731,7 @@ pub const Target = struct {...@@ -735,11 +731,7 @@ pub const Target = struct {
735731
736 /// Removes the specified feature but not its dependents.732 /// Removes the specified feature but not its dependents.
737 pub fn removeFeatureSet(set: *Set, other_set: Set) void {733 pub fn removeFeatureSet(set: *Set, other_set: Set) void {
738 if (builtin.zig_backend == .stage2_c) {734 set.ints = @as(@Vector(usize_count, usize), set.ints) & ~@as(@Vector(usize_count, usize), other_set.ints);
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 }
743 }735 }
744736
745 pub fn populateDependencies(set: *Set, all_features_list: []const Cpu.Feature) void {737 pub fn populateDependencies(set: *Set, all_features_list: []const Cpu.Feature) void {