-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds several new Primus Lisp primitives and new instructions
This commit adds three new primitives that could be used in definition instruction semantics: - invoke-subroutine, especially useful for intrinsic calls - empty, which denotes empty semantics, useful for nops - special to denote special semantics, like `hlt` It also implements semantics for several missing semantics (detected with `--print-missing`), mostly nops, but there's one significant finding - the `popa` (POPA32 in llvm parlance) instruction from x86, which was surprisingly missing.
- Loading branch information
Showing
9 changed files
with
95 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(declare (context (target powerpc))) | ||
|
||
(defpackage powerpc (:use core target)) | ||
(defpackage llvm-powerpc32 (:use powerpc)) | ||
|
||
|
||
(defun NOP () | ||
(empty)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
(declare (context (target i386) (bits 32))) | ||
|
||
(require x86-common) | ||
(in-package x86-32) | ||
|
||
(defun pop (dst) | ||
(set$ dst (load-word ESP)) | ||
(+= ESP 4)) | ||
|
||
(defun POPA32 () | ||
(pop 'EDI) | ||
(pop 'ESI) | ||
(pop 'EBP) | ||
(+= ESP 4) | ||
(pop 'EBX) | ||
(pop 'EDX) | ||
(pop 'ECX) | ||
(pop 'EAX)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
(declare (context (target amd 64) (bits 64))) | ||
(require x86-common) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
(declare (context (target x86))) | ||
|
||
(defpackage x86-common (:use core target)) | ||
(defpackage x86-32 (:use x86-common)) | ||
(defpackage x86-64 (:use x86-common)) | ||
(defpackage llvm-x86 (:use x86-32)) | ||
(defpackage llvm-x86_64 (:use x86-64)) | ||
|
||
(in-package x86-common) | ||
|
||
(defun HLT () | ||
(special :hlt)) | ||
|
||
(defun NOOP () | ||
(empty)) | ||
|
||
(defun NOOPL (_ _ _ _ _) | ||
(empty)) | ||
|
||
(defun NOOPW (_ _ _ _ _) | ||
(empty)) |