Commit 26bb63fb authored by Guy Watson's avatar Guy Watson
Browse files

Add 'nop'

parent a648fbfd
......@@ -6,7 +6,7 @@ A list of instructions that need to be or are implemented in Xsmith
Control Instructions
--------------------
[ ] unreachable
[ ] nop
[*] nop
[*] block
[*] loop
[*] if
......
......@@ -50,6 +50,7 @@
#:prop may-be-generated #f]
[LiteralInt Expr ([v = (random 10000)])
#:prop choice-weight 3]
[Noop Expr ([e : Expr])]
[Binop Expr ()
#:prop choice-weight 30 ;; default is 10
#:prop may-be-generated #f]
......@@ -183,6 +184,7 @@
(λ (n t)
(hash 'root (fresh-type-variable)))]]
[LiteralInt [int (no-child-types)]]
[Noop [int (λ (n t) (hash 'e int))]]
[Binop [(fresh-type-variable int #|float|#)
(λ (n t)
(hash 'l t
......@@ -327,6 +329,9 @@
(local ,@(make-list (ast-child 'localcount n) 'i32))
,@(render-node (ast-child 'root n))))]
[LiteralInt (λ (n) (list 'i32.const (ast-child 'v n)))]
[Noop (λ (n) (append
'(nop)
(render-node (ast-child 'e n))))]
[Binop (λ (n) (append
(render-node (ast-child 'l n))
(render-node (ast-child 'r n))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment