freenode/#clasp - IRC Chatlog
Search
16:26:08
Bike
when any function returns there's this snippet that runs to change what function is on top of the stack for backtrace purposes
16:39:00
Bike
okay, so i wrote an assoc in terms of primops, so i don't need to worry about boolean elimination or type inference or anything
16:39:34
Bike
for a test, regular assoc took 1.218s. this assoc took 1.544s. if i changed the primop assoc to use primop:eq instead of calling eql, 0.617s
16:41:26
drmeister
Build a list of things that need inlining. I need to get through Monday and then I can assist.
16:43:40
Bike
i've tried to understand how to make those primitive things usable from clasp, for inline definitions, and failed
16:45:46
drmeister
(1) From either a cleavir xxx-instruction or a bclasp codegen-xxx function (or both) call a function that generates llvm-ir directly - this works in COMPILE and COMPILE-FILE code
16:46:18
drmeister
(2) Write a C++ intrinsic and put it in intrinsics.cc. That gets inlined using llvm inlining and only works with COMPILE-FILE code.
16:48:38
Bike
in other news, i tried a few things replacing (eq x y) with (if (primop:eq x y) t nil), and it saves over half the time even without boolean elimination
16:51:16
drmeister
I thought I generated more code for the eql test in fastgf - but I adopted a hybrid approach to get things up and running.
16:51:47
drmeister
That inlines an EQ test and if that fails punts and calls cc_eql - that will be inlined in COMPILE-FILE'd code.
17:03:08
drmeister
cc_eql doesn't currently do the EQ test because that is in the generated code - but it could be made to do that.
17:03:49
drmeister
Also, it returns 1 or 0 based on the result - it needs to return <something> or NIL correct?
17:14:36
drmeister
I deferred to tx.unsafe_single_float()==ty.unsafe_single_float() because I wasn't sure.
17:22:07
Bike
this actually seems fine to me. i'll do like (declaim (inline eql)) (defun eql (x y) (or (eq x y) (whatever "cc_eql" x y)))
21:18:19
drmeister
at child.on_msg (http://0.0.0.0:8888/nbextensions/nglview-js-widgets/index.js?v=20170714202205:893:42)
22:45:45
Bike
so: i think there's a lot of room for microoptimization of basic library functions, and that i can do that most effectively if i have a typeq that isn't extremely slow
22:49:22
Bike
...and those optimizations will probably make everything a bit faster, though it's harder to gauge that impact
22:51:59
drmeister
(TYPEQ x y) where y is 'fixnum 'single-float 'character - those are just (fixnump x), (single-float-p x), (characterp x) respectively
22:53:03
Bike
if possible i'd rather not call a function at all. (or call an intrinsic that will get inlined later, i guess.)
22:55:35
drmeister
That gets turned into this for boehm/mps builds: https://github.com/drmeister/clasp/blob/dev/src/main/clasp_gc.cc#L2131
22:56:34
drmeister
I think there is a boehmdc feature - or something like that - if not, I'll add it.
22:57:57
drmeister
What we need are access to the integer ranges for the header value and a hash table that associates type specifiers (all symbols) with the header value or value range.
23:01:22
drmeister
We are about to migrate to my parents place - so I'll be out of contact for about 1-2 hours.
23:02:27
drmeister
I can give you a fast TYPEQ with a couple of hours work and a rerun of the static analyzer.
23:04:57
Bike
compiling down typeq is probably going to be more ocmplicated in the future, too, but without a primitive interface there's not much that can be done
23:07:56
Bike
because type checks will have to be moved around and done in relation to each other, i think
0:31:17
drmeister
There is currently no typeq-instruction - that is because they are being translated to typep calls - correct?
0:41:17
drmeister
I mean, the stamp values are integers that start at 1 and go up by 1 - they are shifted into position in the header value in the upper 60 bits.
0:42:03
drmeister
I can build the table so that I incorporate the flag and tag into the value ranges and then just compare header values to the value ranges in the table.
0:45:18
drmeister
The test for Symbol_O is here: https://github.com/drmeister/clasp/blob/dev/src/main/clasp_gc.cc#L2131
1:41:15
drmeister
I started up the static analyzer and it will generate a block of code that can be converted into SYMBOL -> header-value-range