~mpu

http://c9x.me

~mpu/qbe

Last active an hour ago
View more

Recent activity

Re: No bit-wise unary inverse op? an hour ago

From Quentin Carbonneaux to ~mpu/qbe

On Fri, Jun 14, 2024, at 14:14, Roland Paterson-Jones wrote:
>>  could quibble about an integer-only
>> "neg", but not a biggie.
>
> Correction "not" :)

Yeah, the idea is that you can use 'xor %t, -1' instead.

Re: Uniqueness of QBE internal temporary names an hour ago

From Quentin Carbonneaux to ~mpu/qbe

On Thu, Jun 13, 2024, at 17:26, Roland Paterson-Jones wrote:
> These end up as "ld.NNN" etc. However it's not obvious to me that they
> will be unique from input temporary names. Am I missing something?

It does not matter much if they conflict with user temporaries
because we really identify temporaries by their ids, which will
be fresh when using newtmp(). At worst, it yields to confusing
debug info.

Re: [PATCH] ifopt 7 hours ago

From Quentin Carbonneaux to ~mpu/qbe

Hi Roland,

Thank you for your patch! I had not realized cproc
was generating branching code this convoluted. There
is actually an elegant way to deal with logical ops
(||, &&, !) and branching in the frontend. I made
these changes in a branch of cproc that you can find
here:

  https://git.sr.ht/~mpu/cproc/log/logflow

It bootstraps but I still need to test it more
thoroughly. I think we should understand better how
these changes interact with your patch, and if by

Re: PATCH: Optab-driven copy detection 5 days ago

From Quentin Carbonneaux to ~mpu/qbe

On Mon, Jun 10, 2024, at 15:44, Roland Paterson-Jones wrote:
> I'll try to be more careful in future with the patch preparation -
> this one was prepared on top of
> https://lists.sr.ht/~mpu/qbe/%3CCAAS8gYArVsP7Gwktu5fhg6YCQNEtE+k3MZr9dqd29DUfYYGxVw@mail.gmail.com%3E
> (which should have applied to master cleanly modulo email fiasco).

Ah okay, for the record, I decided to only simplify ops returning
integer values (w or l). I don't expect that this optimization
would make a difference for float ops and I mostly wanted to catch
things like indexing in a byte array where a `mul ?, 1` can
appear easily.

Re: Curious codegen 5 days ago

From Quentin Carbonneaux to ~mpu/qbe

On Thu, May 23, 2024, at 16:01, Roland Paterson-Jones wrote:
> This is cproc/QBE compiling cproc/driver.c
>
> static void
> usage(const char *fmt, ...)
> {
>     va_list ap;
>
>     if (fmt) {
>         fprintf(stderr, "%s: ", argv0);
>         va_start(ap, fmt);
>         vfprintf(stderr, fmt, ap);
>         va_end(ap);
>         fputc('\n', stderr);

Re: PATCH: Optab-driven copy detection 5 days ago

From Quentin Carbonneaux to ~mpu/qbe

Hi,

I pushed a light edit of this patch to master.

Note that I had a bit of trouble to make the
patch apply:
  
  1/ your mail client must have turned tabs
     into spaces, so `git am` refused to
     process the message;

  2/ you made the patch against a branch that
     had slightly diverged from master (iscon()
     had changed prototype).

Re: [PATCH] replace asm keyword 6 days ago

From Quentin Carbonneaux to ~mpu/qbe

I merged a patch in master that removes the
trolly identifier.

Re: PATCH: Merge linear jmp chains 8 days ago

From Quentin Carbonneaux to ~mpu/qbe

On Fri, Jun 7, 2024, at 11:58, Roland Paterson-Jones wrote:
> Aggregate otherwise isolated linear jmp chains into single (basic) blk's.

My thinking around this was that the final linearization to
assembly will effectively get rid of these chains. Is there
a benefit to doing it earlier?

Re: Question about loading float from data 9 days ago

From Quentin Carbonneaux to ~mpu/qbe

Another thing to fix is that for variadic calls
you want to tell qbe which args are variadic.
Use calls with this syntax to do so:

    call $printf(l $fmt, ..., d %g)

Re: [PATCH] Makefile: ensure POSIX 202X compliance 9 days ago

From Quentin Carbonneaux to ~mpu/qbe

Thanks for your patch but if pdpmake merely
warns I'll stick to the more readable
version of the Makefile.