Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2015-08-25

| Channels | #moarvm index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
02:16 vendethiel joined #moarvm
06:11 brrt joined #moarvm
06:16 brrt good *
06:18 nwc10 good UGT, brrt
06:19 brrt early UGT in fact :-)
06:41 zakharyas joined #moarvm
06:59 dalek MoarVM/even-moar-jit: 4ba51d2 | brrt++ | src/ (6 files):
06:59 dalek MoarVM/even-moar-jit: Register assignment != register allocation
06:59 dalek MoarVM/even-moar-jit:
06:59 dalek MoarVM/even-moar-jit: Keeping these separate greatly simplifies the (would-be) implementation
06:59 dalek MoarVM/even-moar-jit: of the register allocator.
06:59 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/4ba51d2a0e
07:07 Ven joined #moarvm
07:56 lizmat joined #moarvm
08:57 colomon joined #moarvm
09:03 FROGGS_ joined #moarvm
09:14 dalek MoarVM/even-moar-jit: c565f8e | brrt++ | src/jit/ (6 files):
09:14 dalek MoarVM/even-moar-jit: Implement necessary copy, load, spill primitives
09:14 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/c565f8e9f5
09:22 brrt ok, i think the mechanics are in place
09:22 brrt now what's left is the difficult bits
09:22 brrt deciding which value to spill
09:23 brrt and where to spill
09:24 colomon joined #moarvm
09:25 lizmat brrt++
09:32 brrt :-)
09:34 colomon joined #moarvm
09:53 colomon joined #moarvm
10:20 Ven joined #moarvm
10:34 brrt joined #moarvm
10:59 vendethiel joined #moarvm
11:16 dalek MoarVM/even-moar-jit: c5a9655 | brrt++ | src/jit/ (4 files):
11:16 dalek MoarVM/even-moar-jit: Implement register spilling (primitive)
11:16 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/c5a96551aa
11:17 colomon joined #moarvm
11:18 Ven joined #moarvm
12:23 Ven joined #moarvm
12:45 dalek MoarVM/even-moar-jit: 37b34cb | brrt++ | / (3 files):
12:45 dalek MoarVM/even-moar-jit: Validate expression templates before compiling
12:45 dalek MoarVM/even-moar-jit:
12:45 dalek MoarVM/even-moar-jit: Errors in expression templates are easy to make and very hard to
12:45 dalek MoarVM/even-moar-jit: debug. So the expression template compiler now finds template
12:45 dalek MoarVM/even-moar-jit: structure errors and warns early.
12:45 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/37b34cb36f
12:46 brrt you'd be surprised by how many of such bugs still existed
12:48 dalek MoarVM/even-moar-jit: c7c1123 | brrt++ | src/jit/register.c:
12:48 dalek MoarVM/even-moar-jit: Update register number counts on load and spill
12:48 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/c7c1123c78
13:02 FROGGS joined #moarvm
13:28 dalek MoarVM/even-moar-jit: 6975d6f | brrt++ | src/jit/ (5 files):
13:28 dalek MoarVM/even-moar-jit: Start trying to compile expression trees. Fix bugs
13:28 dalek MoarVM/even-moar-jit:
13:28 dalek MoarVM/even-moar-jit: Quite a few things are NYI, and the compiler stops on these.
13:28 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/6975d6fa13
13:31 brrt i'm of course a madman for suggesting it. but how would we consider integrating something like libmill onto moarvm
13:31 brrt http://libmill.org/
13:31 brrt no idea how it performs
13:31 brrt btw
13:34 JimmyZ brrt: looks like doesn't support windows
13:34 brrt aw, shame
13:34 brrt that's that, then
13:34 brrt i do believe that's some evil macro stuff in there
13:35 JimmyZ well, I'd rather to see one written by perl6 :P
13:39 brrt in perl6 everything is already easy :-P
13:55 timotimo hm, should i put parse_jitgraph.p6 into even-moar-jit, too?
13:59 timotimo do we expect the even-moar-jit binary to segfault when trying to build nqp?
13:59 timotimo and if not, should i try to investigate?
14:06 timotimo it's just a case of compiler->allocator being 0x0
14:07 TimToady joined #moarvm
14:08 FROGGS joined #moarvm
14:13 TimToady joined #moarvm
14:15 Ven joined #moarvm
14:26 timotimo doesn't seem like register_allocator_init is called from anywhere, actually
15:04 brrt joined #moarvm
15:12 [Coke] hhhh~.
15:13 [Coke] ~>
15:14 FROGGS </~
15:15 masak ~~~>
15:15 timotimo <~~>
15:16 brrt yeah, even-moar-jit may segfault
15:16 brrt and yes, the parse_jitgraph.p6 would be a good to include into even-moar-jit
15:16 brrt but i can do that just by merging
15:17 timotimo right, you can merge master into even-moar-jit
15:17 timotimo as it looks right now, it cannot do anything but segfault, as the register allocator never gets set and after compiling a tile it tries to release some registers
15:21 dalek MoarVM/even-moar-jit: 26766b0 | brrt++ | src/jit/ (2 files):
15:21 dalek MoarVM/even-moar-jit: Initialize register allocator, timotimo++
15:21 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/26766b0eb8
15:21 * [Coke] apologizes, had to drop crappy bus wifi and switch to his cell phone hot spot.
15:21 brrt have you committed the jitgraph parser to master?
15:21 timotimo yes
15:37 dalek Heuristic branch merge: pushed 57 commits to MoarVM/even-moar-jit by bdw
15:39 timotimo neato
15:39 timotimo perhaps you can help and implement the REG_ADDR thing, because i'm still confused as to what it's supposed to look like
15:48 brrt it's really simple actuallly
15:48 timotimo that must be what's confusing me
15:48 brrt - check if the operand of the reg_addr is a MVM_operand_write_reg
15:49 brrt - if so, emit it's operand number
15:49 brrt - done
15:49 brrt why does that work? because the write-operand is translated to it's address by the expression tree builder
15:50 brrt see ... letmesee.. src/jit/expr.c:L142
15:55 brrt does that make sense? it's that way so we can say things like (store $0 $1 ptr_sz)
15:55 brrt if we wanted it
16:05 dalek MoarVM/even-moar-jit: f038462 | brrt++ | src/jit/graph.c:
16:05 dalek MoarVM/even-moar-jit: JGB is in the process of being factored out
16:05 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/f0384620ae
16:06 timotimo oh, i didn't know that i'd have to inspect the operation's operators
16:06 timotimo that makes more sense now
16:07 brrt i try to have it make sense
16:07 brrt :-)
16:07 brrt sometimes, that fails
16:20 timotimo enter_call NYI is what i get to now, which sounds better than segfaulting :)
16:32 Ven joined #moarvm
16:37 timotimo what do i do in case we have a REG_ADDR, but the operand isn't write_reg?
16:45 timotimo renaming jgb_append_call immediately broke my script %)
16:55 timotimo bleh, i shouldn't have committed that in between to my gist
17:02 timotimo god damn it. the output has gone from having MVM_OP_ in front to not
17:02 timotimo so the diff isn't so helpful
17:02 * timotimo considers git filter branch ...
17:05 timotimo eh. whatever.
17:05 timotimo looking closely you can see that a few more ops can now work
17:08 Ven joined #moarvm
17:18 timotimo now isfalse and istrue also parse, yey
17:20 dalek MoarVM/even-moar-jit: 093eb66 | timotimo++ | tools/parse_jitgraph.p6:
17:20 dalek MoarVM/even-moar-jit: chase renames, also remove MVM_OP_ from output
17:20 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/093eb66b29
17:20 dalek MoarVM/even-moar-jit: 660e938 | timotimo++ | tools/parse_jitgraph.p6:
17:20 dalek MoarVM/even-moar-jit: support MVM_JIT_REG_ADDR.
17:20 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/660e938068
17:20 dalek MoarVM/even-moar-jit: 175e9e9 | timotimo++ | tools/parse_jitgraph.p6:
17:20 dalek MoarVM/even-moar-jit: support "op == MVM_OP_..." literal values (for istrue/isfalse only)
17:20 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/175e9e945c
17:20 dalek MoarVM/even-moar-jit: 2fbd57a | timotimo++ | tools/update_ops.p6:
17:20 dalek MoarVM/even-moar-jit: sort the flags for MAST::Ops before outputting them
17:20 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/2fbd57a5ad
17:22 timotimo https://gist.github.com/timo/afb0413f1aead980a275/revisions - this is the address of the gist, in case it got swallowed by the backlog
17:22 timotimo er, that's the revisions of the gist, not the gist itself, obviously
17:41 Peter_R joined #moarvm
17:48 brrt joined #moarvm
17:57 brrt looks quite good
17:57 brrt we cry
17:57 brrt when does that happen?
17:58 timotimo we cry?
17:59 brrt yes, we cry and wail, and gnash our teeth at the unfairness of it all
17:59 brrt i see no other alternative
18:00 brrt that's not true... we can special-case ops
18:00 brrt like we have for inc/dec
18:00 brrt but it's not preferable
18:00 timotimo oh
18:01 timotimo that's what we do when it's not a write operand
18:01 timotimo yeah, in that case i report the inability to translate that
18:01 brrt actually, inc/dec are write operands. it can be solved much more simply
18:01 timotimo the "we cry" was completely context-less for me :)
18:01 brrt :-)
18:01 timotimo inc/dec aren't calls to C functions, though
18:02 timotimo hopefully! ;)
18:02 brrt no
18:02 timotimo next thing i can do to help is potentially just to write some tiles?
18:03 brrt yes, you can do that, if you want to
18:03 brrt however, i have not documented the tiles yet
18:04 brrt it'd be interesting to see what you need to know to write a few of them
18:04 timotimo hmm
18:05 timotimo well, the most bail-heavy op so far is ifnonnull
18:05 brrt which is that?
18:05 timotimo i couldn't get new statistics for the bails because now we just die with an exception after compiling the first thing
18:05 timotimo i think
18:05 brrt yeah, that's true
18:06 brrt you kind of want to revert graph.c to a few versions back if you want to get the statistics
18:06 timotimo why isn't there a simpler thing to do? :P
18:06 timotimo a single line to comment out?
18:07 brrt impleminting ifnonnull is actually a template thingy
18:07 timotimo thought so
18:07 brrt ok, you know what i can do
18:07 brrt i can give you an environment flag that disables/enables the expr jit compiler
18:09 timotimo that'd be cool :)
18:09 brrt working on it
18:09 timotimo after that comes decont, but at least decont_i, decont_n and decont_s are already implemented
18:09 timotimo decont wasn't a "call to c function" type of thing apparently
18:10 timotimo decont is a primitive according to graph.c
18:11 timotimo i can build a (^caller) and use that to translate getdynlex and binddynlex probably
18:12 timotimo yes, that'll do
18:22 dalek MoarVM/even-moar-jit: 04d892a | brrt++ | src/ (3 files):
18:22 dalek MoarVM/even-moar-jit: Make expr tree environment-controllable
18:22 dalek MoarVM/even-moar-jit:
18:22 dalek MoarVM/even-moar-jit: MVM_JIT_EXPR_ENABLE needs to be set to nonempty value for the expr
18:22 dalek MoarVM/even-moar-jit: tree compiler to run.
18:22 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/04d892aa02
18:24 dalek MoarVM/even-moar-jit: a7b01ac | timotimo++ | / (2 files):
18:24 dalek MoarVM/even-moar-jit: support MVM_JIT_INTERP_CALLER
18:24 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/a7b01ac83a
18:49 timotimo the statistics of bails doesn't improve much :|
18:49 timotimo probably because many things get blocked by the many-bailers
18:50 vendethiel joined #moarvm
19:57 brrt joined #moarvm
20:10 muraiki joined #moarvm
20:11 muraiki hi all. I have no real knowledge of moarvm or nqp, but I'm trying to find out if nqp::watchfile uses polling or hooks into the kernel somehow (on linux). from what I could piece together so far, I guess moarvm is what actually implements the nqp::watchfile call, right?
20:12 muraiki I made it as far as here but then my eyes glazed over because I don't know C :) https://github.com/MoarVM/MoarVM/blob/master/src/io/filewatchers.c#L55
20:15 leedo muraiki: it looks like libuv uses the platform specific apis to watch for file change events
20:15 leedo https://nikhilm.github.io/uvbook/filesystem.html#file-change-events
20:15 leedo "inotify on Linux, FSEvents on Darwin, kqueue on BSDs, ReadDirectoryChangesW on Windows, event ports on Solaris, unsupported on Cygwin"
20:15 muraiki oh, I see, that's an external library. thanks so much!
20:16 leedo np
20:22 brrt we use libuv, yes
20:23 jnthn Aye. Trouble is that (unless it's changed recently) libuv is kinda a lowest common denominator in what it provides
20:24 muraiki as long as I can watch for file changes without it actually doing something like polling under the hood, that should be fine :)
20:27 jnthn libuv does have a polling option also, but I went with the event-y one
20:28 jnthn It's all quite icky though. Windows gives you duplicate notifications for various things, for example.
20:29 jnthn (Not just on Moar, it's a Windows "thing". The .Net API does just the same.)
20:30 muraiki jnthn: yeah, I think I saw some duplicate notifications on linux, actually. I'm filtering using .unique(:as(*.path), :expires(1))
20:30 muraiki although I just updated "everything" now
20:30 muraiki so maybe I had something out of date
20:32 jnthn muraiki: Yeah, the excuse tends to be "you touched metadata and data" and so forth :)
20:33 muraiki jnthn: oh, I see. this is my first time working with things like this. thanks for explaining it
20:42 jnthn :)
20:42 jnthn 'night, #moravm
20:52 timotimo oh brrt was here again :)
20:52 brrt still here
20:52 brrt oh, goodnight jnthn
20:52 timotimo oh!
20:52 brrt i'm going to ask whatever i have to ask tomorrow then :-)
20:53 timotimo so, are you going to build a ifnonnull template? :)
20:53 brrt no, i was hoping to see if you could
20:53 brrt gives me an idea on the quality of my documentation
20:53 brrt also
20:53 timotimo hah
20:53 brrt i'm much too busy still with register allocation woes
20:54 timotimo then you'll have to point me at what i need to read to figure out the ifnonnull template
20:58 timotimo i forgot that the if/else thing doesn't enter the expr tree at all, it'll just have a jump at some point
21:02 brrt ok, have you read the current expr tree documentation? docs/jit/ir.md
21:02 brrt correct
21:02 timotimo mhm
21:03 brrt ok, well, i can guide you through it
21:03 brrt first of all, ifnonnull branches if it's 0th operand is not null according to MVM_is_null
21:04 brrt MVM_is_null is defined, it seems, in src/6model/reprs/MVMNull.h
21:04 brrt that does:     return !check || check == tc->instance->VMNull;
21:05 timotimo ah
21:05 brrt you can also check emit.dasc
21:05 brrt which implements it as a primitve
21:05 timotimo it compares against 0 and if that isn't the case it compares against our constant vmnull, which i believe we have as a macro
21:05 brrt in fact, we have it as a node
21:05 brrt ain't that cool
21:06 brrt now, the boolean || is implemented in the exprtree using the variadic short-circuiting ANY
21:06 brrt node
21:06 brrt foo || bar is (any 2 (foo) (bar))
21:06 brrt see what i mean?
21:07 timotimo oh, it's variadic
21:07 timotimo the 2 is for "number of things that come afterwards"?
21:08 brrt aye
21:08 timotimo same with "do", yeah?
21:08 brrt yes
21:09 timotimo isnull_s has a commented-out thing below that just uses "nz" to check for zero
21:09 timotimo it kind of seems like that'd be "nonzero" from the name %)
21:09 brrt aye
21:09 brrt that is exactly right :-)
21:10 timotimo oh
21:11 timotimo hm
21:11 timotimo (template: ifnonnull
21:11 timotimo (any 2
21:11 timotimo (nz $0)
21:11 timotimo (eq $0 (vmnull))
21:11 timotimo (jump $1)
21:11 timotimo ))
21:14 timotimo oh
21:14 timotimo any doesn't do the if/then itself
21:15 timotimo also, it seems like i've built a check for "is this vmnull and not null" or something
21:16 brrt actually, that's already pretty good
21:16 timotimo but how do i build an if without an else-branch? just putting () there doesn't seem to work right
21:16 timotimo "unknown node type", it says
21:16 brrt nope, but, consider what that WHEN does
21:16 brrt or actually, that if/else
21:16 brrt it doesn't yield a value
21:17 brrt it updates the current position
21:17 brrt that's a branch, which is a void operation
21:17 timotimo does that mean it has to have a ! after ifnonnull?
21:17 brrt hence, the else-operation is imply nothing
21:17 brrt basically, if you're using 'statement' conditionals, you must pick EITHER or WHEN
21:17 timotimo is "ne" the opposite of "eq"?
21:17 brrt right
21:18 timotimo (template: ifnonnull
21:18 timotimo (when (any 2
21:18 timotimo (nz $0) (ne $0 (vmnull)))
21:18 timotimo (jump $1) ))
21:18 brrt ok, almost there
21:18 timotimo ah, not jump. branch.
21:19 timotimo and perhaps i have to (label $1) ?
21:19 brrt yes
21:19 timotimo or use goto $1
21:19 brrt the reason being that branch can go anywhere it pleases, and it's the label that turns the constant in $1 into an executable address
21:20 timotimo mhm
21:20 brrt (you can easily implement (branch (load mem)) as a tile, for example
21:20 timotimo mhm
21:20 timotimo hllboxtype_i seems quite popular; i'm sure i can implement that as a template, too :)
21:22 Peter_R joined #moarvm
21:23 brrt try it out :-)
21:23 timotimo now i have (using let:) a $hllconf, which points at cu->body.hllconfig
21:24 timotimo how do i deref that? (load (addr $hllconf) (offsetof MVMHLLConfig body.int_box_type)) for example?
21:24 timotimo actually, i've made this a macro now:     ($hllconf (load (addr (cu) (&offsetof MVMCompUnit body.hll_config)) ptr_sz))
21:26 brrt that's the let: expression? looks good
21:26 timotimo (template: hllboxtype_i
21:26 timotimo (load (addr (^hllconfig) (&offsetof MVMHLLConfig int_box_type))))
21:26 timotimo then you'll have to point me at what i need to read to figure out the ifnonnull template
21:26 timotimo oops, how did that line get put in there, too?
21:26 brrt can you send me a gist?
21:28 brrt also, load always needs a size
21:29 timotimo sure
21:29 timotimo oh, yes
21:29 brrt it should complain about that :-)
21:30 timotimo https://gist.github.com/timo/1aa5c5475fb0c773cfd0
21:30 timotimo ifnonnull, ^hllconfig and hllboxtype_i are new in there
21:31 timotimo hm.
21:32 timotimo "unknown node type" is how it errors out when it sees hllboxtype_i :(
21:32 brrt yes, $hllconfig isn't really a well-known node :-)
21:33 timotimo ooooh
21:33 brrt in fact, the $hllconfig is redundant, that's what you do for a let: expression, not a macro
21:33 brrt it's rigid dude :-)
21:33 timotimo yeah, i copy-pasted it out of a let: expression
21:34 timotimo kind of unsurprisingly, all those hllboxtype_i bails now turned into box_i bails :)
21:34 timotimo i remember this from when we first implemented jit opcodes for the previous jit
21:35 timotimo box_i didn't get translated by my script because it has a "if the opcode is box_n, this parameter must be a _F type" ?: in it
21:37 brrt yeah, that sucks
21:37 timotimo so, how about the eq_i, not_i things? "i maybe want to add a flag-to-register op"; is that coming?
21:37 brrt if you wish, you have my permission to redundantize it in graph.c
21:37 brrt yes, that's called flagval until i have a better name
21:37 brrt maybe i want to just call that 'value'
21:38 timotimo ah, so it's already implemented?
21:38 timotimo and i can thus build not_i, eq_i, ne_i?
21:38 brrt (i.e. copy-paste it to the reg_val and reg_val_f case in different blocks)
21:39 timotimo aye
21:39 brrt it's not yet implemented, although it's simple enough to implement
21:39 brrt but the node name certainly exists
21:39 brrt next up, i'll be showing you how to create tiles :-)
21:40 brrt i'm ambivalent whether i should *imply* the upscaling or make it explicit, and i'm betting on upscaling
21:40 brrt eh, explicit
21:41 brrt basically, that would make it (convert (flagval (eq $1 $2)) int_sz int)
21:41 brrt or so
21:41 brrt not 100% sure on that
21:42 dalek MoarVM/even-moar-jit: 396aca6 | timotimo++ | src/jit/core.expr:
21:42 dalek MoarVM/even-moar-jit: hllboxtype_i and ifnonnull are very popular bailers.
21:42 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/396aca6585
21:42 dalek MoarVM/even-moar-jit: 5e0e862 | timotimo++ | src/jit/graph.c:
21:42 dalek MoarVM/even-moar-jit: remove "do we want _F or not?" checks from some ops
21:42 dalek MoarVM/even-moar-jit:
21:42 dalek MoarVM/even-moar-jit: by duplicating the code for float vs non-float
21:42 dalek MoarVM/even-moar-jit: so that the parser has an easier time.
21:42 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/5e0e86283b
21:42 brrt also, do you do frequent make reconfig?
21:42 timotimo no, i didn't know about that
21:42 brrt timotimo++
21:42 brrt reconfig often
21:42 timotimo ah?
21:42 brrt i've changed the makefile quite often :-)
21:42 timotimo ah
21:43 timotimo how do we best get sqrt and the trigonometric ops into the reach of the exprlist compiler?
21:43 brrt not sure, why don't they work now?
21:43 timotimo hold on.
21:43 brrt it's all a bit problematic since i haven't thought numeric register usage through at all
21:44 brrt waitaminute
21:44 timotimo src/jit/core_expr_tables.h:558:30: error: ‘sqrt’ undeclared here (not in a function)
21:44 timotimo MVM_JIT_CONST, CONST_PTR(sqrt), MVM_JIT_PTR_SZ, MVM_JIT_CARG, 1,
21:44 timotimo ^
21:44 timotimo src/jit/expr.c:5:35: note: in definition of macro ‘CONST_PTR’
21:44 timotimo #define CONST_PTR(x) ((uintptr_t)(x))
21:44 timotimo we may have to force gcc to turn sqrt into "a thing" we can reference
21:45 brrt ifnonnull should branch if both $0 is nonzero AND not equal to vmull
21:45 brrt so the any should be and
21:45 timotimo oh
21:45 timotimo ah, yes
21:45 brrt #include "math.h" before #include "tile_tables.h"
21:45 timotimo oh, is that so easy?
21:45 brrt should be all, yes
21:47 timotimo ITYM <math.h>?
21:47 timotimo yes, much better
21:47 dalek MoarVM/even-moar-jit: bd5cca4 | timotimo++ | src/jit/core.expr:
21:47 dalek MoarVM/even-moar-jit: ifnonnull was wrong, brrt++ for noticing
21:47 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/bd5cca4a5c
21:47 dalek MoarVM/even-moar-jit: b8f37a2 | timotimo++ | src/jit/tile.c:
21:47 dalek MoarVM/even-moar-jit: allow us to put sqrt and trigonometric functions into core.expr
21:47 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/b8f37a2687
21:48 brrt yeah, <math.h> also works
21:49 timotimo https://gist.github.com/timo/afb0413f1aead980a275/revisions - check it :) :)
21:49 timotimo now i'll have a look at decont
21:50 * brrt is not sure whether he should assign arglist an order nr
21:51 brrt oh, by the way, don't use ptr_sz in (carg), use ptr
21:52 brrt e.g in box_s
21:52 brrt but, really cool, timotimo++
21:52 timotimo oh
21:53 dalek MoarVM/even-moar-jit: 477aff7 | timotimo++ | tools/parse_jitgraph.p6:
21:53 dalek MoarVM/even-moar-jit: in carg, use "ptr" instead of "ptr_sz"
21:53 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/477aff7b2c
21:53 timotimo how best to negate a flag in an if?
21:53 timotimo (i.E. use ^is_type_obj for IS_CONCRETE)
21:54 timotimo "zr"?
21:58 brrt you can't negate a flag in if
21:58 brrt basically, you'd be better of negating the expression
21:59 brrt we don't do logical NOT
21:59 timotimo hm
21:59 timotimo but is_type_obj already starts with (nz ...)
22:00 timotimo OK, now i'm supposed to pass the address of the target register to a c function, just like the result of compiled things
22:00 timotimo i should be able to do this
22:00 brrt yay, arglist compilation now works!
22:01 brrt i believe in you :-)
22:01 timotimo hm
22:01 timotimo could already be done
22:01 timotimo node load is too short, eh?
22:01 brrt which op are you trying to implement
22:01 brrt yes, you probably miss the size
22:01 brrt it is not implicit
22:02 timotimo decont
22:02 timotimo i put the size into addr rather than load
22:02 timotimo Node (call (const (&CONST_PTR (load (addr (load (addr (load (addr $1 (&offsetof MVMObject st)) ptr_sz) (&offsetof MVMSTable container_spec)) ptr_sz) (&offsetof MVMContainerSpec fetch) ptr_sz))) ptr_sz) (arglist 3 (carg (tc) ptr) (carg $1 ptr) (carg $0 ptr))) is too short at tools/expr-template-compiler.pl line 80, <$INPUT> line 119.
22:02 timotimo hooray!
22:02 timotimo i disagree, it's not too short :D
22:02 timotimo but yeah
22:02 timotimo forgot the return type
22:03 timotimo now i get errors from the result
22:03 timotimo src/jit/core_expr_tables.h:98:57: warning: implicit declaration of function ‘ARRAY’ [-Wimplicit-function-declaration]
22:03 timotimo does that tell you something?
22:03 timotimo i'll put a gist of the template, too
22:04 timotimo https://gist.github.com/timo/1aa5c5475fb0c773cfd0#file-decont
22:04 timotimo oh
22:04 timotimo i put the size in the wrong node again
22:04 timotimo hum. same error, eh?
22:05 timotimo updated with the ptr_sz fix
22:05 dalek MoarVM/even-moar-jit: be70a8d | brrt++ | src/jit/ (5 files):
22:05 dalek MoarVM/even-moar-jit: Implement compile_arglist & MVM_jit_register_take
22:05 dalek MoarVM/even-moar-jit:
22:05 dalek MoarVM/even-moar-jit: compile_arglist is only implemented on POSIX, but should be easy
22:05 dalek MoarVM/even-moar-jit: to implement on win32 with the current primitves
22:05 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/be70a8da57
22:06 TimToady joined #moarvm
22:06 brrt letmesee
22:06 brrt ok, let's make that simpler
22:07 timotimo a "let" wouldn't be bad, eh?
22:07 brrt yeah
22:07 brrt but
22:07 brrt hmmm
22:08 brrt you're still thinking waay to high level :-)
22:09 timotimo d'oh
22:10 timotimo i was hoping there'd be a way i could not grab the stable's container spec twice
22:10 timotimo but that doesn't seem to be possible
22:10 brrt yeah, you can do that actually, but it'll require nested IF, as far as i can see
22:11 timotimo ah
22:11 timotimo right. then the "else" case will be a bit more complex
22:11 brrt actually, this is a destructive op, because the consainter_spec->fetch takes the register addres
22:14 brrt hmm, i'm not sure you can use a LET there
22:24 brrt https://gist.github.com/bdw/e59d772a17fadeb42c96 is what i'd give you
22:25 brrt for what it's worth, since you're referring to $1 often, we may want to put a (let (($obj (copy $1)) before that, to ensure the $1 is loaded beyond either branch
22:26 timotimo oh
22:26 timotimo i had no idea that'd make a difference
22:27 brrt it shouldn't but it will
22:27 timotimo but i can do that
22:27 brrt due to general hardness of value calculation ordering
22:28 timotimo i didn't know about "either" yet
22:29 timotimo (store $0 $1) is too short, it says; needs a size?
22:29 brrt right
22:29 timotimo yeah, i put ptr_sz in there now
22:29 brrt ptr_sz :-)
22:31 brrt either is void if
22:31 dalek MoarVM/even-moar-jit: 2800146 | timotimo++ | src/jit/core.expr:
22:31 dalek MoarVM/even-moar-jit: implement decont! (with help from brrt++)
22:31 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/2800146278
22:31 brrt normal if works like a ternary operator expression: foo ? bar : baz
22:31 timotimo OK
22:32 brrt either works like if(foo) bar(); else baz();
22:32 brrt i distinguish them this way because the tiler can't
22:33 brrt (distinguish between if with void and nonvoid children)
22:33 timotimo my (carg (copy $n)) are too short, lacking the size again
22:34 brrt no, not size, type
22:34 brrt why copy $n, by the way
22:34 brrt c call arguments need to have type information :-)
22:35 timotimo er, yeah
22:35 timotimo it's for literals
22:36 brrt also for knowing which register type to stuff things in
22:36 timotimo hm, do some of my generated templates need a !
22:36 timotimo like atpos_o with your implementation has a !, but with mine it doesn't
22:37 timotimo huh. i get all the undefined errors for trig and sqrt again :|
22:39 timotimo getlex went up to 75 from 66 and unless_o joined the fun at 29
22:39 timotimo (bails)
22:39 brrt getlex needs some expression builder love
22:39 timotimo should i commit the templates that were generated from the parser tool or keep them local modifications?
22:39 brrt keep them local for now
22:40 brrt i'm not 100$ ready to deal with it yet
22:40 timotimo you're our 100 dollar brrby :P
22:41 timotimo i'm not sure how to do the coerce_in and coerce_ni ones, they probably just turn into a super simple primitive or perhaps i'd have to build a tile for it
22:41 timotimo but i have an idea how to tackle unless_o
22:41 timotimo does the "gc sync point" have to be considered here?
22:41 TimToady joined #moarvm
22:43 brrt at some point...
22:43 brrt but i'll deal with that later
22:43 timotimo OK
22:44 timotimo so unless_o won't get it either :)
22:45 timotimo oh
22:45 timotimo coerce_istrue is weird
22:45 timotimo because it sets the tc->interp_cur_op
22:47 brrt coerce istrue is really weird, i know
22:47 brrt ignore that for now
22:47 timotimo yeah, but it's so high up on the bailers list :)
22:47 timotimo coerce_ni is 3rd, unless_o is 2nd and getlex is 1st
22:48 timotimo unless_i it is, then
22:49 brrt basically any call that takes reg_addr to write it's value should be marked destructive
22:49 timotimo right. i can do that
22:49 brrt like box_s and box_i
22:49 brrt and reg_addr is ptr not ptr_sz
22:49 brrt ptr_sz = 8
22:50 brrt ptr = ... also 8
22:50 brrt would you look at that
22:50 brrt no, ptr = 7
22:50 timotimo oh, whoops
22:50 timotimo wait, where do i use ptr where i should use ptr_sz?
22:51 brrt you use ptr_sz in load and store and friends, to indicate the size of the value being loaded
22:51 brrt the idea is that on different architectures pointers will have different sizes
22:52 brrt and nums may have different sizes, etc
22:52 timotimo i'm confused. did i do it wrong somewhere and i have to fix it?
22:52 brrt you use ptr in carg, and possibly some other places in the future, to indicate the pointer type
22:53 timotimo yes, i use ptr in carg
22:53 brrt so that the argument list builder knows to store the values in a pointer-register (a general-purpose-register)
22:53 timotimo mhm
22:53 brrt different cpu's have many different register classses
22:53 timotimo i feel like i missed the context that explains why you started this explanation :)
22:54 brrt so, where it goes wrong, i think, is in REG_ADDR
22:54 brrt http://irclog.perlgeek.de/moarvm/2015-08-25#i_11115541
22:54 brrt :-)
22:54 timotimo ooooh
22:55 timotimo see, there is a tiny thing in the sentence structure that i think you've missed
22:55 timotimo i was asking basically "point out to me the specific place where i am currently using ptr where i should have used ptr_sz instead"
22:55 timotimo you understood "when should i use ptr and when should i use ptr_sz"
22:56 brrt yeah
22:56 brrt ok, when you use REG_ADDR, you emit ptr_sz, it should be ptr
22:56 timotimo that's where you're wrong! my compiler doesn't have any ptr_sz in it any more
22:57 dalek MoarVM/even-moar-jit: 75d08c1 | timotimo++ | tools/parse_jitgraph.p6:
22:57 dalek MoarVM/even-moar-jit: forgot a type for carg when we have a literal integer
22:57 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/75d08c1722
22:57 brrt then your gist is out of date :-P
22:57 timotimo ah
22:57 timotimo probably
22:57 brrt cool :-)
22:58 timotimo updated the gist
23:01 brrt cool
23:01 timotimo mh, what's the opposite of nz again? zr?
23:01 brrt i'm... going to sleep, i'm sorry to say
23:01 brrt aye
23:02 brrt nz = nonzero, zr = zero
23:02 timotimo 'k
23:02 brrt when in doubt, consult src/jit/ocmpile.c:338
23:02 brrt compile.c
23:02 timotimo so unless_i is basically just (when (zr $0) (branch (label $0)))
23:02 brrt $1
23:02 brrt but yeah
23:03 timotimo er, yes
23:03 timotimo that's what i have in my vim :)
23:03 brrt that's what it is
23:03 brrt timotimo++
23:04 TimToady joined #moarvm
23:04 * brrt afk
23:04 timotimo cool, implementing unless_i removed 14 bails in total
23:05 brrt \o/
23:05 timotimo and none got added; obviously because unless_i would only occur at the end of a BB
23:05 timotimo and our expr jit stops compiling at a BB border
23:07 timotimo there's quite a few big-ish trees in the jit log now
23:08 timotimo sp_findmeth is kinda popular, but it's a big chunk of code that'd have to be translated
23:11 timotimo and prepargs ... no clue how i'd implement this, or rather whether or not it's needed in the jit at all
23:30 dalek MoarVM/even-moar-jit: b2c3ad4 | timotimo++ | src/jit/core.expr:
23:30 dalek MoarVM/even-moar-jit: implement unless_i
23:30 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/b2c3ad4b73
23:30 dalek MoarVM/even-moar-jit: b0f137d | timotimo++ | src/jit/core.expr:
23:30 dalek MoarVM/even-moar-jit: implement hllboxtype_s and hllboxtype_n
23:30 dalek MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/b0f137db14
23:32 timotimo hllboxtype_s had 3 bails, those are now 1 more isnull, 1 more param_sn and 1 more successfull compile
23:33 nebuchad` joined #moarvm
23:33 timotimo and with that, i shall go to bed
23:53 TimToady joined #moarvm

| Channels | #moarvm index | Today | | Search | Google Search | Plain-Text | summary