Changeset 16007


Ignore:
Timestamp:
Jan 18, 2014, 1:10:26 AM (6 years ago)
Author:
gb
Message:

%make-complex-{single,double}-float for ARM. Call these functions
in COMPLEX.

When fasdumping COMPLEX objects, use REALPART/IMAGPART to access
their components. When fasloading, call COMPLEX to make the
right kind of object.

Teach EQL to compare new subtypes of COMPLEX on ARM.

When walking dynamic/static memory areas on ARM, recognize
new type scheme.

If both args are SIMPLE-STRINGs, compare them in EQUAL (not
HAIRY-EQUAL) on ARM.

Location:
branches/acode-rewrite/source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/acode-rewrite/source/level-0/ARM/arm-numbers.lisp

    r15093 r16007  
    286286    (bx lr)))
    287287
     288(defarmlapfunction %make-complex-double-float ((r arg_y) (i arg_z))
     289  (build-lisp-frame)                    ; need to use lr.
     290  (add lr r (:$ arm::misc-dfloat-offset))
     291  (fldd d0 (:@ lr (:$ 0)))
     292  (add lr i (:$ arm::misc-dfloat-offset))
     293  (fldd d1 (:@ lr (:$ 0)))
     294  (mov imm0 (:$ (ash arm::complex-double-float.element-count arm::num-subtag-bits)))
     295  (orr imm0 imm0 (:$ arm::subtag-complex-double-float))
     296  (sub allocptr allocptr (:$ (- arm::complex-double-float.size arm::fulltag-misc)))
     297  (ldr arg_z (:@ rcontext (:$ arm::tcr.save-allocbase)))
     298  (cmp allocptr arg_z)
     299  (bhi @no-trap)
     300  (uuo-alloc-trap)
     301  @no-trap
     302  (str imm0 (:@ allocptr (:$ arm::misc-header-offset)))
     303  (mov arg_z allocptr)
     304  (bic allocptr allocptr (:$ arm::fulltagmask))
     305  (add lr arg_z (:$ arm::complex-double-float.realpart))
     306  (fstd d0 (:@ lr (:$ 0)))
     307  (fstd d1 (:@ lr (:$ (- arm::complex-double-float.imagpart arm::complex-double-float.realpart))))
     308  (return-lisp-frame))
     309
     310(defarmlapfunction %make-complex-single-float ((r arg_y) (i arg_z))
     311  (build-lisp-frame)                    ; need to use lr.
     312  (add lr r (:$ arm::misc-data-offset))
     313  (flds s0 (:@ lr (:$ 0)))
     314  (add lr i (:$ arm::misc-data-offset))
     315  (flds s1 (:@ lr (:$ 0)))
     316  (mov imm0 (:$ (ash arm::complex-single-float.element-count arm::num-subtag-bits)))
     317  (orr imm0 imm0 (:$ arm::subtag-complex-single-float))
     318  (sub allocptr allocptr (:$ (- arm::complex-single-float.size arm::fulltag-misc)))
     319  (ldr arg_z (:@ rcontext (:$ arm::tcr.save-allocbase)))
     320  (cmp allocptr arg_z)
     321  (bhi @no-trap)
     322  (uuo-alloc-trap)
     323  @no-trap
     324  (str imm0 (:@ allocptr (:$ arm::misc-header-offset)))
     325  (mov arg_z allocptr)
     326  (bic allocptr allocptr (:$ arm::fulltagmask))
     327  (add lr arg_z (:$ arm::complex-single-float.realpart))
     328  (fstd d0 (:@ lr (:$ 0)))
     329  (return-lisp-frame))
     330               
    288331; End of arm-numbers.lisp
  • branches/acode-rewrite/source/level-0/ARM/arm-utils.lisp

    r15854 r16007  
    140140    (movls header (:lsr header (:$ 1)))
    141141    (bls @bump)
    142     (cmp subtag (:$ arm::subtag-double-float-vector))
    143     (movls header (:lsl header (:$ 1)))
    144     (bls @bump)
    145     (mov header (:lsr header (:$ 2)))
    146     (add header header (:$ 7))
    147     (mov header (:lsr header (:$ 3)))
     142    (cmp subtag (:$ arm::subtag-complex-double-float-vector))
     143    (moveq header (:lsl header (:$ 2)))
     144    (beq @bump)
     145    (cmp subtag (:$ arm::subtag-bit-vector))
     146    (moveq header (:lsr header (:$ 2)))
     147    (addeq header header (:$ 7))
     148    (moveq header (:lsr header (:$ 3)))
     149    (movne header (:lsl header (:$ 1)))
    148150    @bump
    149151    (add header header (:$ (+ 4 7)))
     
    243245    (movls header (:lsr header (:$ 1)))
    244246    (bls @bump)
    245     (cmp subtag (:$ arm::subtag-double-float-vector))
    246     (movls header (:lsl header (:$ 1)))
    247     (bls @bump)
    248     (mov header (:lsr header (:$ 2)))
    249     (add header header (:$ 7))
    250     (mov header (:lsr header (:$ 3)))
     247    (cmp subtag (:$ arm::subtag-complex-double-float-vector))
     248    (moveq header (:lsl header (:$ 2)))
     249    (beq @bump)
     250    (cmp subtag (:$ arm::subtag-bit-vector))
     251    (moveq header (:lsr header (:$ 2)))
     252    (addeq header header (:$ 7))
     253    (moveq header (:lsr header (:$ 3)))
     254    (movne header (:lsl header (:$ 1)))
    251255    @bump
    252256    (mov imm2 obj)
  • branches/acode-rewrite/source/level-0/l0-numbers.lisp

    r16002 r16007  
    16031603    (short-float
    16041604      (number-case imagpart
    1605          (short-float (canonical-complex realpart imagpart))
    1606          (double-float (canonical-complex (%double-float realpart) imagpart))
    1607          (rational (canonical-complex realpart (%short-float imagpart)))))
     1605         (short-float (%make-complex-single-float realpart imagpart))
     1606         (double-float (%make-complex-double-float (%double-float realpart) imagpart))
     1607         (rational (%make-complex-single-float realpart (%short-float imagpart)))))
    16081608    (double-float
    16091609     (number-case imagpart
    1610        (double-float (canonical-complex
    1611                       (the double-float realpart)
    1612                       (the double-float imagpart)))
    1613        (short-float (canonical-complex realpart (%double-float imagpart)))
    1614        (rational (canonical-complex
    1615                               (the double-float realpart)
    1616                               (the double-float (%double-float imagpart))))))
     1610       (double-float (%make-complex-double-float realpart imagpart))
     1611       ((short-float rational) (%make-complex-double-float  realpart (%double-float imagpart)))))
    16171612    (rational (number-case imagpart
    1618                 (double-float (canonical-complex
    1619                                (the double-float (%double-float realpart))
    1620                                (the double-float imagpart)))
    1621                 (short-float (canonical-complex (%short-float realpart) imagpart))
     1613                (double-float (%make-complex-double-float
     1614                               (%double-float realpart)
     1615                               imagpart))
     1616                (short-float (%make-complex-single-float (%short-float realpart) imagpart))
    16221617                (rational (canonical-complex realpart imagpart)))))) 
    16231618
  • branches/acode-rewrite/source/level-0/nfasload.lisp

    r15095 r16007  
    702702
    703703(deffaslop $fasl-complex (s)
    704   (let* ((c (%alloc-misc target::complex.element-count
    705                          target::subtag-complex)))
     704  (let* ((realpart (%fasl-expr s))
     705         (imagpart (%fasl-expr s))
     706         (c (complex realpart imagpart)))
    706707    (%epushval s c)
    707     (setf (%svref c target::complex.realpart-cell) (%fasl-expr s)
    708           (%svref c target::complex.imagpart-cell) (%fasl-expr s))
    709708    (setf (faslstate.faslval s) c)))
    710709
  • branches/acode-rewrite/source/lib/nfcomp.lisp

    r15582 r16007  
    16941694
    16951695(defun fasl-dump-complex (v)
    1696   (fasl-out-opcode $fasl-complex v)
    1697   (fasl-dump-form (%svref v target::complex.realpart-cell))
    1698   (fasl-dump-form (%svref v target::complex.imagpart-cell)))
     1696  (fasl-out-opcode $fasl-complex v) 
     1697  (fasl-dump-form (realpart v))
     1698  (fasl-dump-form (imagpart v)))
    16991699
    17001700(defun fasl-dump-bit-vector (v)
  • branches/acode-rewrite/source/lisp-kernel/arm-spentry.s

    r15990 r16007  
    200200        __(bx lr)
    2012013:      __(cmp imm0,#subtag_bignum)
     202        __(beq 4f)
     203        __(cmp imm0,#subtag_complex_single_float)
     204        __(cmpne imm0,#subtag_complex_double_float)
    202205        __(bne 9f)
     206        __(cmp imm0,#subtag_complex_single_float)
     207        __(moveq temp0,#2<<fixnumshift)
     208        __(moveq imm2,#complex_single_float.realpart)       
     209        __(movne temp0,#4<<fixnumshift)
     210        __(movne imm2,#complex_double_float.realpart)
     211        __(b 6f)       
     2124:             
    203213        __(getvheader(imm0,arg_y))
    204214        __(getvheader(imm1,arg_z))
     
    207217        __(header_length(temp0,imm0))
    208218        __(mov imm2,#misc_data_offset)
    209 4:      __(ldr imm0,[arg_y,imm2])
     2196:      __(ldr imm0,[arg_y,imm2])
    210220        __(ldr imm1,[arg_z,imm2])
    211221        __(cmp imm0,imm1)
     
    213223        __(add imm2,imm2,#node_size)
    214224        __(subs temp0,temp0,#fixnumone)
    215         __(bne 4b)               
     225        __(bne 6b)               
    2162268:      __(mov arg_z,#nil_value)
    217227        __(add arg_z,arg_z,#t_offset)
Note: See TracChangeset for help on using the changeset viewer.