Skip to content
Permalink
Browse files

minor tidyup

The float vector array frobs can also be macroised, at least for now.
When we actually start having instruction sequences in the generator,
we might need to unmacroize them, or else find a way of allowing the
defining form to have a reader and a writer instruction sequence
  • Loading branch information...
csrhodes committed Aug 7, 2018
1 parent 76186a4 commit a59598999bf3f7115a59369a1ef0c6fcbe0df923
Showing with 16 additions and 39 deletions.
  1. +16 −39 src/compiler/rv32/array.lisp
@@ -60,42 +60,19 @@
(def-small-data-vector-frobs simple-array-unsigned-byte-2 2)
(def-small-data-vector-frobs simple-array-unsigned-byte-4 4))

(define-vop (data-vector-set/simple-array-single-float)
(:translate data-vector-set)
(:args (object :scs (descriptor-reg))
(index :scs (unsigned-reg))
(value :scs (single-reg)))
(:arg-types simple-array-single-float positive-fixnum single-float)
(:results (result :scs (single-reg)))
(:result-types single-float)
(:generator 5))

(define-vop (data-vector-set/simple-array-double-float)
(:translate data-vector-set)
(:args (object :scs (descriptor-reg))
(index :scs (unsigned-reg))
(value :scs (double-reg)))
(:arg-types simple-array-double-float positive-fixnum double-float)
(:results (result :scs (double-reg)))
(:result-types double-float)
(:generator 5))

(define-vop (data-vector-set/simple-array-complex-single-float)
(:translate data-vector-set)
(:args (object :scs (descriptor-reg))
(index :scs (unsigned-reg))
(value :scs (complex-single-reg)))
(:arg-types simple-array-complex-single-float positive-fixnum complex-single-float)
(:results (result :scs (complex-single-reg)))
(:result-types complex-single-float)
(:generator 5))

(define-vop (data-vector-set/simple-array-complex-double-float)
(:translate data-vector-set)
(:args (object :scs (descriptor-reg))
(index :scs (unsigned-reg))
(value :scs (complex-double-reg)))
(:arg-types simple-array-complex-double-float positive-fixnum complex-double-float)
(:results (result :scs (complex-double-reg)))
(:result-types complex-double-float)
(:generator 5))
(macrolet ((def-float-vector-frobs (type eltype sc)
(let ((setname (symbolicate "DATA-VECTOR-SET/" type)))
`(progn
(define-vop (,setname)
(:translate data-vector-set)
(:args (object :scs (descriptor-reg))
(index :scs (unsigned-reg))
(value :scs (,sc)))
(:arg-types ,type positive-fixnum ,eltype)
(:results (result :scs (,sc)))
(:result-types ,eltype)
(:generator 5))))))
(def-float-vector-frobs simple-array-single-float single-float single-reg)
(def-float-vector-frobs simple-array-double-float double-float double-reg)
(def-float-vector-frobs simple-array-complex-single-float complex-single-float complex-single-reg)
(def-float-vector-frobs simple-array-complex-double-float complex-double-float complex-double-reg))

0 comments on commit a595989

Please sign in to comment.
You can’t perform that action at this time.