Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hoax-plus/compile-ops.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@
(Mov r9 (Mem r8 (- type-vect)))
(Cmp r10 r9)
(Jge 'err)
(Sar r10 1) ; convert to byte offset
(Mov (Mem r8 r10 (- 8 type-vect)) rax)
(Sar r10 1) ; convert to byte offset
(Mov (Mem r8 r10 (- 8 type-vect)) rax)
(Mov rax (value->bits (void))))]))

(define (type-pred mask type)
Expand Down
4 changes: 2 additions & 2 deletions iniquity-plus/compile-ops.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@
(Mov r9 (Mem r8 (- type-vect)))
(Cmp r10 r9)
(Jge 'err)
(Sar r10 1) ; convert to byte offset
(Mov (Mem r8 r10 (- 8 type-vect)) rax)
(Sar r10 1) ; convert to byte offset
(Mov (Mem r8 r10 (- 8 type-vect)) rax)
(Mov rax (value->bits (void))))]))

(define (type-pred mask type)
Expand Down
2 changes: 1 addition & 1 deletion iniquity-plus/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
(list ys (cons g gs) (App g es))])])])]
[(list-rest (? symbol? g) sr)
(match (parse-es/acc sr fs xs ys gs)
[(list ys s es)
[(list ys gs es)
(list ys (if (memq g fs) gs (cons g gs)) (App g es))])]
[_
(error "parse error" s)]))
Expand Down
3 changes: 3 additions & 0 deletions knock-plus/ast.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
;; | (Box Pat)
;; | (Cons Pat Pat)
;; | (Conj Pat Pat)
;; | (List [Listof Pat])
;; | (Vect [Listof Pat])
;; | (Pred Id)

(struct Eof () #:prefab)
(struct Lit (d) #:prefab)
Expand Down
12 changes: 6 additions & 6 deletions knock-plus/compile-ops.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@
(Mov r9 (Mem r8 (- type-vect)))
(Cmp r10 r9)
(Jge 'err)
(Sar r10 1) ; convert to byte offset
(Mov (Mem r8 r10 (- 8 type-vect)) rax)
(Sar r10 1) ; convert to byte offset
(Mov (Mem r8 r10 (- 8 type-vect)) rax)
(Mov rax (value->bits (void))))]))

;; OpN Natural -> Asm
Expand All @@ -234,9 +234,9 @@
(compile-op-list n))]
['vector
(match n
[0 (seq (Mov rax type-vect))]
[0 (seq (Lea rax (Mem 'empty type-vect)))]
[n (seq (compile-op-vect n)
(Mov r9 n)
(Mov r9 (value->bits n))
(Mov (Mem rbx) r9)
(Mov rax rbx)
(Xor rax type-vect)
Expand All @@ -246,8 +246,8 @@
(match n
[0 (seq)]
[n (seq (Pop r9)
(Mov (Mem rbx) 'rax)
(Mov (Mem rbx 8) 'r9)
(Mov (Mem rbx 8) rax)
(Mov (Mem rbx 0) r9)
(Mov rax rbx)
(Xor rax type-cons)
(Add rbx 16)
Expand Down
2 changes: 1 addition & 1 deletion knock-plus/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
(list ys (cons g gs) (App g es))])])])]
[(list-rest (? symbol? g) sr)
(match (parse-es/acc sr fs xs ys gs)
[(list ys s es)
[(list ys gs es)
(list ys (if (memq g fs) gs (cons g gs)) (App g es))])]
[_
(error "parse error" s)]))
Expand Down