2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-18 19:03:41 -04:00
|
|
|
|
2020-06-29 21:58:34 -04:00
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-07-07 14:55:44 -04:00
|
|
|
|
2020-05-16 15:44:20 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-27 21:50:59 -04:00
|
|
|
|
|
|
|
|
|
2020-07-13 15:34:31 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-07 14:55:44 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-07 14:55:44 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-07 14:55:44 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-19 13:33:36 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
|
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 06:08:37 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
|
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-07 14:55:44 -04:00
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-07 23:24:30 -04:00
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
|
|
|
|
|
2020-05-16 15:44:20 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-07 23:24:30 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-07-13 15:34:31 -07:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-07 14:55:44 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-18 19:03:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 06:56:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-07 03:48:20 +00:00
|
|
|
|
2020-07-07 14:55:44 -04:00
|
|
|
|
2020-07-07 03:48:20 +00:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-05 15:49:23 -04:00
|
|
|
|
|
|
|
|
|
2020-07-07 03:48:20 +00:00
|
|
|
|
|
|
|
|
|
2020-06-05 15:49:23 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-05-16 15:44:20 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-08 15:15:55 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 21:58:34 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-29 21:58:34 -04:00
|
|
|
|
2020-07-07 03:48:20 +00:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-09 15:38:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-09 15:38:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-06-18 19:03:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
2020-07-11 22:04:38 +03:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-13 00:28:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-12 23:50:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-18 19:03:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-27 21:10:44 -04:00
|
|
|
|
2020-06-26 04:36:17 -04:00
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-26 04:03:54 -04:00
|
|
|
|
2020-06-26 04:36:17 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-26 04:03:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-08 02:31:04 -04:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 22:43:11 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-08 02:31:04 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-06-08 02:31:04 -04:00
|
|
|
|
2020-06-05 15:49:23 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-06-08 02:31:04 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-08 02:31:04 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-02 17:43:51 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-07 14:55:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-27 07:16:59 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-27 07:16:59 -04:00
|
|
|
|
2020-06-27 21:50:59 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-18 19:03:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-17 04:38:15 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:38:15 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-05 15:49:23 -04:00
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-06-05 15:49:23 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-05 15:49:23 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-07-07 14:55:44 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-26 03:15:12 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-27 21:50:59 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-26 03:17:13 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-26 03:17:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-27 21:50:59 -04:00
|
|
|
|
2020-06-27 07:16:59 -04:00
|
|
|
|
2020-06-27 21:39:39 -04:00
|
|
|
|
2020-06-26 03:17:13 -04:00
|
|
|
|
2020-06-27 21:50:59 -04:00
|
|
|
|
2020-07-13 15:34:31 -07:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 19:39:18 -07:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-05 15:49:23 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
2020-06-03 21:53:13 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 06:56:20 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 09:21:57 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-13 20:47:47 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:46:06 -07:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-05 15:49:23 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-12 23:50:25 -07:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-07 08:01:54 +00:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-07-07 08:01:54 +00:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-03 21:53:13 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-03 21:53:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-06-03 21:53:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-08 06:56:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-03 21:53:13 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 09:21:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-04 01:58:35 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-04 01:58:35 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-13 20:47:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-12 23:50:25 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 06:56:20 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-12 23:04:00 -07:00
|
|
|
|
2020-07-07 08:01:54 +00:00
|
|
|
|
|
|
|
|
|
2020-07-12 23:04:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-11 14:09:04 +03:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-11 14:09:04 +03:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-11 14:09:04 +03:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-11 14:09:04 +03:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|