<shachaf>
Hmm, does rex.W even do anything to setcc? I'm confused.
r4pr0n has joined #zig
<andrewrk>
yeah, it writes 0s to the upper bits
<andrewrk>
well and without it, it would be dh and not dil
daurnimator has quit [Quit: WeeChat 2.8]
<shachaf>
I don't think it clears the upper bits.
<andrewrk>
maybe I'm missing something
<shachaf>
A plain REX makes it write to dil instead bh, but I'm not seeing the W doing anything.
<andrewrk>
oh, I see. pixelherodev made it omit the REX if you don't set W so I guess I was accidentally setting something unrelated and getting second-order effects
<shachaf>
Ah, that makes sense.
<shachaf>
Plain REX is pretty unusual and the W doesn't do anything here, I think.
<shachaf>
But I don't think there's a way to clear the rest of the register with setcc.
<andrewrk>
I see, so that's why the other strategy is always used
Ashpool_ has quit [Remote host closed the connection]
Ashpool_ has joined #zig
gpanders has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
<shachaf>
(Normally a disassembler doesn't even print the REX prefix instruction, so if it shows rex.W that means something weird is going on.)
<andrewrk>
yeah I have a TODO comment here to audit that particular codegen
<andrewrk>
have a look at that add() codegen though, I think it's quite reasonable for a debug build
<andrewrk>
that's what I've been working towards the last few days
<andrewrk>
yes
<andrewrk>
oh the stack variable is at slightly the wrong offset; about to fix that
Ashpool_ has quit [Ping timeout: 264 seconds]
<shachaf>
Looks like it does what it says on the tin (other than the stack thing).
<shachaf>
Is it 0x10 to keep the stack pointer aligned or something? I never remember what the requirements are exactly.
marnix has quit [Ping timeout: 260 seconds]
<andrewrk>
yeah so that every function can assume at least a minimum aligned amount (depending on calling convention). that way functions which don't need > 16 byte align (which is most) can omit instructions to align the stack
<andrewrk>
alright, pushed to master. and I'm taking a day off tomorrow. good night all
gpanders has quit [Ping timeout: 240 seconds]
gpanders has joined #zig
Ashpool__ is now known as Ashpool
r4pr0n has quit [Quit: r4pr0n]
nycex has quit [Remote host closed the connection]
nycex has joined #zig
ask6155 has joined #zig
<ask6155>
hello!
<ask6155>
I'm not able to compile the master branch of zig. Is it because I don't have clang 11?
<ikskuh>
i think there was a change to 10.0.1 yesterday?
<ask6155>
I do have clang 10.0.0.1 but when I run cmake .. It says not found CLANG_LIBRARIES
gpanders has quit [Ping timeout: 240 seconds]
<ifreund>
ask6155: what OS/distro? have you ever successfully built master before?
<ask6155>
yes
<ask6155>
arch linux
<ifreund>
ask6155: did you passt -DZIG_PREFER_CLANG_CPP_DYLIB=ON ?
<ifreund>
ikskuh: I have a dream that someday javascript will be forgotten :D
<ikskuh>
ifreund: we need some API for the DOM first
<ifreund>
indeed
ask6155 has left #zig ["later"]
redj_ is now known as redj
marnix has quit [Ping timeout: 240 seconds]
marnix has joined #zig
hamoko[m] has left #zig ["Kicked by @appservice-irc:matrix.org : Idle for 30+ days"]
dimenus has joined #zig
<dimenus>
did clang change it's triple/target format in 10.0.1?
<dimenus>
even a simple hello world with zig cc fails to build
<pixelherodev>
Zig master?
<dimenus>
yessir
<dimenus>
it'
<pixelherodev>
I can't test, sorry :(
<pixelherodev>
Clang 10's build is still broken
<pixelherodev>
ugh
<dimenus>
it's cc1as failing actually
<dimenus>
the code itself generates o files np
<pixelherodev>
Static build works fine for me
<dimenus>
i'm on arch :(
<dimenus>
i'll do a bootstrap build and then swap 0.6 with master and re-test
<dimenus>
probably a clang issue
<pixelherodev>
I'm on Gentoo
<pixelherodev>
I just manually extracted the tarball
* pixelherodev
shrugs
<pixelherodev>
LLVM is broken, and IIRC the distro refused to fix it
<pixelherodev>
the distro's maintainer*
nvmd has joined #zig
marnix has quit [Read error: Connection reset by peer]
<dimenus>
i don't blame them
<pixelherodev>
I do.
<pixelherodev>
It's like a two line ebuild patch.
<dimenus>
ah
<pixelherodev>
Hmm, I'm going to try proposing it as a USE flag this time
<dimenus>
do you have a link to the issue?
<pixelherodev>
Not offhand
<pixelherodev>
I could probably find it
dimenus has quit [Read error: Connection reset by peer]
dimenus has joined #zig
pmwhite has quit [Remote host closed the connection]
pmwhite has joined #zig
marnix has joined #zig
xackus_ has joined #zig
tsujp1 has joined #zig
frett27_ has joined #zig
tsujp has quit [Ping timeout: 240 seconds]
frett27_ has quit [Ping timeout: 256 seconds]
<dimenus>
pixelherodev: i just downgraded clang. Working as expected now
<pixelherodev>
:P
<dimenus>
:)
dermetfan has quit [Ping timeout: 246 seconds]
blinghound has joined #zig
<blinghound>
is there a way I can convert a multidimensional array to a flat slice?
<fengb>
If you know the size, you can manually convert the root pointer and slice it
<fengb>
But that might be harder and more brittle than starting with a flat array and manually slicing multi-dimensions
<blinghound>
I do know the size, I'm generating vertices for terrain in varying LODs in chunks using a 5 dimensional array to make the calculations easier
<blinghound>
so can I just cast the first element and then slice?
<fengb>
Yep
<fengb>
`@ptrCast([*]T, array)[0..len]`
<fengb>
Oops, that's supposed to be `&array`
Nypsie has quit [Ping timeout: 256 seconds]
<blinghound>
ah brilliant, thanks fengb
<blinghound>
I'm still getting to grips with slices/arrays/ptrs
<leeward>
Array: chunk of memory. Slice: Pointer with length. Pointer: address of a single thing
<blinghound>
got all the terrain rendering in a single draw call
<leeward>
(pointer in a slice is in the C sense, not the "single thing" sense)
<leeward>
blinghound: Ooh, nifty
<blinghound>
cheers leeward! Jumping between c++ and zig confuses me sometimes
stripedpajamas has joined #zig
<leeward>
Yeah, subtle differences can be hard to keep straight.
<ifreund>
so, llvm 10.0.1 totally breaks the 0.6.0 arch package
<ifreund>
I guess we probably need to fix that
<leeward>
Ooh, an 0.6.1?
<fengb>
0.6.0-2
<ifreund>
though, shouldn't the zig package have been rebuilt? Or is 10.0.1 ABI compatible?
<pixelherodev>
I highly doubt it
<ifreund>
same
sm2n has joined #zig
<dimenus>
ifreund: I just downgraded clang to 10.0 and that works
<dimenus>
llvm is still 10.0.1
<dimenus>
(on arch)
Nypsie has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
<ifreund>
Oh im not on arch myself (void now), but someone mentioned it in my #river channel
<ifreund>
interesting that downgrading only clang fixed it though
<pixelherodev>
clang bug
* pixelherodev
shrugs
<pixelherodev>
At this point, I'm more surprised when LLVM + Clang works than when it fails
marnix has quit [Ping timeout: 264 seconds]
frmdstryr has joined #zig
<ifreund>
well I pulled out my old arch laptop to try simply revbumping the zig package
<ifreund>
looks like that fixed it
<ifreund>
guess I'll send daurnimator a mail
cole-h has joined #zig
blinghound has quit [Remote host closed the connection]
marnix has joined #zig
cole-h has quit [Quit: Goodbye]
frett27_ has joined #zig
wootehfoot has joined #zig
tsujp1 has quit [Ping timeout: 256 seconds]
nikita` has joined #zig
Akuli has joined #zig
marnix has quit [Read error: Connection reset by peer]
dimenus has quit [Read error: Connection reset by peer]
dimenus has joined #zig
ofelas has quit [Remote host closed the connection]
dermetfan has joined #zig
ofelas has joined #zig
DarkUranium has joined #zig
<DarkUranium>
I was told to talk to aurame & Alex Nask in this channel. My question is unrelated to Zig specifically, but apparently, I could get some advice about something from 'em.
<DarkUranium>
Are they around?
<DarkUranium>
(my question is about language server stuff)
<ifreund>
DarkUranium: don't either here currently, they're more active on the discord
<ifreund>
*don't see
<DarkUranium>
I'll just idle a bit then.
ofelas has quit [Quit: shutdown -h now]
<ronsor>
>discord
<ronsor>
ah proprietary chat
<ifreund>
yep :/
<pixelherodev>
:( yeah
<pixelherodev>
I'm deleting my Google account shortly, maybe Discord should follow
<pixelherodev>
Also, heads up that all my old commits are now marked as unverified :P
<pixelherodev>
I changed my GitHub / GPG email
<ifreund>
oof, you been using a gmail?
<pixelherodev>
I was, yes.
<pixelherodev>
Now I've got something much much nicer: noam@pixelhero.dev
<pixelherodev>
:D
<ifreund>
man, pixelhero.dev is great
<ifreund>
only downside is that google owns the tld no?
<pixelherodev>
Yep
<DarkUranium>
pixelherodev, I do have a Matrix->Discord bridge, FWIW.
<pixelherodev>
But I figure that I'm getting rid of my google account anyways, so using something on their TLD is a sorta parting middle finger
<pixelherodev>
DarkUranium: want me to DM you the server ID?
<DarkUranium>
But I can't guarantee anything. Also, the bot would have to be invited to the server.
<pixelherodev>
Ah
<DarkUranium>
The only reason that bridge exists is because of a D&D player.
<pixelherodev>
lol
<pixelherodev>
I can ask them if they want to invite it?
<DarkUranium>
If I remembered how!
<pixelherodev>
hahaha
<pixelherodev>
Zig -> GLSL when?
<pixelherodev>
Wait
<pixelherodev>
I could actually do that
<pixelherodev>
Wait dammit
<pixelherodev>
Oops
<gruebite>
:D
<pixelherodev>
Switched chats halfway through typing
* pixelherodev
facepalms
<gruebite>
that would be cool. haxe/heaps has something similar where you write shader code in haxe
<DarkUranium>
It's something I'd like to do for my own Coyote language at some point.
<DarkUranium>
But one problem at a time.
waleee-cl has joined #zig
Ashpool_ has joined #zig
Ashpool has quit [Ping timeout: 246 seconds]
Nypsie has quit [Quit: WeeChat 2.8]
dimenus has quit [Quit: WeeChat 2.9]
wootehfoot has quit [Read error: Connection reset by peer]
xackus_ has quit [Ping timeout: 264 seconds]
ur5us has joined #zig
<pixelherodev>
Going to do a stage2 stream soon :)
<pixelherodev>
andrewrk: is there a reason that createElfFile is public?
<pixelherodev>
Also, why use an enum for pointer width within the linker, but integer in std.Target?
<pixelherodev>
I guess hypothetically it could be useful for supporting e.g. 15-bit architetures, but realistically I think that would scale to u16 for all intents and purposes
<pixelherodev>
Well, not for ELF - hm, I guess it does make sense
dermetfan has quit [Ping timeout: 272 seconds]
nvmd has quit [Ping timeout: 244 seconds]
tdeo has quit [Read error: Connection reset by peer]
tdeo has joined #zig
<gruebite>
is it weird for a library to ask the user to add `exe.addCSourceFile`?
<pixelherodev>
Kinda
<pixelherodev>
We need to figure out a good API for that
<gruebite>
that's what my gut says. `translate-c` isn't good for 100% of C right now, yeah?