|
37 | 37 | (error n "expects register or offset; given ~v" a2)) |
38 | 38 | (values a a1 a2))) |
39 | 39 |
|
40 | | -(define check:arith |
| 40 | +(define check:arith |
41 | 41 | (λ (a a1 a2 n) |
42 | 42 | (unless (register? a1) |
43 | 43 | (error n "expects register; given ~v" a1)) |
|
88 | 88 | (unless (or (and (exact-integer? a2) (<= 0 a2 63)) |
89 | 89 | (eq? 'cl a2)) |
90 | 90 | (error n "expects exact integer in [0,63]; given ~v" a2)) |
91 | | - (values a a1 a2))) |
| 91 | + (values a a1 a2))) |
92 | 92 |
|
93 | 93 | (define check:offset |
94 | 94 | (λ (a r i n) |
|
150 | 150 | (syntax-case stx () |
151 | 151 | [(instruct Name (x ...) guard) |
152 | 152 | (with-syntax ([Name? (datum->syntax stx (string->symbol (string-append (symbol->string (syntax->datum #'Name)) "?")))]) |
153 | | - #'(begin (provide Name Name?) |
| 153 | + #'(begin (provide Name Name?) |
154 | 154 | (define-match-expander Name |
155 | 155 | (lambda (stx) |
156 | 156 | (syntax-case stx () |
|
170 | 170 | (struct->vector i2)))) |
171 | 171 | (define hash-proc (λ (i hash) (hash (struct->vector i)))) |
172 | 172 | (define hash2-proc (λ (i hash) (hash (struct->vector i))))] |
173 | | - |
| 173 | + |
174 | 174 | #:property prop:custom-print-quotable 'never |
175 | 175 | #:methods gen:custom-write |
176 | 176 | [(define write-proc |
177 | 177 | (instr-print 'Name) |
178 | 178 | #;(make-constructor-style-printer |
179 | | - (lambda (obj) 'Name) |
| 179 | + (lambda (obj) 'Name) |
180 | 180 | (lambda (obj) |
181 | 181 | (rest (rest (vector->list (struct->vector obj)))))))]) |
182 | 182 | (define Name? %Name?)))])) |
|
212 | 212 | (instruct Sub (dst src) check:arith) |
213 | 213 | (instruct Cmp (a1 a2) check:src-dest) |
214 | 214 | (instruct Jmp (x) check:target) |
| 215 | +(instruct Jz (x) check:target) |
| 216 | +(instruct Jnz (x) check:target) |
215 | 217 | (instruct Je (x) check:target) |
216 | 218 | (instruct Jne (x) check:target) |
217 | 219 | (instruct Jl (x) check:target) |
|
222 | 224 | (instruct Jno (x) check:target) |
223 | 225 | (instruct Jc (x) check:target) |
224 | 226 | (instruct Jnc (x) check:target) |
| 227 | +(instruct Cmovz (dst src) check:cmov) |
| 228 | +(instruct Cmovnz (dst src) check:cmov) |
225 | 229 | (instruct Cmove (dst src) check:cmov) |
226 | 230 | (instruct Cmovne (dst src) check:cmov) |
227 | 231 | (instruct Cmovl (dst src) check:cmov) |
|
237 | 241 | (instruct Xor (dst src) check:src-dest) |
238 | 242 | (instruct Sal (dst i) check:shift) |
239 | 243 | (instruct Sar (dst i) check:shift) |
| 244 | +(instruct Shl (dst i) check:shift) |
| 245 | +(instruct Shr (dst i) check:shift) |
240 | 246 | (instruct Push (a1) check:push) |
| 247 | +(instruct Pop (a1) check:register) |
241 | 248 | (instruct Pushf () check:none) |
242 | 249 | (instruct Popf () check:none) |
243 | | -(instruct Pop (a1) check:register) |
244 | 250 | (instruct Lea (dst x) check:lea) |
245 | 251 | (instruct Not (x) check:register) |
246 | 252 | (instruct Div (den) check:register) |
|
340 | 346 | [(cons (Label s) asm) |
341 | 347 | (cons s (label-decls asm))] |
342 | 348 | [(cons (Extern s) asm) |
343 | | - (cons s (label-decls asm))] |
| 349 | + (cons s (label-decls asm))] |
344 | 350 | [(cons _ asm) |
345 | 351 | (label-decls asm)])) |
346 | 352 |
|
|
370 | 376 | [(cons (Call (? label? s)) asm) |
371 | 377 | (cons s (label-uses asm))] |
372 | 378 | [(cons (Lea _ (? label? s)) asm) |
373 | | - (cons s (label-uses asm))] |
| 379 | + (cons s (label-uses asm))] |
374 | 380 | [(cons _ asm) |
375 | 381 | (label-uses asm)])) |
376 | 382 |
|
|
0 commit comments