Skip to content

Commit 3fd3358

Browse files
committed
x86_64: implement integer @reduce(.Min)
1 parent 7d727ed commit 3fd3358

File tree

17 files changed

+8597
-847
lines changed

17 files changed

+8597
-847
lines changed

lib/std/zig/Zir.zig

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2142,7 +2142,7 @@ pub const Inst = struct {
21422142
ref_start_index = static_len,
21432143
_,
21442144

2145-
pub const static_len = 109;
2145+
pub const static_len = 117;
21462146

21472147
pub fn toRef(i: Index) Inst.Ref {
21482148
return @enumFromInt(@intFromEnum(Index.ref_start_index) + @intFromEnum(i));
@@ -2229,27 +2229,35 @@ pub const Inst = struct {
22292229
vector_8_i8_type,
22302230
vector_16_i8_type,
22312231
vector_32_i8_type,
2232+
vector_64_i8_type,
22322233
vector_1_u8_type,
22332234
vector_2_u8_type,
22342235
vector_4_u8_type,
22352236
vector_8_u8_type,
22362237
vector_16_u8_type,
22372238
vector_32_u8_type,
22382239
vector_64_u8_type,
2240+
vector_2_i16_type,
22392241
vector_4_i16_type,
22402242
vector_8_i16_type,
22412243
vector_16_i16_type,
2244+
vector_32_i16_type,
22422245
vector_4_u16_type,
22432246
vector_8_u16_type,
22442247
vector_16_u16_type,
2248+
vector_32_u16_type,
22452249
vector_4_i32_type,
22462250
vector_8_i32_type,
2251+
vector_16_i32_type,
22472252
vector_4_u32_type,
22482253
vector_8_u32_type,
2254+
vector_16_u32_type,
22492255
vector_2_i64_type,
22502256
vector_4_i64_type,
2257+
vector_8_i64_type,
22512258
vector_2_u64_type,
22522259
vector_4_u64_type,
2260+
vector_8_u64_type,
22532261
vector_1_u128_type,
22542262
vector_2_u128_type,
22552263
vector_1_u256_type,

src/Air.zig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,27 +1012,35 @@ pub const Inst = struct {
10121012
vector_8_i8_type = @intFromEnum(InternPool.Index.vector_8_i8_type),
10131013
vector_16_i8_type = @intFromEnum(InternPool.Index.vector_16_i8_type),
10141014
vector_32_i8_type = @intFromEnum(InternPool.Index.vector_32_i8_type),
1015+
vector_64_i8_type = @intFromEnum(InternPool.Index.vector_64_i8_type),
10151016
vector_1_u8_type = @intFromEnum(InternPool.Index.vector_1_u8_type),
10161017
vector_2_u8_type = @intFromEnum(InternPool.Index.vector_2_u8_type),
10171018
vector_4_u8_type = @intFromEnum(InternPool.Index.vector_4_u8_type),
10181019
vector_8_u8_type = @intFromEnum(InternPool.Index.vector_8_u8_type),
10191020
vector_16_u8_type = @intFromEnum(InternPool.Index.vector_16_u8_type),
10201021
vector_32_u8_type = @intFromEnum(InternPool.Index.vector_32_u8_type),
10211022
vector_64_u8_type = @intFromEnum(InternPool.Index.vector_64_u8_type),
1023+
vector_2_i16_type = @intFromEnum(InternPool.Index.vector_2_i16_type),
10221024
vector_4_i16_type = @intFromEnum(InternPool.Index.vector_4_i16_type),
10231025
vector_8_i16_type = @intFromEnum(InternPool.Index.vector_8_i16_type),
10241026
vector_16_i16_type = @intFromEnum(InternPool.Index.vector_16_i16_type),
1027+
vector_32_i16_type = @intFromEnum(InternPool.Index.vector_32_i16_type),
10251028
vector_4_u16_type = @intFromEnum(InternPool.Index.vector_4_u16_type),
10261029
vector_8_u16_type = @intFromEnum(InternPool.Index.vector_8_u16_type),
10271030
vector_16_u16_type = @intFromEnum(InternPool.Index.vector_16_u16_type),
1031+
vector_32_u16_type = @intFromEnum(InternPool.Index.vector_32_u16_type),
10281032
vector_4_i32_type = @intFromEnum(InternPool.Index.vector_4_i32_type),
10291033
vector_8_i32_type = @intFromEnum(InternPool.Index.vector_8_i32_type),
1034+
vector_16_i32_type = @intFromEnum(InternPool.Index.vector_16_i32_type),
10301035
vector_4_u32_type = @intFromEnum(InternPool.Index.vector_4_u32_type),
10311036
vector_8_u32_type = @intFromEnum(InternPool.Index.vector_8_u32_type),
1037+
vector_16_u32_type = @intFromEnum(InternPool.Index.vector_16_u32_type),
10321038
vector_2_i64_type = @intFromEnum(InternPool.Index.vector_2_i64_type),
10331039
vector_4_i64_type = @intFromEnum(InternPool.Index.vector_4_i64_type),
1040+
vector_8_i64_type = @intFromEnum(InternPool.Index.vector_8_i64_type),
10341041
vector_2_u64_type = @intFromEnum(InternPool.Index.vector_2_u64_type),
10351042
vector_4_u64_type = @intFromEnum(InternPool.Index.vector_4_u64_type),
1043+
vector_8_u64_type = @intFromEnum(InternPool.Index.vector_8_u64_type),
10361044
vector_1_u128_type = @intFromEnum(InternPool.Index.vector_1_u128_type),
10371045
vector_2_u128_type = @intFromEnum(InternPool.Index.vector_2_u128_type),
10381046
vector_1_u256_type = @intFromEnum(InternPool.Index.vector_1_u256_type),

src/InternPool.zig

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4589,27 +4589,35 @@ pub const Index = enum(u32) {
45894589
vector_8_i8_type,
45904590
vector_16_i8_type,
45914591
vector_32_i8_type,
4592+
vector_64_i8_type,
45924593
vector_1_u8_type,
45934594
vector_2_u8_type,
45944595
vector_4_u8_type,
45954596
vector_8_u8_type,
45964597
vector_16_u8_type,
45974598
vector_32_u8_type,
45984599
vector_64_u8_type,
4600+
vector_2_i16_type,
45994601
vector_4_i16_type,
46004602
vector_8_i16_type,
46014603
vector_16_i16_type,
4604+
vector_32_i16_type,
46024605
vector_4_u16_type,
46034606
vector_8_u16_type,
46044607
vector_16_u16_type,
4608+
vector_32_u16_type,
46054609
vector_4_i32_type,
46064610
vector_8_i32_type,
4611+
vector_16_i32_type,
46074612
vector_4_u32_type,
46084613
vector_8_u32_type,
4614+
vector_16_u32_type,
46094615
vector_2_i64_type,
46104616
vector_4_i64_type,
4617+
vector_8_i64_type,
46114618
vector_2_u64_type,
46124619
vector_4_u64_type,
4620+
vector_8_u64_type,
46134621
vector_1_u128_type,
46144622
vector_2_u128_type,
46154623
vector_1_u256_type,
@@ -4954,7 +4962,7 @@ pub const Index = enum(u32) {
49544962
}
49554963
};
49564964

4957-
pub const static_keys = [_]Key{
4965+
pub const static_keys: [static_len]Key = .{
49584966
.{ .int_type = .{
49594967
.signedness = .unsigned,
49604968
.bits = 0,
@@ -5126,6 +5134,8 @@ pub const static_keys = [_]Key{
51265134
.{ .vector_type = .{ .len = 16, .child = .i8_type } },
51275135
// @Vector(32, i8)
51285136
.{ .vector_type = .{ .len = 32, .child = .i8_type } },
5137+
// @Vector(64, i8)
5138+
.{ .vector_type = .{ .len = 64, .child = .i8_type } },
51295139
// @Vector(1, u8)
51305140
.{ .vector_type = .{ .len = 1, .child = .u8_type } },
51315141
// @Vector(2, u8)
@@ -5140,34 +5150,48 @@ pub const static_keys = [_]Key{
51405150
.{ .vector_type = .{ .len = 32, .child = .u8_type } },
51415151
// @Vector(64, u8)
51425152
.{ .vector_type = .{ .len = 64, .child = .u8_type } },
5153+
// @Vector(2, i16)
5154+
.{ .vector_type = .{ .len = 2, .child = .i16_type } },
51435155
// @Vector(4, i16)
51445156
.{ .vector_type = .{ .len = 4, .child = .i16_type } },
51455157
// @Vector(8, i16)
51465158
.{ .vector_type = .{ .len = 8, .child = .i16_type } },
51475159
// @Vector(16, i16)
51485160
.{ .vector_type = .{ .len = 16, .child = .i16_type } },
5161+
// @Vector(32, i16)
5162+
.{ .vector_type = .{ .len = 32, .child = .i16_type } },
51495163
// @Vector(4, u16)
51505164
.{ .vector_type = .{ .len = 4, .child = .u16_type } },
51515165
// @Vector(8, u16)
51525166
.{ .vector_type = .{ .len = 8, .child = .u16_type } },
51535167
// @Vector(16, u16)
51545168
.{ .vector_type = .{ .len = 16, .child = .u16_type } },
5169+
// @Vector(32, u16)
5170+
.{ .vector_type = .{ .len = 32, .child = .u16_type } },
51555171
// @Vector(4, i32)
51565172
.{ .vector_type = .{ .len = 4, .child = .i32_type } },
51575173
// @Vector(8, i32)
51585174
.{ .vector_type = .{ .len = 8, .child = .i32_type } },
5175+
// @Vector(16, i32)
5176+
.{ .vector_type = .{ .len = 16, .child = .i32_type } },
51595177
// @Vector(4, u32)
51605178
.{ .vector_type = .{ .len = 4, .child = .u32_type } },
51615179
// @Vector(8, u32)
51625180
.{ .vector_type = .{ .len = 8, .child = .u32_type } },
5181+
// @Vector(16, u32)
5182+
.{ .vector_type = .{ .len = 16, .child = .u32_type } },
51635183
// @Vector(2, i64)
51645184
.{ .vector_type = .{ .len = 2, .child = .i64_type } },
51655185
// @Vector(4, i64)
51665186
.{ .vector_type = .{ .len = 4, .child = .i64_type } },
5187+
// @Vector(8, i64)
5188+
.{ .vector_type = .{ .len = 8, .child = .i64_type } },
51675189
// @Vector(2, u64)
51685190
.{ .vector_type = .{ .len = 2, .child = .u64_type } },
5169-
// @Vector(8, u64)
5191+
// @Vector(4, u64)
51705192
.{ .vector_type = .{ .len = 4, .child = .u64_type } },
5193+
// @Vector(8, u64)
5194+
.{ .vector_type = .{ .len = 8, .child = .u64_type } },
51715195
// @Vector(1, u128)
51725196
.{ .vector_type = .{ .len = 1, .child = .u128_type } },
51735197
// @Vector(2, u128)
@@ -5273,10 +5297,6 @@ pub const static_keys = [_]Key{
52735297
/// assert below to break an unfortunate and arguably incorrect dependency loop
52745298
/// when compiling.
52755299
pub const static_len = Zir.Inst.Index.static_len;
5276-
comptime {
5277-
//@compileLog(static_keys.len);
5278-
assert(static_len == static_keys.len);
5279-
}
52805300

52815301
pub const Tag = enum(u8) {
52825302
/// This special tag represents a value which was removed from this pool via
@@ -11833,27 +11853,35 @@ pub fn typeOf(ip: *const InternPool, index: Index) Index {
1183311853
.vector_8_i8_type,
1183411854
.vector_16_i8_type,
1183511855
.vector_32_i8_type,
11856+
.vector_64_i8_type,
1183611857
.vector_1_u8_type,
1183711858
.vector_2_u8_type,
1183811859
.vector_4_u8_type,
1183911860
.vector_8_u8_type,
1184011861
.vector_16_u8_type,
1184111862
.vector_32_u8_type,
1184211863
.vector_64_u8_type,
11864+
.vector_2_i16_type,
1184311865
.vector_4_i16_type,
1184411866
.vector_8_i16_type,
1184511867
.vector_16_i16_type,
11868+
.vector_32_i16_type,
1184611869
.vector_4_u16_type,
1184711870
.vector_8_u16_type,
1184811871
.vector_16_u16_type,
11872+
.vector_32_u16_type,
1184911873
.vector_4_i32_type,
1185011874
.vector_8_i32_type,
11875+
.vector_16_i32_type,
1185111876
.vector_4_u32_type,
1185211877
.vector_8_u32_type,
11878+
.vector_16_u32_type,
1185311879
.vector_2_i64_type,
1185411880
.vector_4_i64_type,
11881+
.vector_8_i64_type,
1185511882
.vector_2_u64_type,
1185611883
.vector_4_u64_type,
11884+
.vector_8_u64_type,
1185711885
.vector_1_u128_type,
1185811886
.vector_2_u128_type,
1185911887
.vector_1_u256_type,
@@ -12165,27 +12193,35 @@ pub fn zigTypeTag(ip: *const InternPool, index: Index) std.builtin.TypeId {
1216512193
.vector_8_i8_type,
1216612194
.vector_16_i8_type,
1216712195
.vector_32_i8_type,
12196+
.vector_64_i8_type,
1216812197
.vector_1_u8_type,
1216912198
.vector_2_u8_type,
1217012199
.vector_4_u8_type,
1217112200
.vector_8_u8_type,
1217212201
.vector_16_u8_type,
1217312202
.vector_32_u8_type,
1217412203
.vector_64_u8_type,
12204+
.vector_2_i16_type,
1217512205
.vector_4_i16_type,
1217612206
.vector_8_i16_type,
1217712207
.vector_16_i16_type,
12208+
.vector_32_i16_type,
1217812209
.vector_4_u16_type,
1217912210
.vector_8_u16_type,
1218012211
.vector_16_u16_type,
12212+
.vector_32_u16_type,
1218112213
.vector_4_i32_type,
1218212214
.vector_8_i32_type,
12215+
.vector_16_i32_type,
1218312216
.vector_4_u32_type,
1218412217
.vector_8_u32_type,
12218+
.vector_16_u32_type,
1218512219
.vector_2_i64_type,
1218612220
.vector_4_i64_type,
12221+
.vector_8_i64_type,
1218712222
.vector_2_u64_type,
1218812223
.vector_4_u64_type,
12224+
.vector_8_u64_type,
1218912225
.vector_1_u128_type,
1219012226
.vector_2_u128_type,
1219112227
.vector_1_u256_type,

src/Sema.zig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36545,27 +36545,35 @@ pub fn typeHasOnePossibleValue(sema: *Sema, ty: Type) CompileError!?Value {
3654536545
.vector_8_i8_type,
3654636546
.vector_16_i8_type,
3654736547
.vector_32_i8_type,
36548+
.vector_64_i8_type,
3654836549
.vector_1_u8_type,
3654936550
.vector_2_u8_type,
3655036551
.vector_4_u8_type,
3655136552
.vector_8_u8_type,
3655236553
.vector_16_u8_type,
3655336554
.vector_32_u8_type,
3655436555
.vector_64_u8_type,
36556+
.vector_2_i16_type,
3655536557
.vector_4_i16_type,
3655636558
.vector_8_i16_type,
3655736559
.vector_16_i16_type,
36560+
.vector_32_i16_type,
3655836561
.vector_4_u16_type,
3655936562
.vector_8_u16_type,
3656036563
.vector_16_u16_type,
36564+
.vector_32_u16_type,
3656136565
.vector_4_i32_type,
3656236566
.vector_8_i32_type,
36567+
.vector_16_i32_type,
3656336568
.vector_4_u32_type,
3656436569
.vector_8_u32_type,
36570+
.vector_16_u32_type,
3656536571
.vector_2_i64_type,
3656636572
.vector_4_i64_type,
36573+
.vector_8_i64_type,
3656736574
.vector_2_u64_type,
3656836575
.vector_4_u64_type,
36576+
.vector_8_u64_type,
3656936577
.vector_1_u128_type,
3657036578
.vector_2_u128_type,
3657136579
.vector_1_u256_type,

src/Type.zig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4110,27 +4110,35 @@ pub const slice_const_u8_sentinel_0: Type = .{ .ip_index = .slice_const_u8_senti
41104110
pub const vector_8_i8: Type = .{ .ip_index = .vector_8_i8_type };
41114111
pub const vector_16_i8: Type = .{ .ip_index = .vector_16_i8_type };
41124112
pub const vector_32_i8: Type = .{ .ip_index = .vector_32_i8_type };
4113+
pub const vector_64_i8: Type = .{ .ip_index = .vector_64_i8_type };
41134114
pub const vector_1_u8: Type = .{ .ip_index = .vector_1_u8_type };
41144115
pub const vector_2_u8: Type = .{ .ip_index = .vector_2_u8_type };
41154116
pub const vector_4_u8: Type = .{ .ip_index = .vector_4_u8_type };
41164117
pub const vector_8_u8: Type = .{ .ip_index = .vector_8_u8_type };
41174118
pub const vector_16_u8: Type = .{ .ip_index = .vector_16_u8_type };
41184119
pub const vector_32_u8: Type = .{ .ip_index = .vector_32_u8_type };
41194120
pub const vector_64_u8: Type = .{ .ip_index = .vector_64_u8_type };
4121+
pub const vector_2_i16: Type = .{ .ip_index = .vector_2_i16_type };
41204122
pub const vector_4_i16: Type = .{ .ip_index = .vector_4_i16_type };
41214123
pub const vector_8_i16: Type = .{ .ip_index = .vector_8_i16_type };
41224124
pub const vector_16_i16: Type = .{ .ip_index = .vector_16_i16_type };
4125+
pub const vector_32_i16: Type = .{ .ip_index = .vector_32_i16_type };
41234126
pub const vector_4_u16: Type = .{ .ip_index = .vector_4_u16_type };
41244127
pub const vector_8_u16: Type = .{ .ip_index = .vector_8_u16_type };
41254128
pub const vector_16_u16: Type = .{ .ip_index = .vector_16_u16_type };
4129+
pub const vector_32_u16: Type = .{ .ip_index = .vector_32_u16_type };
41264130
pub const vector_4_i32: Type = .{ .ip_index = .vector_4_i32_type };
41274131
pub const vector_8_i32: Type = .{ .ip_index = .vector_8_i32_type };
4132+
pub const vector_16_i32: Type = .{ .ip_index = .vector_16_i32_type };
41284133
pub const vector_4_u32: Type = .{ .ip_index = .vector_4_u32_type };
41294134
pub const vector_8_u32: Type = .{ .ip_index = .vector_8_u32_type };
4135+
pub const vector_16_u32: Type = .{ .ip_index = .vector_16_u32_type };
41304136
pub const vector_2_i64: Type = .{ .ip_index = .vector_2_i64_type };
41314137
pub const vector_4_i64: Type = .{ .ip_index = .vector_4_i64_type };
4138+
pub const vector_8_i64: Type = .{ .ip_index = .vector_8_i64_type };
41324139
pub const vector_2_u64: Type = .{ .ip_index = .vector_2_u64_type };
41334140
pub const vector_4_u64: Type = .{ .ip_index = .vector_4_u64_type };
4141+
pub const vector_8_u64: Type = .{ .ip_index = .vector_8_u64_type };
41344142
pub const vector_1_u128: Type = .{ .ip_index = .vector_1_u128_type };
41354143
pub const vector_2_u128: Type = .{ .ip_index = .vector_2_u128_type };
41364144
pub const vector_1_u256: Type = .{ .ip_index = .vector_1_u256_type };

0 commit comments

Comments
 (0)