~mpu

http://c9x.me

~mpu/qbe

Last active an hour ago
View more

Recent activity

Re: [PATCH] Fix architecture detection on OpenBSD/arm64 an hour ago

From Quentin Carbonneaux to ~mpu/qbe

Sorry for the late reply. The patch looks good, I pushed it to master.

Re: Problem using blit 2 days ago

From Quentin Carbonneaux to ~mpu/qbe

On Thu, Sep 21, 2023, at 19:44, Roberto E. Vargas Caballero wrote:
> 	@.L8
> 		%x.L4 =l	alloc4	8
> 			blit	%x.L4,$.L4,8
> 		%.L6 =l	add	%x.L4,4
> 		%.L7 =w	loadsw	%.L6
> 			ret	%.L7

Blit, unlike memcpy(), takes the destination pointer as second
argument. In your code, you copy from %x.L4 to $.L4, that is,
you copy from uninitialized memory. The compilation result thus
looks correct to me.

Maybe you meant

Re: New version? 14 days ago

From Quentin Carbonneaux to ~mpu/qbe

Hi,

I agree that a release is overdue, especially with the important
bug fixes that landed after 1.1. The reason I've been a bit slow
to roll one out is that I want my work on IR matching to be part
of 1.2. I can't really give an ETA for this to be ready so if a
release would indeed help I'm ok to make one in the coming days.

Best.

Re: [PATCH qbe v2 2/2] implement float -> unsigned casts 29 days ago

From Quentin Carbonneaux to ~mpu/qbe

Thanks for root-causing that and providing a fix.

On Sat, Aug 26, 2023, at 00:18, Michael Forney wrote:
> Looking into the qbe code a little bit, I think it just assumes
> that for dtoui/ftoui, if the result class is Kw, it can just change
> the instruction to dtosi/stosi. However, this doesn't work for any
> value larger than INT_MAX but still within UINT_MAX, and I noticed
> that fpcnv doesn't test any values in this range.

Hm, yes that seems to be the issue.

> I'm not sure if
> it's ok to just change i.cls like this, or if an additional copy
> instruction is needed.

Re: make check issues a month ago

From Quentin Carbonneaux to ~mpu/qbe

I pushed tentative fixes on the dev branch,
let me know if they work.

Re: make check issues a month ago

From Quentin Carbonneaux to ~mpu/qbe

On Sun, Aug 13, 2023, at 13:52, Jan Mercl wrote:
> -       if ! $cc -g -o $exe $src
> +       if ! $cc -g -o $exe $src -lpthread

Could you check what the variable 'cc' is set to
at this point? I believe it should include -lpthread
already. Maybe the issue is that -lpthread must
come last.

Thank you for reporting the problem.

Re: Push line number tracking to master? a month ago

From Quentin Carbonneaux to ~mpu/qbe

I merged dev into master. The syntax went from file/loc
to dbgfile/dbgloc in the process, to emphasize that we
are dealing with debug information and match the C code.

Re: Push line number tracking to master? a month ago

From Quentin Carbonneaux to ~mpu/qbe

I'm afk for a couple days but I'm ok with the merge.
I thought of renaming the keywords to srcfile and srcloc though.

On Mon, Jul 31, 2023, at 05:55, Ember Sawady wrote:
> I'd like to merge a harec patch
> (https://lists.sr.ht/~sircmpwn/hare-dev/patches/42926) making use of it,
> but I'd rather not depend on dev qbe

Re: [PATCH] add field offset syntax for load and store 2 months ago

From Quentin Carbonneaux to ~mpu/qbe

Hi,

That is not getting in qbe, or any variation on the theme. I'd like to keep syntactic sugar out of the IL and consider it rather like some human readable serialization format, faithfully reflecting the internal representation.

For your readability problem I suggest you have a single way of emitting loads and stores, and maybe add a comment in the generated IL that makes it clear for you what's happening.

Best

Re: qbe fails to eliminate some stack slots 2 months ago

From Quentin Carbonneaux to ~mpu/qbe

Hi Drew,

The reason those don't disappear is that the memory optimizations don't see them: they appear at abi1 stage, and it's too late at this point to kill them.
The point of abi0 is to encode part of the abi early so it can be optimized away. So the work to do is clear: make abi0 smarter.
I am currently focusing on systematizing pattern matching in qbe to make instruction selection smarter in an elegant way (treematch branch). I can look at abi0 after that, or I can mentor someone into this work.

Hope that all makes sense.

On Mon, Jul 10, 2023, at 08:22, Drew DeVault wrote:
> Consider the following SSA:
>
> 	# (uint | u64 | void)
> 	type :tagged_union = align 8 {
> 		{ w 1, w 1 }