Recent submissions

Comment · 8 months ago
I did that to write simd routines for sbcl: https://github.com/sbcl/sbcl/blob/master/src/code/arm64-simd... Probably the best way of writing assembly, can evaluate the function immediately, use macros and any other code to emit instructions, even can print register values (instruction-level stepping would be even better, but too much work).
Comment · 8 months ago
Still 40 years to go.
Comment · 8 months ago
I have also seen some outright crashes on the new GC.
Comment · 11 months ago
The tricks to avoid multiplication (and division) are probably worth a whole post.

  x * 6:
  lea eax, [rdi+rdi*2]
  add eax, eax

  x * 7:
  lea eax, [0+rdi*8]
  sub eax, edi
  
  x * 11:
  lea eax, [rdi+rdi*4]
  lea eax, [rdi+rax*2]
But with -Os you get imul eax, edi, 6

And on modern CPUs multiplication might not be actually all that slow (but there may be fewer multiply units).

Comment · 11 months ago
The text mentions that it can also do multiplication but doesn't expand on that.

E.g. for x * 5 gcc issues lea eax, [rdi+rdi*4].

Comment · 1 year ago
ABCL is really slow.
Comment · 1 year ago
A good strategy if you don't care about fixing bugs.
Comment · 1 year ago
That shouldn't mean that it doesn't return a NaN. Things are generally not optimized away because of NaNs. E.g. in GCC, abs(c) > -1.0 is not folded, unless building with -ffast-math
Comment · 1 year ago
That fix has limited applicability. x * x is also a non-negative float. But abs(x * x) is not optimized. Or abs(abs(x)+1). GCC, for example, does know that.
Comment · 1 year ago
(+ 2 (id "2")) may also produce a compile time warning. Nothing precludes from having a special rule for that. Like (+ 2 (print "2")) does warn.
Comment · 1 year ago
> changes in the Qt project made the technique used by the Qt4 bindings impractical for Qt5 or Qt6 - at least that was my understanding when I looked into it.

It was hard to do reasonably with qt4 already. The best solution would be to support the C++ ABI natively, but that's never going to happen.

Comment · 1 year ago
> Why does SBCL not use LLVM?

Why doesn't GCC use LLVM? Why is Zig writing their own backend?

Comment · 1 year ago
> lack of tail-call elimination

But lisp doesn't need TCO.

Comment · 1 year ago
You can turn them back into rationals, (rational (sqrt 2d0)) => 6369051672525773/4503599627370496

Or write your own operations that compute to the precision you want.

Comment · 1 year ago
>(safety 0)

Please, don't do that!

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton