Search
Tuesday, 24th of November 2020, 12:17:48 UTC
14:47:12
pfdietz
It's interesting that the ML page on Wikipedia does not mention the connection to LCF (which I knew about, having been at Cornell around that time.)
23:28:28
|3b|
what's the most efficient sbcl-specific way to convert a (unsigned-byte 32) to (signed-byte 32) with same bits?
23:38:29
stassats
|3b|: SB-C::MASK-SIGNED-FIELD?
23:39:00
|3b|
and good user-level options?
23:40:31
stassats
we're not as good as gcc at detecting portable patterns
23:40:42
|3b|
i guess this would be in code using sb-kernel, so sb-c is probably ok too
23:42:29
|3b|
mask-signed-field seems to work, thanks
23:46:43
stassats
(logior x (- (mask-field (byte 1 31) x))) is not that bad
23:48:33
stassats
let's agree you use this, and i motivate myself to finally add multi-combination transforms
23:49:07
|3b|
it's sbcl specific code already using internals, but i can use the logior if you like
23:49:30
|3b|
(fixing building floats from bits in float-features)
23:49:37
stassats
well, i don't really mind that
23:49:46
stassats
but i really want a portable pattern detector
23:50:13
stassats
like in the grown up compilers
23:50:32
|3b|
yeah, fast portable version would be nice for other code
23:50:59
stassats
it's marginally slower as it is
23:51:10
stassats
(haven't tried, but looking at the code)
0:04:05
stassats
yeah, the performance difference is very minimal
0:04:53
stassats
MOVSX also has to untag/retag for fixnums
0:10:36
stassats
|3b|: but if you're building floats, maybe you need something else?
0:11:55
|3b|
i have an (unsigned-byte 32) and want a single-float (and similarly for doubles)
0:12:04
|3b|
but sbcl expects a (signed-byte 32)
0:12:14
|3b|
in sb-kernel:make-single-float
0:14:33
stassats
what's some old fashioned lying to the compiler
0:14:46
stassats
(defun foo (x) (declare ((unsigned-byte 32) x) (optimize speed)) (sb-kernel:make-single-float (truly-the (signed-byte 32) x)))
0:15:01
stassats
(foo 3240099840) => -10.0
0:17:08
|3b|
:) i think i like using internals better than lying
0:17:22
stassats
that's internals too
0:17:34
stassats
you want it to be as fast as possible?
Wednesday, 25th of November 2020, 0:17:48 UTC