From: Taylor R Campbell Date: Sun, 9 Dec 2018 00:06:10 +0000 (+0000) Subject: Rename fasdump-format -> fasl-format. X-Git-Tag: mit-scheme-pucked-10.1.9~3^2~35^2~49 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=f1ed9a7a5553766490d8b184656b28836869ef6a;p=mit-scheme.git Rename fasdump-format -> fasl-format. Only the fasdump side is implemented portably, but no reason the concept need be different. Fix up compiler package exports while here. --- diff --git a/src/compiler/base/asstop.scm b/src/compiler/base/asstop.scm index cfb5f1cd9..2aa6da19b 100644 --- a/src/compiler/base/asstop.scm +++ b/src/compiler/base/asstop.scm @@ -36,7 +36,7 @@ USA. (define (compiler-file-output object pathname) (if compiler:cross-compiling? - (portable-fasdump object pathname (target-fasdump-format)) + (portable-fasdump object pathname (target-fasl-format)) (fasdump object pathname #t))) (define (compiler-output->procedure scode environment) diff --git a/src/compiler/base/fasdump.scm b/src/compiler/base/fasdump.scm index 9354f5bb5..a2f07c5aa 100644 --- a/src/compiler/base/fasdump.scm +++ b/src/compiler/base/fasdump.scm @@ -28,10 +28,10 @@ USA. ;;;; Fasdump formats -(define-structure (fasdump-format +(define-structure (fasl-format (safe-accessors) (conc-name format.) - (keyword-constructor make-fasdump-format)) + (keyword-constructor make-fasl-format)) (version #f read-only #t) (architecture #f read-only #t) (marker #f read-only #t) @@ -50,9 +50,9 @@ USA. (write-bignum-digit #f read-only #t) (write-float #f read-only #t)) -(define (make-std-fasdump-format architecture bytes-per-word +(define (make-std-fasl-format architecture bytes-per-word write-word write-untagged-word write-bignum-digit write-float) - (make-fasdump-format + (make-fasl-format 'VERSION 10 ;FASL_VERSION_C_CODE 'ARCHITECTURE architecture 'MARKER (do ((i 0 (+ i 1)) ;#xfafafa... @@ -73,33 +73,33 @@ USA. 'WRITE-BIGNUM-DIGIT write-bignum-digit 'WRITE-FLOAT write-float)) -(define (make-std32be-fasdump-format architecture) - (make-std-fasdump-format architecture 4 - write-std32be-word - write-std32be-untagged-word - write-std32be-bignum-digit - write-ieee754-binary64-be)) - -(define (make-std32le-fasdump-format architecture) - (make-std-fasdump-format architecture 4 - write-std32le-word - write-std32le-untagged-word - write-std32le-bignum-digit - write-ieee754-binary64-le)) - -(define (make-std64be-fasdump-format architecture) - (make-std-fasdump-format architecture 8 - write-std64be-word - write-std64be-untagged-word - write-std64be-bignum-digit - write-ieee754-binary64-be)) - -(define (make-std64le-fasdump-format architecture) - (make-std-fasdump-format architecture 8 - write-std64le-word - write-std64le-untagged-word - write-std64le-bignum-digit - write-ieee754-binary64-le)) +(define (make-std32be-fasl-format architecture) + (make-std-fasl-format architecture 4 + write-std32be-word + write-std32be-untagged-word + write-std32be-bignum-digit + write-ieee754-binary64-be)) + +(define (make-std32le-fasl-format architecture) + (make-std-fasl-format architecture 4 + write-std32le-word + write-std32le-untagged-word + write-std32le-bignum-digit + write-ieee754-binary64-le)) + +(define (make-std64be-fasl-format architecture) + (make-std-fasl-format architecture 8 + write-std64be-word + write-std64be-untagged-word + write-std64be-bignum-digit + write-ieee754-binary64-be)) + +(define (make-std64le-fasl-format architecture) + (make-std-fasl-format architecture 8 + write-std64le-word + write-std64le-untagged-word + write-std64le-bignum-digit + write-ieee754-binary64-le)) ;;;; Bits @@ -211,21 +211,21 @@ USA. ;;;;; Known formats -(define fasdump-format:i386 (make-std32le-fasdump-format 6)) -(define fasdump-format:sparc32 (make-std32le-fasdump-format 14)) -(define fasdump-format:mips32be (make-std32be-fasdump-format 15)) -(define fasdump-format:mips32le (make-std32le-fasdump-format 15)) -(define fasdump-format:alpha (make-std64le-fasdump-format 18)) -(define fasdump-format:ppc32 (make-std32be-fasdump-format 20)) -(define fasdump-format:amd64 (make-std64le-fasdump-format 21)) -(define fasdump-format:arm32le (make-std32le-fasdump-format 24)) -(define fasdump-format:arm32be (make-std32le-fasdump-format 24)) -(define fasdump-format:aarch64le (make-std64le-fasdump-format 25)) -(define fasdump-format:aarch64be (make-std64be-fasdump-format 25)) +(define fasl-format:i386 (make-std32le-fasl-format 6)) +(define fasl-format:sparc32 (make-std32le-fasl-format 14)) +(define fasl-format:mips32be (make-std32be-fasl-format 15)) +(define fasl-format:mips32le (make-std32le-fasl-format 15)) +(define fasl-format:alpha (make-std64le-fasl-format 18)) +(define fasl-format:ppc32 (make-std32be-fasl-format 20)) +(define fasl-format:amd64 (make-std64le-fasl-format 21)) +(define fasl-format:arm32le (make-std32le-fasl-format 24)) +(define fasl-format:arm32be (make-std32le-fasl-format 24)) +(define fasl-format:aarch64le (make-std64le-fasl-format 25)) +(define fasl-format:aarch64be (make-std64be-fasl-format 25)) #; -(define fasdump-format:pdp10 - (make-fasdump-format +(define fasl-format:pdp10 + (make-fasl-format 'VERSION 10 ;FASL_VERSION_C_CODE 'ARCHITECTURE 1 'BITS-PER-TYPE 6 diff --git a/src/compiler/machines/C/compiler.pkg b/src/compiler/machines/C/compiler.pkg index 379405d3b..a77dd7baa 100644 --- a/src/compiler/machines/C/compiler.pkg +++ b/src/compiler/machines/C/compiler.pkg @@ -397,14 +397,17 @@ USA. (files "base/fasdump") (parent ()) ;** This code should be portable. (export (compiler) - fasdump-format:alpha - fasdump-format:amd64 - fasdump-format:arm32 - fasdump-format:i386 - fasdump-format:mips32be - fasdump-format:mips32le - fasdump-format:ppc32 - fasdump-format:sparc32 + fasl-format:aarch64be + fasl-format:aarch64le + fasl-format:alpha + fasl-format:amd64 + fasl-format:arm32be + fasl-format:arm32le + fasl-format:i386 + fasl-format:mips32be + fasl-format:mips32le + fasl-format:ppc32 + fasl-format:sparc32 portable-fasdump)) (define-package (compiler constraints) diff --git a/src/compiler/machines/C/machin.scm b/src/compiler/machines/C/machin.scm index 4dd5dc960..142dbf11a 100644 --- a/src/compiler/machines/C/machin.scm +++ b/src/compiler/machines/C/machin.scm @@ -31,7 +31,7 @@ USA. ;;;; Architecture Parameters -(define (target-fasdump-format) (error "I should not be fasdumping crap!")) +(define (target-fasl-format) (error "I should not be fasdumping crap!")) (define use-pre/post-increment? true) (define endianness 'DONT-KNOW) diff --git a/src/compiler/machines/i386/compiler.pkg b/src/compiler/machines/i386/compiler.pkg index 3313b20a9..f1fd35bcd 100644 --- a/src/compiler/machines/i386/compiler.pkg +++ b/src/compiler/machines/i386/compiler.pkg @@ -383,14 +383,17 @@ USA. (files "base/fasdump") (parent ()) ;** This code should be portable. (export (compiler) - fasdump-format:alpha - fasdump-format:amd64 - fasdump-format:arm32 - fasdump-format:i386 - fasdump-format:mips32be - fasdump-format:mips32le - fasdump-format:ppc32 - fasdump-format:sparc32 + fasl-format:aarch64be + fasl-format:aarch64le + fasl-format:alpha + fasl-format:amd64 + fasl-format:arm32be + fasl-format:arm32le + fasl-format:i386 + fasl-format:mips32be + fasl-format:mips32le + fasl-format:ppc32 + fasl-format:sparc32 portable-fasdump)) (define-package (compiler constraints) diff --git a/src/compiler/machines/i386/machin.scm b/src/compiler/machines/i386/machin.scm index dac9dd403..5de18a519 100644 --- a/src/compiler/machines/i386/machin.scm +++ b/src/compiler/machines/i386/machin.scm @@ -31,7 +31,7 @@ USA. ;;;; Architecture Parameters -(define (target-fasdump-format) fasdump-format:i386) +(define (target-fasl-format) fasl-format:i386) (define use-pre/post-increment? false) (define-integrable endianness 'LITTLE) diff --git a/src/compiler/machines/svm/compiler.pkg b/src/compiler/machines/svm/compiler.pkg index d29685761..939e5b5bb 100644 --- a/src/compiler/machines/svm/compiler.pkg +++ b/src/compiler/machines/svm/compiler.pkg @@ -383,14 +383,17 @@ USA. (files "base/fasdump") (parent ()) ;** This code should be portable. (export (compiler) - fasdump-format:alpha - fasdump-format:amd64 - fasdump-format:arm32 - fasdump-format:i386 - fasdump-format:mips32be - fasdump-format:mips32le - fasdump-format:ppc32 - fasdump-format:sparc32 + fasl-format:aarch64be + fasl-format:aarch64le + fasl-format:alpha + fasl-format:amd64 + fasl-format:arm32be + fasl-format:arm32le + fasl-format:i386 + fasl-format:mips32be + fasl-format:mips32le + fasl-format:ppc32 + fasl-format:sparc32 portable-fasdump)) (define-package (compiler constraints) diff --git a/src/compiler/machines/svm/machine.scm b/src/compiler/machines/svm/machine.scm index b6f05f54f..83fe59022 100644 --- a/src/compiler/machines/svm/machine.scm +++ b/src/compiler/machines/svm/machine.scm @@ -32,7 +32,7 @@ USA. ;;;; Architecture Parameters ;; XXX Invent an svm1 fasdump format. -(define (target-fasdump-format) fasdump-format:amd64) ;XXX +(define (target-fasl-format) fasl-format:amd64) ;XXX (define use-pre/post-increment? #t) (define-integrable endianness 'LITTLE) diff --git a/src/compiler/machines/x86-64/compiler.pkg b/src/compiler/machines/x86-64/compiler.pkg index 7ba0e980d..c06a21a57 100644 --- a/src/compiler/machines/x86-64/compiler.pkg +++ b/src/compiler/machines/x86-64/compiler.pkg @@ -383,14 +383,17 @@ USA. (files "base/fasdump") (parent ()) ;** This code should be portable. (export (compiler) - fasdump-format:alpha - fasdump-format:amd64 - fasdump-format:arm32 - fasdump-format:i386 - fasdump-format:mips32be - fasdump-format:mips32le - fasdump-format:ppc32 - fasdump-format:sparc32 + fasl-format:aarch64be + fasl-format:aarch64le + fasl-format:alpha + fasl-format:amd64 + fasl-format:arm32be + fasl-format:arm32le + fasl-format:i386 + fasl-format:mips32be + fasl-format:mips32le + fasl-format:ppc32 + fasl-format:sparc32 portable-fasdump)) (define-package (compiler constraints) diff --git a/src/compiler/machines/x86-64/machin.scm b/src/compiler/machines/x86-64/machin.scm index f69f0882b..5639974c6 100644 --- a/src/compiler/machines/x86-64/machin.scm +++ b/src/compiler/machines/x86-64/machin.scm @@ -31,7 +31,7 @@ USA. ;;;; Architecture Parameters -(define (target-fasdump-format) fasdump-format:amd64) +(define (target-fasl-format) fasl-format:amd64) (define use-pre/post-increment? false) (define-integrable endianness 'LITTLE) diff --git a/tests/compiler/test-fasdump.scm b/tests/compiler/test-fasdump.scm index d7b92d82f..5ee193829 100644 --- a/tests/compiler/test-fasdump.scm +++ b/tests/compiler/test-fasdump.scm @@ -138,24 +138,24 @@ USA. (define assert-equal-nan-scode (simple-binary-assertion equal-nan-scode? #f)) -(define fasdump-formats - `(("aarch64le" ,fasdump-format:aarch64le) - ("aarch64be" ,fasdump-format:aarch64be) - ("alpha" ,fasdump-format:alpha) - ("armbe" ,fasdump-format:arm32be) - ("armle" ,fasdump-format:arm32le) - ("ia-32" ,fasdump-format:i386) - ("mipsbe" ,fasdump-format:mips32be) - ("mipsle" ,fasdump-format:mips32le) - ("ppc32" ,fasdump-format:ppc32) - ("x86-64" ,fasdump-format:amd64))) +(define fasl-formats + `(("aarch64le" ,fasl-format:aarch64le) + ("aarch64be" ,fasl-format:aarch64be) + ("alpha" ,fasl-format:alpha) + ("armbe" ,fasl-format:arm32be) + ("armle" ,fasl-format:arm32le) + ("ia-32" ,fasl-format:i386) + ("mipsbe" ,fasl-format:mips32be) + ("mipsle" ,fasl-format:mips32le) + ("ppc32" ,fasl-format:ppc32) + ("x86-64" ,fasl-format:amd64))) -(define (host-fasdump-format) +(define (host-fasl-format) (define (try key) (any (lambda (format) (and (string-ci=? (car format) key) (cadr format))) - fasdump-formats)) + fasl-formats)) (or (try microcode-id/machine-type) (try (string-append microcode-id/machine-type @@ -298,7 +298,7 @@ USA. (,(make-scode-the-environment)) (,(make-scode-variable 'foo))) (lambda (object) - (let ((format (host-fasdump-format))) + (let ((format (host-fasl-format))) (assert format '(unknown host fasdump format)) (with-test-properties (lambda ()