authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-05-08 20:49:07-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-05-08 20:51:49-04:00
log9bbd71c9ab3915b8bd8619a319a0eb6de2e2d152
tree65ce7baa9c4fba0fbc25b72b81ce92faf9c5760a
parent3bd5c16f39a67889600a2102b716ccf7f9ba70f0
signaturelock-open Commit is signed but in an unrecognized format.

add --bundle-compiler-rt function to link options

and use it when building libuserland.a The self-hosted part of stage1 relies on zig's compiler-rt, and so we include it in libuserland.a. This should potentially be the default, but for now it's behind a linker option. self-hosted translate-c: small progress on translating functions.

8 files changed, 250 insertions(+), 216 deletions(-)

build.zig+1
......@@ -389,6 +389,7 @@ fn addLibUserlandStep(b: *Builder) void {
389389 else
390390 b.addStaticLibrary("userland", "src-self-hosted/stage1.zig");
391391 artifact.disable_gen_h = true;
392 artifact.bundle_compiler_rt = true;
392393 artifact.setTarget(builtin.arch, builtin.os, builtin.abi);
393394 artifact.linkSystemLibrary("c");
394395 const libuserland_step = b.step("libuserland", "Build the userland compiler library for use in stage1");
src-self-hosted/translate_c.zig+30-8
......@@ -13,14 +13,21 @@ pub const Mode = enum {
1313
1414pub const ClangErrMsg = Stage2ErrorMsg;
1515
16pub const Error = error {
17 OutOfMemory,
18};
16pub const Error = error{OutOfMemory};
1917
2018const Context = struct {
2119 tree: *ast.Tree,
2220 source_buffer: *std.Buffer,
2321 err: Error,
22
23 fn a(c: *Context) *std.mem.Allocator {
24 return &c.tree.arena_allocator.allocator;
25 }
26
27 /// Convert a null-terminated C string to a slice allocated in the arena
28 fn str(c: *Context, s: [*]const u8) ![]u8 {
29 return std.mem.dupe(c.a(), u8, std.mem.toSliceConst(u8, s));
30 }
2431};
2532
2633pub fn translate(
......@@ -60,12 +67,13 @@ pub fn translate(
6067 tree.* = ast.Tree{
6168 .source = undefined, // need to use Buffer.toOwnedSlice later
6269 .root_node = root_node,
63 .arena_allocator = tree_arena,
70 .arena_allocator = undefined,
6471 .tokens = ast.Tree.TokenList.init(arena),
6572 .errors = ast.Tree.ErrorList.init(arena),
6673 };
74 tree.arena_allocator = tree_arena;
6775
68 var source_buffer = try std.Buffer.initSize(arena, 0);
76 var source_buffer = try std.Buffer.initSize(&tree.arena_allocator.allocator, 0);
6977
7078 var context = Context{
7179 .tree = tree,
......@@ -94,7 +102,7 @@ extern fn declVisitorC(context: ?*c_void, decl: *const ZigClangDecl) bool {
94102fn declVisitor(c: *Context, decl: *const ZigClangDecl) Error!void {
95103 switch (ZigClangDecl_getKind(decl)) {
96104 .Function => {
97 try appendToken(c, .LineComment, "// TODO translate function decl");
105 return visitFnDecl(c, @ptrCast(*const ZigClangFunctionDecl, decl));
98106 },
99107 .Typedef => {
100108 try appendToken(c, .LineComment, "// TODO translate typedef");
......@@ -115,11 +123,25 @@ fn declVisitor(c: *Context, decl: *const ZigClangDecl) Error!void {
115123 }
116124}
117125
118fn appendToken(c: *Context, token_id: Token.Id, src_text: []const u8) !void {
126fn visitFnDecl(c: *Context, fn_decl: *const ZigClangFunctionDecl) Error!void {
127 const fn_name = c.str(ZigClangDecl_getName_bytes_begin(@ptrCast(*const ZigClangDecl, fn_decl)));
128 try appendToken(c, .LineComment, "// TODO translate function '{}'", fn_name);
129}
130
131fn appendToken(c: *Context, token_id: Token.Id, comptime format: []const u8, args: ...) !void {
132 const S = struct {
133 fn callback(context: *Context, bytes: []const u8) Error!void {
134 return context.source_buffer.append(bytes);
135 }
136 };
119137 const start_index = c.source_buffer.len();
120 try c.source_buffer.append(src_text);
138 errdefer c.source_buffer.shrink(start_index);
139
140 try std.fmt.format(c, Error, S.callback, format, args);
121141 const end_index = c.source_buffer.len();
122142 const new_token = try c.tree.tokens.addOne();
143 errdefer c.tree.tokens.shrink(c.tree.tokens.len - 1);
144
123145 new_token.* = Token{
124146 .id = token_id,
125147 .start = start_index,
src/all_types.hpp+1
......@@ -1861,6 +1861,7 @@ struct CodeGen {
18611861 bool each_lib_rpath;
18621862 bool is_dummy_so;
18631863 bool disable_gen_h;
1864 bool bundle_compiler_rt;
18641865
18651866 Buf *mmacosx_version_min;
18661867 Buf *mios_version_min;
src/codegen.cpp+1
......@@ -9346,6 +9346,7 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) {
93469346 cache_bool(ch, g->linker_rdynamic);
93479347 cache_bool(ch, g->each_lib_rpath);
93489348 cache_bool(ch, g->disable_gen_h);
9349 cache_bool(ch, g->bundle_compiler_rt);
93499350 cache_bool(ch, want_valgrind_support(g));
93509351 cache_bool(ch, g->have_pic);
93519352 cache_bool(ch, g->have_dynamic_link);
src/link.cpp+15-13
......@@ -772,17 +772,15 @@ static const char *get_libc_crt_file(CodeGen *parent, const char *file) {
772772 }
773773}
774774
775static Buf *build_a_raw(CodeGen *parent_gen, const char *aname, Buf *full_path) {
775static Buf *build_a_raw(CodeGen *parent_gen, const char *aname, Buf *full_path, OutType child_out_type) {
776776 // The Mach-O LLD code is not well maintained, and trips an assertion
777777 // when we link compiler_rt and builtin as libraries rather than objects.
778778 // Here we workaround this by having compiler_rt and builtin be objects.
779779 // TODO write our own linker. https://github.com/ziglang/zig/issues/1535
780 OutType child_out_type = OutTypeLib;
781780 if (parent_gen->zig_target->os == OsMacOSX) {
782781 child_out_type = OutTypeObj;
783782 }
784783
785
786784 CodeGen *child_gen = create_child_codegen(parent_gen, full_path, child_out_type,
787785 parent_gen->libc);
788786 codegen_set_out_name(child_gen, buf_create_from_str(aname));
......@@ -804,14 +802,14 @@ static Buf *build_a(CodeGen *parent_gen, const char *aname) {
804802 Buf *full_path = buf_alloc();
805803 os_path_join(parent_gen->zig_std_special_dir, source_basename, full_path);
806804
807 return build_a_raw(parent_gen, aname, full_path);
805 return build_a_raw(parent_gen, aname, full_path, OutTypeLib);
808806}
809807
810static Buf *build_compiler_rt(CodeGen *parent_gen) {
808static Buf *build_compiler_rt(CodeGen *parent_gen, OutType child_out_type) {
811809 Buf *full_path = buf_alloc();
812810 os_path_join(parent_gen->zig_std_special_dir, buf_create_from_str("compiler_rt.zig"), full_path);
813811
814 return build_a_raw(parent_gen, "compiler_rt", full_path);
812 return build_a_raw(parent_gen, "compiler_rt", full_path, child_out_type);
815813}
816814
817815static const char *get_darwin_arch_string(const ZigTarget *t) {
......@@ -1006,7 +1004,7 @@ static void construct_linker_job_elf(LinkJob *lj) {
10061004 lj->args.append(buf_ptr(builtin_a_path));
10071005 }
10081006
1009 Buf *compiler_rt_o_path = build_compiler_rt(g);
1007 Buf *compiler_rt_o_path = build_compiler_rt(g, OutTypeLib);
10101008 lj->args.append(buf_ptr(compiler_rt_o_path));
10111009 }
10121010
......@@ -1117,7 +1115,7 @@ static void construct_linker_job_wasm(LinkJob *lj) {
11171115 lj->args.append(buf_ptr(builtin_a_path));
11181116 }
11191117
1120 Buf *compiler_rt_o_path = build_compiler_rt(g);
1118 Buf *compiler_rt_o_path = build_compiler_rt(g, OutTypeLib);
11211119 lj->args.append(buf_ptr(compiler_rt_o_path));
11221120 }
11231121}
......@@ -1361,7 +1359,7 @@ static void construct_linker_job_coff(LinkJob *lj) {
13611359 }
13621360
13631361 // msvc compiler_rt is missing some stuff, so we still build it and rely on weak linkage
1364 Buf *compiler_rt_o_path = build_compiler_rt(g);
1362 Buf *compiler_rt_o_path = build_compiler_rt(g, OutTypeLib);
13651363 lj->args.append(buf_ptr(compiler_rt_o_path));
13661364 }
13671365
......@@ -1604,7 +1602,7 @@ static void construct_linker_job_macho(LinkJob *lj) {
16041602
16051603 // compiler_rt on darwin is missing some stuff, so we still build it and rely on LinkOnce
16061604 if (g->out_type == OutTypeExe || is_dyn_lib) {
1607 Buf *compiler_rt_o_path = build_compiler_rt(g);
1605 Buf *compiler_rt_o_path = build_compiler_rt(g, OutTypeLib);
16081606 lj->args.append(buf_ptr(compiler_rt_o_path));
16091607 }
16101608
......@@ -1681,14 +1679,18 @@ void codegen_link(CodeGen *g) {
16811679 if (g->out_type == OutTypeLib && !g->is_dynamic) {
16821680 ZigList<const char *> file_names = {};
16831681 for (size_t i = 0; i < g->link_objects.length; i += 1) {
1684 file_names.append((const char *)buf_ptr(g->link_objects.at(i)));
1682 file_names.append(buf_ptr(g->link_objects.at(i)));
1683 }
1684 if (g->bundle_compiler_rt) {
1685 Buf *compiler_rt_o_path = build_compiler_rt(g, OutTypeObj);
1686 file_names.append(buf_ptr(compiler_rt_o_path));
16851687 }
16861688 ZigLLVM_OSType os_type = get_llvm_os_type(g->zig_target->os);
16871689 codegen_add_time_event(g, "LLVM Link");
16881690 if (g->verbose_link) {
16891691 fprintf(stderr, "ar rcs %s", buf_ptr(&g->output_file_path));
1690 for (size_t i = 0; i < g->link_objects.length; i += 1) {
1691 fprintf(stderr, " %s", (const char *)buf_ptr(g->link_objects.at(i)));
1692 for (size_t i = 0; i < file_names.length; i += 1) {
1693 fprintf(stderr, " %s", file_names.at(i));
16921694 }
16931695 fprintf(stderr, "\n");
16941696 }
src/main.cpp+5
......@@ -86,6 +86,7 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) {
8686 " --override-std-dir [arg] use an alternate Zig standard library\n"
8787 "\n"
8888 "Link Options:\n"
89 " --bundle-compiler-rt [path] for static libraries, include compiler-rt symbols\n"
8990 " --dynamic-linker [path] set the path to ld.so\n"
9091 " --each-lib-rpath add rpath for each used dynamic library\n"
9192 " --library [lib] link against lib\n"
......@@ -442,6 +443,7 @@ int main(int argc, char **argv) {
442443 TargetSubsystem subsystem = TargetSubsystemAuto;
443444 bool want_single_threaded = false;
444445 bool disable_gen_h = false;
446 bool bundle_compiler_rt = false;
445447 Buf *override_std_dir = nullptr;
446448 Buf *override_lib_dir = nullptr;
447449 Buf *main_pkg_path = nullptr;
......@@ -652,6 +654,8 @@ int main(int argc, char **argv) {
652654 want_single_threaded = true;
653655 } else if (strcmp(arg, "--disable-gen-h") == 0) {
654656 disable_gen_h = true;
657 } else if (strcmp(arg, "--bundle-compiler-rt") == 0) {
658 bundle_compiler_rt = true;
655659 } else if (strcmp(arg, "--test-cmd-bin") == 0) {
656660 test_exec_args.append(nullptr);
657661 } else if (arg[1] == 'L' && arg[2] != 0) {
......@@ -1070,6 +1074,7 @@ int main(int argc, char **argv) {
10701074 g->verbose_cc = verbose_cc;
10711075 g->output_dir = output_dir;
10721076 g->disable_gen_h = disable_gen_h;
1077 g->bundle_compiler_rt = bundle_compiler_rt;
10731078 codegen_set_errmsg_color(g, color);
10741079 g->system_linker_hack = system_linker_hack;
10751080
std/build.zig+5
......@@ -941,6 +941,7 @@ pub const LibExeObjStep = struct {
941941 verbose_link: bool,
942942 verbose_cc: bool,
943943 disable_gen_h: bool,
944 bundle_compiler_rt: bool,
944945 c_std: Builder.CStd,
945946 override_std_dir: ?[]const u8,
946947 override_lib_dir: ?[]const u8,
......@@ -1050,6 +1051,7 @@ pub const LibExeObjStep = struct {
10501051 .name_prefix = "",
10511052 .filter = null,
10521053 .disable_gen_h = false,
1054 .bundle_compiler_rt = false,
10531055 .output_dir = null,
10541056 .need_system_paths = false,
10551057 .single_threaded = false,
......@@ -1452,6 +1454,9 @@ pub const LibExeObjStep = struct {
14521454 if (self.disable_gen_h) {
14531455 try zig_args.append("--disable-gen-h");
14541456 }
1457 if (self.bundle_compiler_rt) {
1458 try zig_args.append("--bundle-compiler-rt");
1459 }
14551460
14561461 switch (self.target) {
14571462 Target.Native => {},
std/special/compiler_rt.zig+192-195
......@@ -1,15 +1,13 @@
11const builtin = @import("builtin");
22const is_test = builtin.is_test;
33
4const stack_probe = @import("compiler_rt/stack_probe.zig");
5
64comptime {
75 const linkage = if (is_test) builtin.GlobalLinkage.Internal else builtin.GlobalLinkage.Weak;
86 const strong_linkage = if (is_test) builtin.GlobalLinkage.Internal else builtin.GlobalLinkage.Strong;
97
108 switch (builtin.arch) {
119 .i386, .x86_64 => @export("__zig_probe_stack", @import("compiler_rt/stack_probe.zig").zig_probe_stack, linkage),
12 else => { }
10 else => {},
1311 }
1412
1513 @export("__lesf2", @import("compiler_rt/comparesf2.zig").__lesf2, linkage);
......@@ -499,7 +497,6 @@ nakedcc fn __aeabi_memcmp() noreturn {
499497 unreachable;
500498}
501499
502
503500extern fn __divmodsi4(a: i32, b: i32, rem: *i32) i32 {
504501 @setRuntimeSafety(is_test);
505502
......@@ -1272,17 +1269,17 @@ fn test_one_udivsi3(a: u32, b: u32, expected_q: u32) void {
12721269
12731270test "test_divsi3" {
12741271 const cases = [][3]i32{
1275 []i32{ 0, 1, 0},
1276 []i32{ 0, -1, 0},
1277 []i32{ 2, 1, 2},
1278 []i32{ 2, -1, -2},
1279 []i32{-2, 1, -2},
1280 []i32{-2, -1, 2},
1281
1282 []i32{@bitCast(i32, u32(0x80000000)), 1, @bitCast(i32, u32(0x80000000))},
1283 []i32{@bitCast(i32, u32(0x80000000)), -1, @bitCast(i32, u32(0x80000000))},
1284 []i32{@bitCast(i32, u32(0x80000000)), -2, 0x40000000},
1285 []i32{@bitCast(i32, u32(0x80000000)), 2, @bitCast(i32, u32(0xC0000000))},
1272 []i32{ 0, 1, 0 },
1273 []i32{ 0, -1, 0 },
1274 []i32{ 2, 1, 2 },
1275 []i32{ 2, -1, -2 },
1276 []i32{ -2, 1, -2 },
1277 []i32{ -2, -1, 2 },
1278
1279 []i32{ @bitCast(i32, u32(0x80000000)), 1, @bitCast(i32, u32(0x80000000)) },
1280 []i32{ @bitCast(i32, u32(0x80000000)), -1, @bitCast(i32, u32(0x80000000)) },
1281 []i32{ @bitCast(i32, u32(0x80000000)), -2, 0x40000000 },
1282 []i32{ @bitCast(i32, u32(0x80000000)), 2, @bitCast(i32, u32(0xC0000000)) },
12861283 };
12871284
12881285 for (cases) |case| {
......@@ -1297,19 +1294,19 @@ fn test_one_divsi3(a: i32, b: i32, expected_q: i32) void {
12971294
12981295test "test_divmodsi4" {
12991296 const cases = [][4]i32{
1300 []i32{ 0, 1, 0, 0},
1301 []i32{ 0, -1, 0, 0},
1302 []i32{ 2, 1, 2, 0},
1303 []i32{ 2, -1, -2, 0},
1304 []i32{-2, 1, -2, 0},
1305 []i32{-2, -1, 2, 0},
1306 []i32{ 7, 5, 1, 2},
1307 []i32{-7, 5, -1, -2},
1308 []i32{19, 5, 3, 4},
1309 []i32{19, -5, -3, 4},
1310
1311 []i32{@bitCast(i32, u32(0x80000000)), 8, @bitCast(i32, u32(0xf0000000)), 0},
1312 []i32{@bitCast(i32, u32(0x80000007)), 8, @bitCast(i32, u32(0xf0000001)), -1},
1297 []i32{ 0, 1, 0, 0 },
1298 []i32{ 0, -1, 0, 0 },
1299 []i32{ 2, 1, 2, 0 },
1300 []i32{ 2, -1, -2, 0 },
1301 []i32{ -2, 1, -2, 0 },
1302 []i32{ -2, -1, 2, 0 },
1303 []i32{ 7, 5, 1, 2 },
1304 []i32{ -7, 5, -1, -2 },
1305 []i32{ 19, 5, 3, 4 },
1306 []i32{ 19, -5, -3, 4 },
1307
1308 []i32{ @bitCast(i32, u32(0x80000000)), 8, @bitCast(i32, u32(0xf0000000)), 0 },
1309 []i32{ @bitCast(i32, u32(0x80000007)), 8, @bitCast(i32, u32(0xf0000001)), -1 },
13131310 };
13141311
13151312 for (cases) |case| {
......@@ -1325,17 +1322,17 @@ fn test_one_divmodsi4(a: i32, b: i32, expected_q: i32, expected_r: i32) void {
13251322
13261323test "test_divdi3" {
13271324 const cases = [][3]i64{
1328 []i64{ 0, 1, 0},
1329 []i64{ 0, -1, 0},
1330 []i64{ 2, 1, 2},
1331 []i64{ 2, -1, -2},
1332 []i64{-2, 1, -2},
1333 []i64{-2, -1, 2},
1334
1335 []i64{@bitCast(i64, u64(0x8000000000000000)), 1, @bitCast(i64, u64(0x8000000000000000))},
1336 []i64{@bitCast(i64, u64(0x8000000000000000)), -1, @bitCast(i64, u64(0x8000000000000000))},
1337 []i64{@bitCast(i64, u64(0x8000000000000000)), -2, 0x4000000000000000},
1338 []i64{@bitCast(i64, u64(0x8000000000000000)), 2, @bitCast(i64, u64(0xC000000000000000))},
1325 []i64{ 0, 1, 0 },
1326 []i64{ 0, -1, 0 },
1327 []i64{ 2, 1, 2 },
1328 []i64{ 2, -1, -2 },
1329 []i64{ -2, 1, -2 },
1330 []i64{ -2, -1, 2 },
1331
1332 []i64{ @bitCast(i64, u64(0x8000000000000000)), 1, @bitCast(i64, u64(0x8000000000000000)) },
1333 []i64{ @bitCast(i64, u64(0x8000000000000000)), -1, @bitCast(i64, u64(0x8000000000000000)) },
1334 []i64{ @bitCast(i64, u64(0x8000000000000000)), -2, 0x4000000000000000 },
1335 []i64{ @bitCast(i64, u64(0x8000000000000000)), 2, @bitCast(i64, u64(0xC000000000000000)) },
13391336 };
13401337
13411338 for (cases) |case| {
......@@ -1350,19 +1347,19 @@ fn test_one_divdi3(a: i64, b: i64, expected_q: i64) void {
13501347
13511348test "test_moddi3" {
13521349 const cases = [][3]i64{
1353 []i64{0, 1, 0},
1354 []i64{0, -1, 0},
1355 []i64{5, 3, 2},
1356 []i64{5, -3, 2},
1357 []i64{-5, 3, -2},
1358 []i64{-5, -3, -2},
1359
1360 []i64{@bitCast(i64, @intCast(u64, 0x8000000000000000)), 1, 0},
1361 []i64{@bitCast(i64, @intCast(u64, 0x8000000000000000)), -1, 0},
1362 []i64{@bitCast(i64, @intCast(u64, 0x8000000000000000)), 2, 0},
1363 []i64{@bitCast(i64, @intCast(u64, 0x8000000000000000)), -2, 0},
1364 []i64{@bitCast(i64, @intCast(u64, 0x8000000000000000)), 3, -2},
1365 []i64{@bitCast(i64, @intCast(u64, 0x8000000000000000)), -3, -2},
1350 []i64{ 0, 1, 0 },
1351 []i64{ 0, -1, 0 },
1352 []i64{ 5, 3, 2 },
1353 []i64{ 5, -3, 2 },
1354 []i64{ -5, 3, -2 },
1355 []i64{ -5, -3, -2 },
1356
1357 []i64{ @bitCast(i64, @intCast(u64, 0x8000000000000000)), 1, 0 },
1358 []i64{ @bitCast(i64, @intCast(u64, 0x8000000000000000)), -1, 0 },
1359 []i64{ @bitCast(i64, @intCast(u64, 0x8000000000000000)), 2, 0 },
1360 []i64{ @bitCast(i64, @intCast(u64, 0x8000000000000000)), -2, 0 },
1361 []i64{ @bitCast(i64, @intCast(u64, 0x8000000000000000)), 3, -2 },
1362 []i64{ @bitCast(i64, @intCast(u64, 0x8000000000000000)), -3, -2 },
13661363 };
13671364
13681365 for (cases) |case| {
......@@ -1377,17 +1374,17 @@ fn test_one_moddi3(a: i64, b: i64, expected_r: i64) void {
13771374
13781375test "test_modsi3" {
13791376 const cases = [][3]i32{
1380 []i32{0, 1, 0},
1381 []i32{0, -1, 0},
1382 []i32{5, 3, 2},
1383 []i32{5, -3, 2},
1384 []i32{-5, 3, -2},
1385 []i32{-5, -3, -2},
1386 []i32{@bitCast(i32, @intCast(u32, 0x80000000)), 1, 0x0},
1387 []i32{@bitCast(i32, @intCast(u32, 0x80000000)), 2, 0x0},
1388 []i32{@bitCast(i32, @intCast(u32, 0x80000000)), -2, 0x0},
1389 []i32{@bitCast(i32, @intCast(u32, 0x80000000)), 3, -2},
1390 []i32{@bitCast(i32, @intCast(u32, 0x80000000)), -3, -2},
1377 []i32{ 0, 1, 0 },
1378 []i32{ 0, -1, 0 },
1379 []i32{ 5, 3, 2 },
1380 []i32{ 5, -3, 2 },
1381 []i32{ -5, 3, -2 },
1382 []i32{ -5, -3, -2 },
1383 []i32{ @bitCast(i32, @intCast(u32, 0x80000000)), 1, 0x0 },
1384 []i32{ @bitCast(i32, @intCast(u32, 0x80000000)), 2, 0x0 },
1385 []i32{ @bitCast(i32, @intCast(u32, 0x80000000)), -2, 0x0 },
1386 []i32{ @bitCast(i32, @intCast(u32, 0x80000000)), 3, -2 },
1387 []i32{ @bitCast(i32, @intCast(u32, 0x80000000)), -3, -2 },
13911388 };
13921389
13931390 for (cases) |case| {
......@@ -1402,138 +1399,138 @@ fn test_one_modsi3(a: i32, b: i32, expected_r: i32) void {
14021399
14031400test "test_umodsi3" {
14041401 const cases = [][3]u32{
1405 []u32{0x00000000, 0x00000001, 0x00000000},
1406 []u32{0x00000000, 0x00000002, 0x00000000},
1407 []u32{0x00000000, 0x00000003, 0x00000000},
1408 []u32{0x00000000, 0x00000010, 0x00000000},
1409 []u32{0x00000000, 0x078644FA, 0x00000000},
1410 []u32{0x00000000, 0x0747AE14, 0x00000000},
1411 []u32{0x00000000, 0x7FFFFFFF, 0x00000000},
1412 []u32{0x00000000, 0x80000000, 0x00000000},
1413 []u32{0x00000000, 0xFFFFFFFD, 0x00000000},
1414 []u32{0x00000000, 0xFFFFFFFE, 0x00000000},
1415 []u32{0x00000000, 0xFFFFFFFF, 0x00000000},
1416 []u32{0x00000001, 0x00000001, 0x00000000},
1417 []u32{0x00000001, 0x00000002, 0x00000001},
1418 []u32{0x00000001, 0x00000003, 0x00000001},
1419 []u32{0x00000001, 0x00000010, 0x00000001},
1420 []u32{0x00000001, 0x078644FA, 0x00000001},
1421 []u32{0x00000001, 0x0747AE14, 0x00000001},
1422 []u32{0x00000001, 0x7FFFFFFF, 0x00000001},
1423 []u32{0x00000001, 0x80000000, 0x00000001},
1424 []u32{0x00000001, 0xFFFFFFFD, 0x00000001},
1425 []u32{0x00000001, 0xFFFFFFFE, 0x00000001},
1426 []u32{0x00000001, 0xFFFFFFFF, 0x00000001},
1427 []u32{0x00000002, 0x00000001, 0x00000000},
1428 []u32{0x00000002, 0x00000002, 0x00000000},
1429 []u32{0x00000002, 0x00000003, 0x00000002},
1430 []u32{0x00000002, 0x00000010, 0x00000002},
1431 []u32{0x00000002, 0x078644FA, 0x00000002},
1432 []u32{0x00000002, 0x0747AE14, 0x00000002},
1433 []u32{0x00000002, 0x7FFFFFFF, 0x00000002},
1434 []u32{0x00000002, 0x80000000, 0x00000002},
1435 []u32{0x00000002, 0xFFFFFFFD, 0x00000002},
1436 []u32{0x00000002, 0xFFFFFFFE, 0x00000002},
1437 []u32{0x00000002, 0xFFFFFFFF, 0x00000002},
1438 []u32{0x00000003, 0x00000001, 0x00000000},
1439 []u32{0x00000003, 0x00000002, 0x00000001},
1440 []u32{0x00000003, 0x00000003, 0x00000000},
1441 []u32{0x00000003, 0x00000010, 0x00000003},
1442 []u32{0x00000003, 0x078644FA, 0x00000003},
1443 []u32{0x00000003, 0x0747AE14, 0x00000003},
1444 []u32{0x00000003, 0x7FFFFFFF, 0x00000003},
1445 []u32{0x00000003, 0x80000000, 0x00000003},
1446 []u32{0x00000003, 0xFFFFFFFD, 0x00000003},
1447 []u32{0x00000003, 0xFFFFFFFE, 0x00000003},
1448 []u32{0x00000003, 0xFFFFFFFF, 0x00000003},
1449 []u32{0x00000010, 0x00000001, 0x00000000},
1450 []u32{0x00000010, 0x00000002, 0x00000000},
1451 []u32{0x00000010, 0x00000003, 0x00000001},
1452 []u32{0x00000010, 0x00000010, 0x00000000},
1453 []u32{0x00000010, 0x078644FA, 0x00000010},
1454 []u32{0x00000010, 0x0747AE14, 0x00000010},
1455 []u32{0x00000010, 0x7FFFFFFF, 0x00000010},
1456 []u32{0x00000010, 0x80000000, 0x00000010},
1457 []u32{0x00000010, 0xFFFFFFFD, 0x00000010},
1458 []u32{0x00000010, 0xFFFFFFFE, 0x00000010},
1459 []u32{0x00000010, 0xFFFFFFFF, 0x00000010},
1460 []u32{0x078644FA, 0x00000001, 0x00000000},
1461 []u32{0x078644FA, 0x00000002, 0x00000000},
1462 []u32{0x078644FA, 0x00000003, 0x00000000},
1463 []u32{0x078644FA, 0x00000010, 0x0000000A},
1464 []u32{0x078644FA, 0x078644FA, 0x00000000},
1465 []u32{0x078644FA, 0x0747AE14, 0x003E96E6},
1466 []u32{0x078644FA, 0x7FFFFFFF, 0x078644FA},
1467 []u32{0x078644FA, 0x80000000, 0x078644FA},
1468 []u32{0x078644FA, 0xFFFFFFFD, 0x078644FA},
1469 []u32{0x078644FA, 0xFFFFFFFE, 0x078644FA},
1470 []u32{0x078644FA, 0xFFFFFFFF, 0x078644FA},
1471 []u32{0x0747AE14, 0x00000001, 0x00000000},
1472 []u32{0x0747AE14, 0x00000002, 0x00000000},
1473 []u32{0x0747AE14, 0x00000003, 0x00000002},
1474 []u32{0x0747AE14, 0x00000010, 0x00000004},
1475 []u32{0x0747AE14, 0x078644FA, 0x0747AE14},
1476 []u32{0x0747AE14, 0x0747AE14, 0x00000000},
1477 []u32{0x0747AE14, 0x7FFFFFFF, 0x0747AE14},
1478 []u32{0x0747AE14, 0x80000000, 0x0747AE14},
1479 []u32{0x0747AE14, 0xFFFFFFFD, 0x0747AE14},
1480 []u32{0x0747AE14, 0xFFFFFFFE, 0x0747AE14},
1481 []u32{0x0747AE14, 0xFFFFFFFF, 0x0747AE14},
1482 []u32{0x7FFFFFFF, 0x00000001, 0x00000000},
1483 []u32{0x7FFFFFFF, 0x00000002, 0x00000001},
1484 []u32{0x7FFFFFFF, 0x00000003, 0x00000001},
1485 []u32{0x7FFFFFFF, 0x00000010, 0x0000000F},
1486 []u32{0x7FFFFFFF, 0x078644FA, 0x00156B65},
1487 []u32{0x7FFFFFFF, 0x0747AE14, 0x043D70AB},
1488 []u32{0x7FFFFFFF, 0x7FFFFFFF, 0x00000000},
1489 []u32{0x7FFFFFFF, 0x80000000, 0x7FFFFFFF},
1490 []u32{0x7FFFFFFF, 0xFFFFFFFD, 0x7FFFFFFF},
1491 []u32{0x7FFFFFFF, 0xFFFFFFFE, 0x7FFFFFFF},
1492 []u32{0x7FFFFFFF, 0xFFFFFFFF, 0x7FFFFFFF},
1493 []u32{0x80000000, 0x00000001, 0x00000000},
1494 []u32{0x80000000, 0x00000002, 0x00000000},
1495 []u32{0x80000000, 0x00000003, 0x00000002},
1496 []u32{0x80000000, 0x00000010, 0x00000000},
1497 []u32{0x80000000, 0x078644FA, 0x00156B66},
1498 []u32{0x80000000, 0x0747AE14, 0x043D70AC},
1499 []u32{0x80000000, 0x7FFFFFFF, 0x00000001},
1500 []u32{0x80000000, 0x80000000, 0x00000000},
1501 []u32{0x80000000, 0xFFFFFFFD, 0x80000000},
1502 []u32{0x80000000, 0xFFFFFFFE, 0x80000000},
1503 []u32{0x80000000, 0xFFFFFFFF, 0x80000000},
1504 []u32{0xFFFFFFFD, 0x00000001, 0x00000000},
1505 []u32{0xFFFFFFFD, 0x00000002, 0x00000001},
1506 []u32{0xFFFFFFFD, 0x00000003, 0x00000001},
1507 []u32{0xFFFFFFFD, 0x00000010, 0x0000000D},
1508 []u32{0xFFFFFFFD, 0x078644FA, 0x002AD6C9},
1509 []u32{0xFFFFFFFD, 0x0747AE14, 0x01333341},
1510 []u32{0xFFFFFFFD, 0x7FFFFFFF, 0x7FFFFFFE},
1511 []u32{0xFFFFFFFD, 0x80000000, 0x7FFFFFFD},
1512 []u32{0xFFFFFFFD, 0xFFFFFFFD, 0x00000000},
1513 []u32{0xFFFFFFFD, 0xFFFFFFFE, 0xFFFFFFFD},
1514 []u32{0xFFFFFFFD, 0xFFFFFFFF, 0xFFFFFFFD},
1515 []u32{0xFFFFFFFE, 0x00000001, 0x00000000},
1516 []u32{0xFFFFFFFE, 0x00000002, 0x00000000},
1517 []u32{0xFFFFFFFE, 0x00000003, 0x00000002},
1518 []u32{0xFFFFFFFE, 0x00000010, 0x0000000E},
1519 []u32{0xFFFFFFFE, 0x078644FA, 0x002AD6CA},
1520 []u32{0xFFFFFFFE, 0x0747AE14, 0x01333342},
1521 []u32{0xFFFFFFFE, 0x7FFFFFFF, 0x00000000},
1522 []u32{0xFFFFFFFE, 0x80000000, 0x7FFFFFFE},
1523 []u32{0xFFFFFFFE, 0xFFFFFFFD, 0x00000001},
1524 []u32{0xFFFFFFFE, 0xFFFFFFFE, 0x00000000},
1525 []u32{0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFE},
1526 []u32{0xFFFFFFFF, 0x00000001, 0x00000000},
1527 []u32{0xFFFFFFFF, 0x00000002, 0x00000001},
1528 []u32{0xFFFFFFFF, 0x00000003, 0x00000000},
1529 []u32{0xFFFFFFFF, 0x00000010, 0x0000000F},
1530 []u32{0xFFFFFFFF, 0x078644FA, 0x002AD6CB},
1531 []u32{0xFFFFFFFF, 0x0747AE14, 0x01333343},
1532 []u32{0xFFFFFFFF, 0x7FFFFFFF, 0x00000001},
1533 []u32{0xFFFFFFFF, 0x80000000, 0x7FFFFFFF},
1534 []u32{0xFFFFFFFF, 0xFFFFFFFD, 0x00000002},
1535 []u32{0xFFFFFFFF, 0xFFFFFFFE, 0x00000001},
1536 []u32{0xFFFFFFFF, 0xFFFFFFFF, 0x00000000}
1402 []u32{ 0x00000000, 0x00000001, 0x00000000 },
1403 []u32{ 0x00000000, 0x00000002, 0x00000000 },
1404 []u32{ 0x00000000, 0x00000003, 0x00000000 },
1405 []u32{ 0x00000000, 0x00000010, 0x00000000 },
1406 []u32{ 0x00000000, 0x078644FA, 0x00000000 },
1407 []u32{ 0x00000000, 0x0747AE14, 0x00000000 },
1408 []u32{ 0x00000000, 0x7FFFFFFF, 0x00000000 },
1409 []u32{ 0x00000000, 0x80000000, 0x00000000 },
1410 []u32{ 0x00000000, 0xFFFFFFFD, 0x00000000 },
1411 []u32{ 0x00000000, 0xFFFFFFFE, 0x00000000 },
1412 []u32{ 0x00000000, 0xFFFFFFFF, 0x00000000 },
1413 []u32{ 0x00000001, 0x00000001, 0x00000000 },
1414 []u32{ 0x00000001, 0x00000002, 0x00000001 },
1415 []u32{ 0x00000001, 0x00000003, 0x00000001 },
1416 []u32{ 0x00000001, 0x00000010, 0x00000001 },
1417 []u32{ 0x00000001, 0x078644FA, 0x00000001 },
1418 []u32{ 0x00000001, 0x0747AE14, 0x00000001 },
1419 []u32{ 0x00000001, 0x7FFFFFFF, 0x00000001 },
1420 []u32{ 0x00000001, 0x80000000, 0x00000001 },
1421 []u32{ 0x00000001, 0xFFFFFFFD, 0x00000001 },
1422 []u32{ 0x00000001, 0xFFFFFFFE, 0x00000001 },
1423 []u32{ 0x00000001, 0xFFFFFFFF, 0x00000001 },
1424 []u32{ 0x00000002, 0x00000001, 0x00000000 },
1425 []u32{ 0x00000002, 0x00000002, 0x00000000 },
1426 []u32{ 0x00000002, 0x00000003, 0x00000002 },
1427 []u32{ 0x00000002, 0x00000010, 0x00000002 },
1428 []u32{ 0x00000002, 0x078644FA, 0x00000002 },
1429 []u32{ 0x00000002, 0x0747AE14, 0x00000002 },
1430 []u32{ 0x00000002, 0x7FFFFFFF, 0x00000002 },
1431 []u32{ 0x00000002, 0x80000000, 0x00000002 },
1432 []u32{ 0x00000002, 0xFFFFFFFD, 0x00000002 },
1433 []u32{ 0x00000002, 0xFFFFFFFE, 0x00000002 },
1434 []u32{ 0x00000002, 0xFFFFFFFF, 0x00000002 },
1435 []u32{ 0x00000003, 0x00000001, 0x00000000 },
1436 []u32{ 0x00000003, 0x00000002, 0x00000001 },
1437 []u32{ 0x00000003, 0x00000003, 0x00000000 },
1438 []u32{ 0x00000003, 0x00000010, 0x00000003 },
1439 []u32{ 0x00000003, 0x078644FA, 0x00000003 },
1440 []u32{ 0x00000003, 0x0747AE14, 0x00000003 },
1441 []u32{ 0x00000003, 0x7FFFFFFF, 0x00000003 },
1442 []u32{ 0x00000003, 0x80000000, 0x00000003 },
1443 []u32{ 0x00000003, 0xFFFFFFFD, 0x00000003 },
1444 []u32{ 0x00000003, 0xFFFFFFFE, 0x00000003 },
1445 []u32{ 0x00000003, 0xFFFFFFFF, 0x00000003 },
1446 []u32{ 0x00000010, 0x00000001, 0x00000000 },
1447 []u32{ 0x00000010, 0x00000002, 0x00000000 },
1448 []u32{ 0x00000010, 0x00000003, 0x00000001 },
1449 []u32{ 0x00000010, 0x00000010, 0x00000000 },
1450 []u32{ 0x00000010, 0x078644FA, 0x00000010 },
1451 []u32{ 0x00000010, 0x0747AE14, 0x00000010 },
1452 []u32{ 0x00000010, 0x7FFFFFFF, 0x00000010 },
1453 []u32{ 0x00000010, 0x80000000, 0x00000010 },
1454 []u32{ 0x00000010, 0xFFFFFFFD, 0x00000010 },
1455 []u32{ 0x00000010, 0xFFFFFFFE, 0x00000010 },
1456 []u32{ 0x00000010, 0xFFFFFFFF, 0x00000010 },
1457 []u32{ 0x078644FA, 0x00000001, 0x00000000 },
1458 []u32{ 0x078644FA, 0x00000002, 0x00000000 },
1459 []u32{ 0x078644FA, 0x00000003, 0x00000000 },
1460 []u32{ 0x078644FA, 0x00000010, 0x0000000A },
1461 []u32{ 0x078644FA, 0x078644FA, 0x00000000 },
1462 []u32{ 0x078644FA, 0x0747AE14, 0x003E96E6 },
1463 []u32{ 0x078644FA, 0x7FFFFFFF, 0x078644FA },
1464 []u32{ 0x078644FA, 0x80000000, 0x078644FA },
1465 []u32{ 0x078644FA, 0xFFFFFFFD, 0x078644FA },
1466 []u32{ 0x078644FA, 0xFFFFFFFE, 0x078644FA },
1467 []u32{ 0x078644FA, 0xFFFFFFFF, 0x078644FA },
1468 []u32{ 0x0747AE14, 0x00000001, 0x00000000 },
1469 []u32{ 0x0747AE14, 0x00000002, 0x00000000 },
1470 []u32{ 0x0747AE14, 0x00000003, 0x00000002 },
1471 []u32{ 0x0747AE14, 0x00000010, 0x00000004 },
1472 []u32{ 0x0747AE14, 0x078644FA, 0x0747AE14 },
1473 []u32{ 0x0747AE14, 0x0747AE14, 0x00000000 },
1474 []u32{ 0x0747AE14, 0x7FFFFFFF, 0x0747AE14 },
1475 []u32{ 0x0747AE14, 0x80000000, 0x0747AE14 },
1476 []u32{ 0x0747AE14, 0xFFFFFFFD, 0x0747AE14 },
1477 []u32{ 0x0747AE14, 0xFFFFFFFE, 0x0747AE14 },
1478 []u32{ 0x0747AE14, 0xFFFFFFFF, 0x0747AE14 },
1479 []u32{ 0x7FFFFFFF, 0x00000001, 0x00000000 },
1480 []u32{ 0x7FFFFFFF, 0x00000002, 0x00000001 },
1481 []u32{ 0x7FFFFFFF, 0x00000003, 0x00000001 },
1482 []u32{ 0x7FFFFFFF, 0x00000010, 0x0000000F },
1483 []u32{ 0x7FFFFFFF, 0x078644FA, 0x00156B65 },
1484 []u32{ 0x7FFFFFFF, 0x0747AE14, 0x043D70AB },
1485 []u32{ 0x7FFFFFFF, 0x7FFFFFFF, 0x00000000 },
1486 []u32{ 0x7FFFFFFF, 0x80000000, 0x7FFFFFFF },
1487 []u32{ 0x7FFFFFFF, 0xFFFFFFFD, 0x7FFFFFFF },
1488 []u32{ 0x7FFFFFFF, 0xFFFFFFFE, 0x7FFFFFFF },
1489 []u32{ 0x7FFFFFFF, 0xFFFFFFFF, 0x7FFFFFFF },
1490 []u32{ 0x80000000, 0x00000001, 0x00000000 },
1491 []u32{ 0x80000000, 0x00000002, 0x00000000 },
1492 []u32{ 0x80000000, 0x00000003, 0x00000002 },
1493 []u32{ 0x80000000, 0x00000010, 0x00000000 },
1494 []u32{ 0x80000000, 0x078644FA, 0x00156B66 },
1495 []u32{ 0x80000000, 0x0747AE14, 0x043D70AC },
1496 []u32{ 0x80000000, 0x7FFFFFFF, 0x00000001 },
1497 []u32{ 0x80000000, 0x80000000, 0x00000000 },
1498 []u32{ 0x80000000, 0xFFFFFFFD, 0x80000000 },
1499 []u32{ 0x80000000, 0xFFFFFFFE, 0x80000000 },
1500 []u32{ 0x80000000, 0xFFFFFFFF, 0x80000000 },
1501 []u32{ 0xFFFFFFFD, 0x00000001, 0x00000000 },
1502 []u32{ 0xFFFFFFFD, 0x00000002, 0x00000001 },
1503 []u32{ 0xFFFFFFFD, 0x00000003, 0x00000001 },
1504 []u32{ 0xFFFFFFFD, 0x00000010, 0x0000000D },
1505 []u32{ 0xFFFFFFFD, 0x078644FA, 0x002AD6C9 },
1506 []u32{ 0xFFFFFFFD, 0x0747AE14, 0x01333341 },
1507 []u32{ 0xFFFFFFFD, 0x7FFFFFFF, 0x7FFFFFFE },
1508 []u32{ 0xFFFFFFFD, 0x80000000, 0x7FFFFFFD },
1509 []u32{ 0xFFFFFFFD, 0xFFFFFFFD, 0x00000000 },
1510 []u32{ 0xFFFFFFFD, 0xFFFFFFFE, 0xFFFFFFFD },
1511 []u32{ 0xFFFFFFFD, 0xFFFFFFFF, 0xFFFFFFFD },
1512 []u32{ 0xFFFFFFFE, 0x00000001, 0x00000000 },
1513 []u32{ 0xFFFFFFFE, 0x00000002, 0x00000000 },
1514 []u32{ 0xFFFFFFFE, 0x00000003, 0x00000002 },
1515 []u32{ 0xFFFFFFFE, 0x00000010, 0x0000000E },
1516 []u32{ 0xFFFFFFFE, 0x078644FA, 0x002AD6CA },
1517 []u32{ 0xFFFFFFFE, 0x0747AE14, 0x01333342 },
1518 []u32{ 0xFFFFFFFE, 0x7FFFFFFF, 0x00000000 },
1519 []u32{ 0xFFFFFFFE, 0x80000000, 0x7FFFFFFE },
1520 []u32{ 0xFFFFFFFE, 0xFFFFFFFD, 0x00000001 },
1521 []u32{ 0xFFFFFFFE, 0xFFFFFFFE, 0x00000000 },
1522 []u32{ 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFE },
1523 []u32{ 0xFFFFFFFF, 0x00000001, 0x00000000 },
1524 []u32{ 0xFFFFFFFF, 0x00000002, 0x00000001 },
1525 []u32{ 0xFFFFFFFF, 0x00000003, 0x00000000 },
1526 []u32{ 0xFFFFFFFF, 0x00000010, 0x0000000F },
1527 []u32{ 0xFFFFFFFF, 0x078644FA, 0x002AD6CB },
1528 []u32{ 0xFFFFFFFF, 0x0747AE14, 0x01333343 },
1529 []u32{ 0xFFFFFFFF, 0x7FFFFFFF, 0x00000001 },
1530 []u32{ 0xFFFFFFFF, 0x80000000, 0x7FFFFFFF },
1531 []u32{ 0xFFFFFFFF, 0xFFFFFFFD, 0x00000002 },
1532 []u32{ 0xFFFFFFFF, 0xFFFFFFFE, 0x00000001 },
1533 []u32{ 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000 },
15371534 };
15381535
15391536 for (cases) |case| {