Skip to content
Snippets Groups Projects
Commit b539c434 authored by dtc's avatar dtc
Browse files

Add support for dumping and loading complex-float vectors.

parent 4943ef83
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/load.lisp,v 1.65 1997/11/01 22:58:16 dtc Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/load.lisp,v 1.66 1997/11/07 19:24:04 dtc Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -905,6 +905,19 @@ ...@@ -905,6 +905,19 @@
(read-n-bytes *fasl-file* result 0 (* length vm:word-bytes 2)) (read-n-bytes *fasl-file* result 0 (* length vm:word-bytes 2))
result)) result))
#+complex-float
(define-fop (fop-complex-single-float-vector 86)
(let* ((length (read-arg 4))
(result (make-array length :element-type '(complex single-float))))
(read-n-bytes *fasl-file* result 0 (* length vm:word-bytes 2))
result))
#+complex-float
(define-fop (fop-complex-double-float-vector 87)
(let* ((length (read-arg 4))
(result (make-array length :element-type '(complex double-float))))
(read-n-bytes *fasl-file* result 0 (* length vm:word-bytes 2 2))
result))
;;; FOP-INT-VECTOR -- Internal ;;; FOP-INT-VECTOR -- Internal
;;; ;;;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/dump.lisp,v 1.65 1997/11/01 22:58:28 dtc Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/dump.lisp,v 1.66 1997/11/07 19:24:07 dtc Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -1312,6 +1312,14 @@ ...@@ -1312,6 +1312,14 @@
((simple-array double-float (*)) ((simple-array double-float (*))
(dump-double-float-vector simple-version file) (dump-double-float-vector simple-version file)
(eq-save-object x file)) (eq-save-object x file))
#+complex-float
((simple-array (complex single-float) (*))
(dump-complex-single-float-vector simple-version file)
(eq-save-object x file))
#+complex-float
((simple-array (complex double-float) (*))
(dump-complex-double-float-vector simple-version file)
(eq-save-object x file))
(t (t
(dump-i-vector simple-version file) (dump-i-vector simple-version file)
(eq-save-object x file))))) (eq-save-object x file)))))
...@@ -1434,6 +1442,26 @@ ...@@ -1434,6 +1442,26 @@
(dump-data-maybe-byte-swapping vec (* length vm:word-bytes 2) (dump-data-maybe-byte-swapping vec (* length vm:word-bytes 2)
(* vm:word-bytes 2) file))) (* vm:word-bytes 2) file)))
;;; DUMP-COMPLEX-SINGLE-FLOAT-VECTOR -- internal.
;;;
#+complex-float
(defun dump-complex-single-float-vector (vec file)
(let ((length (length vec)))
(dump-fop 'lisp::fop-complex-single-float-vector file)
(dump-unsigned-32 length file)
(dump-data-maybe-byte-swapping vec (* length vm:word-bytes 2)
vm:word-bytes file)))
;;; DUMP-COMPLEX-DOUBLE-FLOAT-VECTOR -- internal.
;;;
#+complex-float
(defun dump-complex-double-float-vector (vec file)
(let ((length (length vec)))
(dump-fop 'lisp::fop-complex-double-float-vector file)
(dump-unsigned-32 length file)
(dump-data-maybe-byte-swapping vec (* length vm:word-bytes 2 2)
(* vm:word-bytes 2) file)))
;;; DUMP-DATA-BITS-MAYBE-BYTE-SWAPPING -- internal. ;;; DUMP-DATA-BITS-MAYBE-BYTE-SWAPPING -- internal.
;;; ;;;
;;; Dump BYTES of data from DATA-VECTOR (which must be some unboxed vector) ;;; Dump BYTES of data from DATA-VECTOR (which must be some unboxed vector)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment