Skip to content

Commit

Permalink
adjust some tab replacements that should be 8 spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
mflatt committed Nov 28, 2023
1 parent 6202677 commit 6d5c8e8
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 66 deletions.
9 changes: 4 additions & 5 deletions s/arm32.ss
Original file line number Diff line number Diff line change
Expand Up @@ -795,11 +795,11 @@
[(op (x ur) (y ur) (w imm-constant) (old ur) (new ur))
(lea->reg x y w
(lambda (r)
(let ([u1 (make-tmp 'u1)] [u2 (make-tmp 'u2)])
(let ([u1 (make-tmp 'u1)] [u2 (make-tmp 'u2)])
(seq
`(set! ,(make-live-info) ,u1 (asm ,null-info ,asm-kill))
`(set! ,(make-live-info) ,u2 (asm ,null-info ,asm-kill))
`(asm ,info ,asm-cas ,r ,old ,new ,u1 ,u2)))))]))
`(asm ,info ,asm-cas ,r ,old ,new ,u1 ,u2)))))]))

(define-instruction effect (store-store-fence)
[(op)
Expand Down Expand Up @@ -2390,9 +2390,8 @@

(module (asm-foreign-call asm-foreign-callable)
(define align (lambda (b x) (let ([k (- b 1)]) (fxlogand (fx+ x k) (fxlognot k)))))
(define (double-member? m)
(and (eq? (car m) 'float)
(fx= (cadr m) 8)))
(define (double-member? m) (and (eq? (car m) 'float)
(fx= (cadr m) 8)))
(define (float-member? m) (and (eq? (car m) 'float)
(fx= (cadr m) 4)))
(define (indirect-result-that-fits-in-registers? result-type)
Expand Down
62 changes: 31 additions & 31 deletions s/arm64.ss
Original file line number Diff line number Diff line change
Expand Up @@ -647,11 +647,11 @@
[(op (x ur) (y ur) (w imm-constant) (old ur) (new ur))
(lea->reg x y w
(lambda (r)
(let ([u1 (make-tmp 'u1)] [u2 (make-tmp 'u2)])
(let ([u1 (make-tmp 'u1)] [u2 (make-tmp 'u2)])
(seq
`(set! ,(make-live-info) ,u1 (asm ,null-info ,asm-kill))
`(set! ,(make-live-info) ,u2 (asm ,null-info ,asm-kill))
`(asm ,info ,asm-cas ,r ,old ,new ,u1 ,u2)))))]))
`(asm ,info ,asm-cas ,r ,old ,new ,u1 ,u2)))))]))

(define-instruction effect (store-store-fence)
[(op)
Expand Down Expand Up @@ -2238,7 +2238,7 @@
(define build-bop-seq
(lambda (bop opnd1 opnd2 l2 body)
#`(let ([code* (emit #,bop #,opnd1 code*)])
(safe-assert (= (asm-size* code*) #,b-asm-size))
(safe-assert (= (asm-size* code*) #,b-asm-size))
(let-values ([(ignore #,opnd2) (get-disp-opnd (fx+ next-addr #,b-asm-size) #,l2)])
#,body))))
(define ops->code
Expand Down Expand Up @@ -2268,8 +2268,8 @@
(handle-reverse #'c1 #'opnd2 #'l2))]
[else
(let ([code* #,(build-bop-seq #'b #'opnd1 #'opnd2 #'l2
#'(emit b opnd2 code*))])
#,(handle-reverse #'c2 #``(imm #,b-asm-size) #'step))])]
#'(emit b opnd2 code*))])
#,(handle-reverse #'c2 #``(imm #,b-asm-size) #'step))])]
[_ ($oops 'handle-inverse "expected an inverse in ~s" e)])))
(syntax-case x ()
[(_ [(pred ...) cl-body] ...)
Expand Down Expand Up @@ -2346,16 +2346,16 @@
;; When `n` fits in a fixnum, the compiler may generate
;; a bad shift that is under a guard, so force it to 63 bits
(let ([n (fxand n 63)])
(cond
[(fx= n 0)
;; shift by 0 is just a move
(emit mov dest src0 code*)]
[else
(case op
[(sll) (emit lsli dest src0 n code*)]
[(srl) (emit lsri dest src0 n code*)]
[(sra) (emit asri dest src0 n code*)]
[else (sorry! 'shiftop "unrecognized ~s" op)])]))]
(cond
[(fx= n 0)
;; shift by 0 is just a move
(emit mov dest src0 code*)]
[else
(case op
[(sll) (emit lsli dest src0 n code*)]
[(srl) (emit lsri dest src0 n code*)]
[(sra) (emit asri dest src0 n code*)]
[else (sorry! 'shiftop "unrecognized ~s" op)])]))]
[else
(case op
[(sll) (emit lsl dest src0 src1 code*)]
Expand Down Expand Up @@ -2400,22 +2400,22 @@
(module (asm-foreign-call asm-foreign-callable)
(define align (lambda (b x) (let ([k (- b 1)]) (fxlogand (fx+ x k) (fxlognot k)))))
(define (double-member? m) (and (eq? (car m) 'float)
(fx= (cadr m) 8)))
(fx= (cadr m) 8)))
(define (float-member? m) (and (eq? (car m) 'float)
(fx= (cadr m) 4)))
(fx= (cadr m) 4)))
(define (indirect-result-that-fits-in-registers? result-type)
(nanopass-case (Ltype Type) result-type
[(fp-ftd& ,ftd)
(let* ([members ($ftd->members ftd)]
[num-members (length members)])
(or (fx<= ($ftd-size ftd) 4)
(and (fx= num-members 1)
;; a struct containing only int64 is not returned in a register
(or (not ($ftd-compound? ftd))))
(and (fx<= num-members 4)
(or (andmap double-member? members)
(andmap float-member? members)))))]
[else #f]))
(let* ([members ($ftd->members ftd)]
[num-members (length members)])
(or (fx<= ($ftd-size ftd) 4)
(and (fx= num-members 1)
;; a struct containing only int64 is not returned in a register
(or (not ($ftd-compound? ftd))))
(and (fx<= num-members 4)
(or (andmap double-member? members)
(andmap float-member? members)))))]
[else #f]))
(define int-argument-regs (list %Carg1 %Carg2 %Carg3 %Carg4
%Carg5 %Carg6 %Carg7 %Carg8))
(define fp-argument-regs (list %Cfparg1 %Cfparg2 %Cfparg3 %Cfparg4
Expand Down Expand Up @@ -3270,10 +3270,10 @@
`(set! ,%Cretval ,x))])))
(lambda (info)
(define callee-save-regs+lr (cons* %lr
;; reserved:
%tc %sfp %ap %trap
;; allocable:
(get-allocable-callee-save-regs 'uptr)))
;; reserved:
%tc %sfp %ap %trap
;; allocable:
(get-allocable-callee-save-regs 'uptr)))
(define callee-save-fpregs (get-allocable-callee-save-regs 'fp))
(define isaved (length callee-save-regs+lr))
(define fpsaved (length callee-save-fpregs))
Expand Down
40 changes: 20 additions & 20 deletions s/ppc32.ss
Original file line number Diff line number Diff line change
Expand Up @@ -696,10 +696,10 @@
[(op (x ur) (y ur) (w imm-constant) (old ur) (new ur))
(lea->reg x y w
(lambda (base index)
(let ([u (make-tmp 'u)])
(let ([u (make-tmp 'u)])
(seq
`(set! ,(make-live-info) ,u (asm ,null-info ,asm-kill))
`(asm ,info ,asm-cas ,base ,index ,old ,new ,u)))))]))
`(asm ,info ,asm-cas ,base ,index ,old ,new ,u)))))]))

(define-instruction effect (pause)
[(op) `(asm ,info ,asm-isync)])
Expand Down Expand Up @@ -2158,7 +2158,7 @@
(define (indirect-result-that-fits-in-registers? result-type)
(nanopass-case (Ltype Type) result-type
[(fp-ftd& ,ftd) (not ($ftd-compound? ftd))]
[else #f]))
[else #f]))
(define (indirect-result-to-pointer result-type arg-type*)
(constant-case machine-type-name
[(ppc32osx tppc32osx)
Expand Down Expand Up @@ -2225,11 +2225,11 @@
(define load-indirect-int-stack
(lambda (offset size)
(lambda (rhs) ; requires rhs
(let ([int-type (case size
[(1) 'integer-8]
[(2) 'integer-16]
[else 'integer-32])])
`(set! ,(%mref ,%sp ,offset) (inline ,(make-info-load int-type #f) ,%load ,rhs ,%zero (immediate ,0)))))))
(let ([int-type (case size
[(1) 'integer-8]
[(2) 'integer-16]
[else 'integer-32])])
`(set! ,(%mref ,%sp ,offset) (inline ,(make-info-load int-type #f) ,%load ,rhs ,%zero (immediate ,0)))))))
(define load-indirect-int64-stack
(lambda (offset)
(lambda (x) ; requires var
Expand Down Expand Up @@ -2748,12 +2748,12 @@
,(do-indirect-result-from-registers ftd fill-stash-offset)))))]
[else (values (reg-list) 0 (lambda (e) e))]))
(nanopass-case (Ltype Type) result-type
[(fp-double-float) (handle-64-bit)]
[(fp-single-float) (handle-32-bit)]
[(fp-integer ,bits) (handle-integer-cases bits)]
[(fp-integer ,bits) (handle-integer-cases bits)]
[(fp-ftd& ,ftd) (handle-ftd&-case ftd)]
[else (values (reg-list %Cretval) 0 (lambda (e) e))]))
[(fp-double-float) (handle-64-bit)]
[(fp-single-float) (handle-32-bit)]
[(fp-integer ,bits) (handle-integer-cases bits)]
[(fp-integer ,bits) (handle-integer-cases bits)]
[(fp-ftd& ,ftd) (handle-ftd&-case ftd)]
[else (values (reg-list %Cretval) 0 (lambda (e) e))]))
(let ()
(define handle-integer-cases
(lambda (bits)
Expand All @@ -2777,12 +2777,12 @@
,(do-indirect-result-from-registers ftd fill-stash-offset)))))]
[else (values (reg-list) 0 (lambda (e) e))]))
(nanopass-case (Ltype Type) result-type
[(fp-double-float) (values (reg-list) 1 (lambda (e) e))]
[(fp-single-float) (values (reg-list) 1 (lambda (e) e))]
[(fp-integer ,bits) (handle-integer-cases bits)]
[(fp-unsigned ,bits) (handle-integer-cases bits)]
[(fp-ftd& ,ftd) (handle-ftd&-case ftd)]
[else (values (reg-list %Cretval) 0 (lambda (e) e))]))))
[(fp-double-float) (values (reg-list) 1 (lambda (e) e))]
[(fp-single-float) (values (reg-list) 1 (lambda (e) e))]
[(fp-integer ,bits) (handle-integer-cases bits)]
[(fp-unsigned ,bits) (handle-integer-cases bits)]
[(fp-ftd& ,ftd) (handle-ftd&-case ftd)]
[else (values (reg-list %Cretval) 0 (lambda (e) e))]))))
(define do-indirect-result-from-registers
(lambda (ftd offset)
(let ([tmp %Carg8])
Expand Down
4 changes: 2 additions & 2 deletions s/x86.ss
Original file line number Diff line number Diff line change
Expand Up @@ -2463,14 +2463,14 @@
[(4)
(cond
[(and (if-feature windows (not ($ftd-compound? ftd)) #t)
(equal? '((float 4 0)) ($ftd->members ftd)))
(equal? '((float 4 0)) ($ftd->members ftd)))
`(set! ,(%mref ,%ecx ,%zero 0 fp) ,(%inline fstps))]
[else
`(set! ,(%mref ,%ecx 0) ,%eax)])]
[(8)
(cond
[(and (if-feature windows (not ($ftd-compound? ftd)) #t)
(equal? '((float 8 0)) ($ftd->members ftd)))
(equal? '((float 8 0)) ($ftd->members ftd)))
`(set! ,(%mref ,%ecx ,%zero 0 fp) ,(%inline fstpl))]
[else
`(seq
Expand Down
16 changes: 8 additions & 8 deletions s/x86_64.ss
Original file line number Diff line number Diff line change
Expand Up @@ -3212,14 +3212,14 @@ incoming | incoming return address | one quad
(nanopass-case (Ltype Type) (car types)
[(fp-double-float) (load-double-stack isp)]
[(fp-single-float) (load-single-stack isp)]
[(fp-ftd& ,ftd)
(cond
[(memq ($ftd-size ftd) '(1 2 4 8))
;; passed by value
(load-stack-address isp)]
[else
;; passed by reference
(load-int-stack (car types) isp)])]
[(fp-ftd& ,ftd)
(cond
[(memq ($ftd-size ftd) '(1 2 4 8))
;; passed by value
(load-stack-address isp)]
[else
;; passed by reference
(load-int-stack (car types) isp)])]
[else (load-int-stack (car types) isp)])
locs)
(fx+ isp 8))))
Expand Down

0 comments on commit 6d5c8e8

Please sign in to comment.