casaca has quit [Remote host closed the connection]
casaca has joined #zig
<andrewrk>
noam, how so?
<noam>
andrewrk: the biggest issue with the asm right now is unnecessary moves on inlined calls
<andrewrk>
oh btw you have to do inlining during semantic analysis to adhere to the spec
<noam>
I already do
<noam>
:)
<andrewrk>
if you have `inline fn foo(x: i32) { return x; }` - at the callsite, if you pass a comptime parameter, the result is required by the spec to also be comptime
<andrewrk>
not sure how you'd accomplish that and have a problem with unnecessary movs on inlined calls
semarie has quit [Ping timeout: 252 seconds]
<andrewrk>
er, I mean, I'm just saying if those two things are true about your codebase then you've discovered a way to implement this that I'm not aware of :)
<noam>
andrewrk: basically, it inlines by creating a new block without access to the function's scope, and replacing returns with breaks
<noam>
The result is semantically equivalent and inlined - but it still allocates a register for the block, then the asm op, then moves from the latter to the former
semarie has joined #zig
<andrewrk>
nice that's the same thing stage2 does :D
<andrewrk>
oh I see, so the block makes it to codegen
<noam>
I guess it's not so much result locations that will clean it up
<andrewrk>
do you have a code example, we can compare IR/machine code?
<noam>
Yeah
<noam>
need to find the link though...
<andrewrk>
isn't it in one of your test cases?
<noam>
yeah but I already pasted it
<noam>
and I'd rather not have two copies
<andrewrk>
O I C
<noam>
...this is a very weird and inconsistent folder layout
<noam>
Ha, I can't run the test you gave just yet :)
<noam>
Will add it as the next one to work towards, should be trivial
<andrewrk>
what's the issue? maybe I can tweak it
<andrewrk>
make it non-recursive?
<noam>
Unreachable, if, arithmetic :P
<andrewrk>
lol do unreachable it's super simple
<noam>
Yeah :)
<andrewrk>
if is hard tho for machine code backends
<noam>
Arithmteic is super simple too
<noam>
Shouldn't be
<andrewrk>
gotta have an actual register allocation implementation
<noam>
Ihave the benefit of an assembler ;)
<noam>
I already have conditional branching for while loops
<andrewrk>
ah ok
<noam>
Every block generated creates a label for its beginning and end
<andrewrk>
just impl unreachable real quick and I'll remove the if and arithmetic from the test case
<noam>
A condbr just becomes `b .block_%d_end`
<noam>
I'll do that tonight or tomorrow, I'm working on a large test case still :)
<noam>
Just added @This() :)
<andrewrk>
fair :)
<noam>
Working on getting a container codegenning :D
<noam>
UART0 = UART.define(0xFF110000) except I used a decimal integer because I haven't impled hex lexing yet :P
<noam>
after this one though, I plan on a bunch of smaller stuff before doing more major features
<noam>
So that case is perfect as a full test
<noam>
Except for the lack of 1717 ;)
cole-h has quit [Quit: Goodbye]
cole-h has joined #zig
<noam>
Come to think of it, when will stage2 implement 1717?
waleee-cl has quit [Quit: Connection closed for inactivity]
<andrewrk>
my priority is to self-host before 1717
yyp has joined #zig
<noam>
Makes sense, since you have zig fmt :)
proteus-guy has joined #zig
Rum has joined #zig
zuyoutoki has quit [Ping timeout: 258 seconds]
<andrewrk>
zir-memory-layout branch is shaping up! just a few more tests left to fix
waleee-cl has joined #zig
cole-h has quit [Ping timeout: 260 seconds]
sord937 has joined #zig
Rum has quit [Quit: Leaving]
skuzzymiglet has joined #zig
earnestly has joined #zig
aerona has quit [Quit: Leaving]
<s-ol>
I'm experiencing what seems like a very weird glitch
<s-ol>
I'm doing a bunch of cImports from a directory tree, and every once in a while I will add another one
<s-ol>
I just did that, and there is now one header file that zig will just refuse to find
<s-ol>
error: C import failed [...] path/to/header.h file not found
<s-ol>
i've quadruple-checked the path and its... there?
<s-ol>
I just noticed that it is the longest path in the list so far... is there maybe some internal limit somewhere that I'm overrunnign?
<s-ol>
ooooh nevermind
<s-ol>
me dumb
<s-ol>
i forgot i install that dependency locally and that copies the headers, and this one was new >.>
<s-ol>
nice rubber ducking yall thanks
frett27 has joined #zig
shirty has joined #zig
frett27 has quit [Ping timeout: 240 seconds]
frett27 has joined #zig
yyp has quit [Quit: now it's safe to turn off your computer]
dyeplexer has joined #zig
m4r35n357 has joined #zig
di-wu has joined #zig
xackus_ has joined #zig
mschwaig has joined #zig
yyp has joined #zig
podge has joined #zig
xackus_ has quit [Ping timeout: 240 seconds]
podge has quit [Ping timeout: 246 seconds]
podge has joined #zig
podge has quit [Quit: quit]
sh4rm4^bnc_ is now known as sh4rm4^bnc
xackus_ has joined #zig
paulgrmn has joined #zig
paulgrmn has quit [Ping timeout: 240 seconds]
l1x has quit [Quit: Connection closed for inactivity]
xackus has joined #zig
xackus_ has quit [Ping timeout: 240 seconds]
cole-h has joined #zig
plakband has joined #zig
osa1 has quit [Ping timeout: 240 seconds]
<mikdusan>
andrewrk: if we accept `-` for piped input as per clang compat using `zig cc`, this applies to -E or source files like .c when `-x c`,
<mikdusan>
then because of zig-cache system, do we need to copy stdin to a file and insert into cache?
mikdusan has quit [Quit: WeeChat 3.0.1]
cole-h has quit [Ping timeout: 240 seconds]
sundbp has joined #zig
zuyoutoki has joined #zig
forgot-password has joined #zig
shirty has quit [Remote host closed the connection]
marijnfs has joined #zig
xackus_ has joined #zig
plakband has quit [Quit: WeeChat 2.9]
xackus has quit [Ping timeout: 268 seconds]
bbuccianti has left #zig ["Killed buffer"]
powerofzero has joined #zig
<powerofzero>
andrewrk: Do you have a proposal for new apis in #8363? I can think of several directions to take it, and I'm not sure which you are intending.
dyeplexer has quit [Remote host closed the connection]
yyp has quit [Quit: now it's safe to turn off your computer]
ur5us_ has joined #zig
<forgot-password>
Using @Type, how do I add a `const Declaration`? I'm not quite sure how to do it when I look at TypeInfo.Declaration
<Nypsie>
You can't
<Nypsie>
Sorry I misread. It's function declarations that cannot be created that way
<forgot-password>
No worries, that's what I wanted to try at first, but came to the conclusion that it's not possible :p
<forgot-password>
But how can I add a `pub const X: []const u8` then?
<Nypsie>
@Type(.Declaration{...}) but don't take my word for it because I feel like this isn't allowed either
<forgot-password>
But how do I set the data that way?
<forgot-password>
I don't get how the `Declaration.Data` union can be used for that
<Nypsie>
Ah good point
v0idifyy has joined #zig
<Nypsie>
Welp, guess it's not possible. Sorry I couldn't really help you out here
v0idify has quit [Ping timeout: 240 seconds]
<forgot-password>
No problem, I'm grateful for any help ;)
notzmv has quit [Ping timeout: 252 seconds]
yyp has joined #zig
vent has joined #zig
hsh has joined #zig
mikdusan has joined #zig
<ifreund>
andrewrk: I'm going for the WipZirCode => Astgen refactor as I'm not sure where you want to go with switches or error sets
nvmd has joined #zig
ur5us_ has quit [Ping timeout: 276 seconds]
Akuli has joined #zig
powerofzero has quit [Ping timeout: 260 seconds]
paulgrmn has joined #zig
powerofzero has joined #zig
powerofzero has quit [Remote host closed the connection]
frett27 has quit [Ping timeout: 240 seconds]
paulgrmn has quit [Ping timeout: 260 seconds]
yyp has quit [Quit: now it's safe to turn off your computer]
notzmv has joined #zig
osa1 has joined #zig
squeek502 has joined #zig
ur5us_ has joined #zig
Akuli has quit [Quit: Leaving]
marijnfs has quit [Quit: WeeChat 2.8]
leon-p has quit [Quit: leaving]
sord937 has quit [Quit: sord937]
cole-h has joined #zig
Sphax has quit [Quit: WeeChat 2.3]
<noam>
Ha! Good news is, I now analyze @This() correctly. bad news is my tree dumper doesn't detect recursive references, and @This() is definitionally recursive :P
xackus_ has quit [Read error: Connection reset by peer]