forked from avanhatt/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
isaspec: generate conditional selects (bytecodealliance#126)
Generate conditional select instructions `CSel` and `CSNeg`. Updates avanhatt#35
- Loading branch information
1 parent
e6368c9
commit f31bc1c
Showing
2 changed files
with
332 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,241 @@ | ||
;; GENERATED BY `isaspec`. DO NOT EDIT!!! | ||
|
||
(spec | ||
(MInst.CSel rd cond rn rm) | ||
(provide | ||
(match | ||
cond | ||
((Le) | ||
(with | ||
(t3 t5 t7) | ||
(and | ||
(= | ||
t3 | ||
(not | ||
(and | ||
(= (:N (:flags_in result)) (:V (:flags_in result))) | ||
(= (:Z (:flags_in result)) #b0)))) | ||
(if t3 (= t5 rn) (= t7 rm)) | ||
(= rd (if t3 t5 t7))))) | ||
((Gt) | ||
(with | ||
(t3 t5 t7) | ||
(and | ||
(= t3 (and (= (:N (:flags_in result)) (:V (:flags_in result))) (= (:Z (:flags_in result)) #b0))) | ||
(if t3 (= t5 rn) (= t7 rm)) | ||
(= rd (if t3 t5 t7))))) | ||
((Lt) | ||
(with | ||
(t2 t4 t6) | ||
(and | ||
(= t2 (not (= (:N (:flags_in result)) (:V (:flags_in result))))) | ||
(if t2 (= t4 rn) (= t6 rm)) | ||
(= rd (if t2 t4 t6))))) | ||
((Ge) | ||
(with | ||
(t2 t4 t6) | ||
(and | ||
(= t2 (= (:N (:flags_in result)) (:V (:flags_in result)))) | ||
(if t2 (= t4 rn) (= t6 rm)) | ||
(= rd (if t2 t4 t6))))) | ||
((Ls) | ||
(with | ||
(t2 t4 t6) | ||
(and | ||
(= t2 (not (and (= (:C (:flags_in result)) #b1) (= (:Z (:flags_in result)) #b0)))) | ||
(if t2 (= t4 rn) (= t6 rm)) | ||
(= rd (if t2 t4 t6))))) | ||
((Hi) | ||
(with | ||
(t2 t4 t6) | ||
(and | ||
(= t2 (and (= (:C (:flags_in result)) #b1) (= (:Z (:flags_in result)) #b0))) | ||
(if t2 (= t4 rn) (= t6 rm)) | ||
(= rd (if t2 t4 t6))))) | ||
((Vc) | ||
(with | ||
(t1 t3 t5) | ||
(and | ||
(= t1 (not (= (:V (:flags_in result)) #b1))) | ||
(if t1 (= t3 rn) (= t5 rm)) | ||
(= rd (if t1 t3 t5))))) | ||
((Vs) | ||
(with | ||
(t1 t3 t5) | ||
(and (= t1 (= (:V (:flags_in result)) #b1)) (if t1 (= t3 rn) (= t5 rm)) (= rd (if t1 t3 t5))))) | ||
((Pl) | ||
(with | ||
(t1 t3 t5) | ||
(and | ||
(= t1 (not (= (:N (:flags_in result)) #b1))) | ||
(if t1 (= t3 rn) (= t5 rm)) | ||
(= rd (if t1 t3 t5))))) | ||
((Mi) | ||
(with | ||
(t1 t3 t5) | ||
(and (= t1 (= (:N (:flags_in result)) #b1)) (if t1 (= t3 rn) (= t5 rm)) (= rd (if t1 t3 t5))))) | ||
((Lo) | ||
(with | ||
(t1 t3 t5) | ||
(and | ||
(= t1 (not (= (:C (:flags_in result)) #b1))) | ||
(if t1 (= t3 rn) (= t5 rm)) | ||
(= rd (if t1 t3 t5))))) | ||
((Hs) | ||
(with | ||
(t1 t3 t5) | ||
(and (= t1 (= (:C (:flags_in result)) #b1)) (if t1 (= t3 rn) (= t5 rm)) (= rd (if t1 t3 t5))))) | ||
((Ne) | ||
(with | ||
(t1 t3 t5) | ||
(and | ||
(= t1 (not (= (:Z (:flags_in result)) #b1))) | ||
(if t1 (= t3 rn) (= t5 rm)) | ||
(= rd (if t1 t3 t5))))) | ||
((Eq) | ||
(with | ||
(t1 t3 t5) | ||
(and (= t1 (= (:Z (:flags_in result)) #b1)) (if t1 (= t3 rn) (= t5 rm)) (= rd (if t1 t3 t5))))))) | ||
(require | ||
(match | ||
cond | ||
((Le) true) | ||
((Gt) true) | ||
((Lt) true) | ||
((Ge) true) | ||
((Ls) true) | ||
((Hi) true) | ||
((Vc) true) | ||
((Vs) true) | ||
((Pl) true) | ||
((Mi) true) | ||
((Lo) true) | ||
((Hs) true) | ||
((Ne) true) | ||
((Eq) true)))) | ||
|
||
(spec | ||
(MInst.CSNeg rd cond rn rm) | ||
(provide | ||
(match | ||
cond | ||
((Le) | ||
(with | ||
(t3 t5 t7) | ||
(and | ||
(= | ||
t3 | ||
(not | ||
(and | ||
(= (:N (:flags_in result)) (:V (:flags_in result))) | ||
(= (:Z (:flags_in result)) #b0)))) | ||
(if t3 (= t5 rn) (= t7 (bvadd (bvnot rm) #x0000000000000001))) | ||
(= rd (if t3 t5 t7))))) | ||
((Gt) | ||
(with | ||
(t3 t5 t7) | ||
(and | ||
(= t3 (and (= (:N (:flags_in result)) (:V (:flags_in result))) (= (:Z (:flags_in result)) #b0))) | ||
(if t3 (= t5 rn) (= t7 (bvadd (bvnot rm) #x0000000000000001))) | ||
(= rd (if t3 t5 t7))))) | ||
((Lt) | ||
(with | ||
(t2 t4 t6) | ||
(and | ||
(= t2 (not (= (:N (:flags_in result)) (:V (:flags_in result))))) | ||
(if t2 (= t4 rn) (= t6 (bvadd (bvnot rm) #x0000000000000001))) | ||
(= rd (if t2 t4 t6))))) | ||
((Ge) | ||
(with | ||
(t2 t4 t6) | ||
(and | ||
(= t2 (= (:N (:flags_in result)) (:V (:flags_in result)))) | ||
(if t2 (= t4 rn) (= t6 (bvadd (bvnot rm) #x0000000000000001))) | ||
(= rd (if t2 t4 t6))))) | ||
((Ls) | ||
(with | ||
(t2 t4 t6) | ||
(and | ||
(= t2 (not (and (= (:C (:flags_in result)) #b1) (= (:Z (:flags_in result)) #b0)))) | ||
(if t2 (= t4 rn) (= t6 (bvadd (bvnot rm) #x0000000000000001))) | ||
(= rd (if t2 t4 t6))))) | ||
((Hi) | ||
(with | ||
(t2 t4 t6) | ||
(and | ||
(= t2 (and (= (:C (:flags_in result)) #b1) (= (:Z (:flags_in result)) #b0))) | ||
(if t2 (= t4 rn) (= t6 (bvadd (bvnot rm) #x0000000000000001))) | ||
(= rd (if t2 t4 t6))))) | ||
((Vc) | ||
(with | ||
(t1 t3 t5) | ||
(and | ||
(= t1 (not (= (:V (:flags_in result)) #b1))) | ||
(if t1 (= t3 rn) (= t5 (bvadd (bvnot rm) #x0000000000000001))) | ||
(= rd (if t1 t3 t5))))) | ||
((Vs) | ||
(with | ||
(t1 t3 t5) | ||
(and | ||
(= t1 (= (:V (:flags_in result)) #b1)) | ||
(if t1 (= t3 rn) (= t5 (bvadd (bvnot rm) #x0000000000000001))) | ||
(= rd (if t1 t3 t5))))) | ||
((Pl) | ||
(with | ||
(t1 t3 t5) | ||
(and | ||
(= t1 (not (= (:N (:flags_in result)) #b1))) | ||
(if t1 (= t3 rn) (= t5 (bvadd (bvnot rm) #x0000000000000001))) | ||
(= rd (if t1 t3 t5))))) | ||
((Mi) | ||
(with | ||
(t1 t3 t5) | ||
(and | ||
(= t1 (= (:N (:flags_in result)) #b1)) | ||
(if t1 (= t3 rn) (= t5 (bvadd (bvnot rm) #x0000000000000001))) | ||
(= rd (if t1 t3 t5))))) | ||
((Lo) | ||
(with | ||
(t1 t3 t5) | ||
(and | ||
(= t1 (not (= (:C (:flags_in result)) #b1))) | ||
(if t1 (= t3 rn) (= t5 (bvadd (bvnot rm) #x0000000000000001))) | ||
(= rd (if t1 t3 t5))))) | ||
((Hs) | ||
(with | ||
(t1 t3 t5) | ||
(and | ||
(= t1 (= (:C (:flags_in result)) #b1)) | ||
(if t1 (= t3 rn) (= t5 (bvadd (bvnot rm) #x0000000000000001))) | ||
(= rd (if t1 t3 t5))))) | ||
((Ne) | ||
(with | ||
(t1 t3 t5) | ||
(and | ||
(= t1 (not (= (:Z (:flags_in result)) #b1))) | ||
(if t1 (= t3 rn) (= t5 (bvadd (bvnot rm) #x0000000000000001))) | ||
(= rd (if t1 t3 t5))))) | ||
((Eq) | ||
(with | ||
(t1 t3 t5) | ||
(and | ||
(= t1 (= (:Z (:flags_in result)) #b1)) | ||
(if t1 (= t3 rn) (= t5 (bvadd (bvnot rm) #x0000000000000001))) | ||
(= rd (if t1 t3 t5))))))) | ||
(require | ||
(match | ||
cond | ||
((Le) true) | ||
((Gt) true) | ||
((Lt) true) | ||
((Ge) true) | ||
((Ls) true) | ||
((Hi) true) | ||
((Vc) true) | ||
((Vs) true) | ||
((Pl) true) | ||
((Mi) true) | ||
((Lo) true) | ||
((Hs) true) | ||
((Ne) true) | ||
((Eq) true)))) |
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