Skip to content

x86-64: optimizations (nil is r14)#214

Merged
froggey merged 11 commits into
froggey:masterfrom
iskamag:r14
May 17, 2026
Merged

x86-64: optimizations (nil is r14)#214
froggey merged 11 commits into
froggey:masterfrom
iskamag:r14

Conversation

@iskamag

@iskamag iskamag commented May 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@iskamag iskamag marked this pull request as ready for review May 8, 2026 21:17
@froggey

froggey commented May 17, 2026

Copy link
Copy Markdown
Owner

Does this update the (defmethod emit-lap (backend-function (instruction ir:constant-instruction) uses defs) path? There's a special case in there for loading nil

If you wanted to be super thorough you could map over every compiled function on the system, disassemble them, then look for loads of literal nil in the output.
Something like (map nil #'disassemble (get-all-objects (lambda (obj) (%object-of-type-p obj +object-tag-function+)))) then grep the output or sth

@iskamag

iskamag commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

It did but I removed that in the "un-break" commit (don't remember why). You can re-add that in a seperate PR and see if the CI completes.

((eql value nil)
 (emit `(lap:mov32 ,(lap::convert-width dest 32) :r14)))
((eql value t)
 (emit `(lap:mov32 ,(lap::convert-width dest 32) ,value)))

Still a lot of the gains are in the stack clearing epilogue.

@iskamag

iskamag commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

Actually, why did I convert width for r14 there?

Comment thread compiler/backend/x86-64/codegen.lisp Outdated
Comment thread compiler/backend/x86-64/codegen.lisp Outdated
Comment thread compiler/backend/x86-64/codegen.lisp Outdated
@froggey froggey merged commit 3e9c6f2 into froggey:master May 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants