Changeset 15799 in project for chicken/trunk/c-platform.scm


Ignore:
Timestamp:
09/08/09 21:40:12 (11 years ago)
Author:
felix winkelmann
Message:

enabled compiler-syntax for map, better rewrites for add1/sub1; WARNING: not tested, yet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/c-platform.scm

    r15773 r15799  
    316316             '##core#call '(#t)
    317317             (cons* (make-node '##core#proc '("C_quotient" #t) '()) cont callargs) ) ) ) ) )
     318
     319(let ()
     320  ;; (add1 <x>) -> (##core#inline "C_fixnum_increase" <x>)     [fixnum-mode]
     321  ;; (add1 <x>) -> (##core#inline "C_u_fixnum_increase" <x>)   [fixnum-mode + unsafe]
     322  ;; (add1 <x>) -> (##core#inline_allocate ("C_a_i_plus" 4) <x> 1)
     323  ;; (sub1 <x>) -> (##core#inline "C_fixnum_decrease" <x>)     [fixnum-mode]
     324  ;; (sub1 <x>) -> (##core#inline "C_u_fixnum_decrease" <x>)   [fixnum-mode + unsafe]
     325  ;; (sub1 <x>) -> (##core#inline_allocate ("C_a_i_minus" 4) <x> 1)
     326  (define ((op1 fiop ufiop aiop) db classargs cont callargs)
     327    (and (= (length callargs) 1)
     328         (make-node
     329          '##core#call '(#t)
     330          (list
     331           cont
     332           (if (eq? 'fixnum number-type)
     333               (make-node '##core#inline (list (if unsafe ufiop fiop)) callargs)
     334               (make-node
     335                '##core#inline_allocate (list aiop 4)
     336                (list (car callargs) (qnode 1))))))))
     337  (rewrite 'add1 8 (op1 "C_fixnum_increase" "C_u_fixnum_increase" "C_a_i_plus"))
     338  (rewrite 'sub1 8 (op1 "C_fixnum_decrease" "C_u_fixnum_decrease" "C_a_i_minus")))
    318339
    319340(let ()
     
    759780(rewrite 'even? 14 'fixnum 1 "C_i_fixnumevenp" "C_i_fixnumevenp")
    760781(rewrite 'odd? 14 'fixnum 1 "C_i_fixnumoddp" "C_i_fixnumoddp")
    761 (rewrite 'add1 14 'fixnum 1 "C_fixnum_increase" "C_u_fixnum_increase")
    762 (rewrite 'sub1 14 'fixnum 1 "C_fixnum_decrease" "C_u_fixnum_decrease")
    763782(rewrite 'remainder 14 'fixnum 2 "C_fixnum_modulo" "C_fixnum_modulo")
    764783
Note: See TracChangeset for help on using the changeset viewer.