Welcome to the main channel on the development of MoarVM, a virtual machine for NQP and Rakudo (moarvm.org). This channel is being logged for historical purposes.
Set by lizmat on 24 May 2021.
Geth MoarVM: MasterDuke17++ created pull request #1577:
Silence wrong GCC warning about unused variable
08:29
nine www.extremetech.com/extreme/188776...dern-chips 11:25
Finally an explanation for cache associativity that I understand
dogbert17 nine: any theories wrt gist.github.com/dogbert17/d3fee0f0...854faa2f71 12:08
nine Haven't had a look yet
Haven't had a look yet 12:09
dogbert17 hopefully it won't lead into some kind of rabbit hole :) 12:11
nine New world record! 13.220s 12:41
That's almost a full second faster than pre-new-disp. And I haven't even started on JITing native call yet
This speedup is just from no longer unconditionally boxing results of native calls 12:42
Geth MoarVM/new-disp-nativecall: ba5513f870 | (Stefan Seifert)++ | 4 files
Avoid boxing native call results if native type is requested
12:43
MoarVM/new-disp-nativecall: 246565db31 | (Stefan Seifert)++ | 8 files
Fixup "Translate dispatch to native functions"

When the rakudobug that prevents us from using natively typed dispatch ops for calls is fixed, we need native versions of sp_runnativecall as well
12:45
MasterDuke ugh. i dislike msvc 12:56
jnthnwrthngtn dogbert17: Hmm...that's a curious one. 13:26
nine: Yay...numbers with the JITting should be rather nice :) 13:27
Release is out, so guess on tomorrow I'll merge some things :) 13:31
MasterDuke this is blowing my mind. there are `#if foo ... #endif` elsewhere in interp.c, but the one i added is causing msvc to die 13:38
dogbert17 jnthnwrthngtn: FWIW, adding MVM_SPESH_OSR_DISABLE=1 seems to remove/hide the problem 13:43
MasterDuke oh! i think i figured it out. the `#if ... #endif` i added is inside an MVMROOT. it looks like msvc expands that macro (and the block inside) into a single line, so then my directives are just stuck in the middle of the line and don't work 15:30
oh, somehow i didn't realize that's normal behavior (i.e., i think gcc and clang do the same thing). but i guess the real difference is that msvc is doing macro expansion before processing the `#if` directive 15:38
now to see if there's a way to change that order...
oh, or maybe it's just easier to move the variable declaration outside the MVMROOT (and leave the assigning inside)... 15:39
nine MasterDuke: or replace the MVMROOT macro with MVM_gc_root_temp_push/MVM_gc_root_temp_pop 15:50
MasterDuke you can see what it looks like now, i just force pushed to github.com/MoarVM/MoarVM/pull/1577 15:51
but yeah, that was the other better option 15:52
(better than trying to mess with msvc macro expansion rules)
nine We're JITing calls to void (*native_function)()! Feels like I've been here before :D 15:59
Actually void (*native_function)(void) but I guess few people actually know about that distinction 16:02
MasterDuke that's pretty cool. how many layers of indirection are removed? 16:03
timo i didnt know there was a distinction, i thought when i was forced to write the void in there for some microcontroller firmware that was just some random "c standard from the eighteen hundreds" thing 16:04
nine MasterDuke: github.com/MoarVM/MoarVM/blob/new-...all.c#L882 16:05
In C, a void foo(); declaration lets you pass any arguments to foo. Only void foo(void); makes the compiler complain if you pass arguments 16:07
MasterDuke nine: any further thoughts/questions on github.com/MoarVM/MoarVM/pull/1574 and github.com/MoarVM/MoarVM/pull/1577 ? 16:46
nine MasterDuke: just expressed them ÖD 19:23
:D
That work for avoiding needless boxing of return values in native calls pays off in another way as well. For sp_runnativecall_i returning the result is really just: | mov WORK[runcode->return_register], RV 19:28
This already handles smaller integer types as well, as the trunc/extend is already emitted by the code-gen of dispatch_i. 19:31
MasterDuke thanks 20:55
Geth MoarVM: c008c8eb91 | (Daniel Green)++ | src/core/interp.c
Silence wrong GCC warning about unused variable

It's used in an `assert()` a couple lines down, but even with `--debug=3` for some reason GCC doesn't see it as being used.
21:01
MoarVM: b4854e7678 | (Daniel Green)++ | src/strings/unicode_ops.c
Silence GCC warning for using `cps` uninitialized

It is actually initialized in both branches of the `if/else` right above
  (assuming `cp_num` > 0 (but adding an assert for that didn't help)) so
just surpress the warning.
MoarVM: eb16462233 | MasterDuke17++ (committed using GitHub Web editor) | 2 files
Merge pull request #1577 from MasterDuke17/fix_the_two_current_warnings
MoarVM: 52c4a6d753 | (Daniel Green)++ | src/jit/x64/emit.dasc
Improve the jit implementation of nqp::abs_i

We don't need to copy the source twice, it's faster just to refer back to it in the cmovl.
MoarVM: 444367cea6 | MasterDuke17++ (committed using GitHub Web editor) | src/jit/x64/emit.dasc
Merge pull request #1574 from MasterDuke17/improve_jit_of_abs_i