Changeset 7907


Ignore:
Timestamp:
Dec 13, 2007, 8:40:00 PM (13 years ago)
Author:
rme
Message:

Use some insn mnemonics that refer to the carry flag.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ia32/level-0/X86/X8632/x8632-bignum.lisp

    r7904 r7907  
    3636  (movl ($ x8632::nil-value) (% arg_z))
    3737  (testl (% imm0) (% imm0))
    38   (cmovel (% imm0) (% arg_z))
     38  (cmovzl (% imm0) (% arg_z))
    3939  (single-value-return))
    4040
     
    7676
    7777(defx8632lapfunction %digit-0-or-plusp ((bignum arg_y) (idx arg_z))
    78   (testl (@ x8632::misc-data-offset (% bignum) (% idx)) (% imm0))
     78  (movl (@ x8632::misc-data-offset (% bignum) (% idx)) (% imm0))
    7979  (movl ($ x8632::nil-value) (% temp0))
    80   (cmovbl (% temp0) (% arg_z))
     80  (testl (% imm0) (% imm0))
     81  (cmovsl (% temp0) (% arg_z))
    8182  (single-value-return))
    8283
    8384;;; For oddp, evenp
    8485(defx8632lapfunction %bignum-oddp ((bignum arg_z))
    85   (testb ($ 1) (@ x8632::misc-data-offset (% bignum)))
     86  (movl (@ x8632::misc-data-offset (% bignum)) (% imm0))
    8687  (movl ($ x8632::nil-value) (% temp0))
    87   (cmovel (% temp0) (% arg_z))
     88  (btl ($ 0) (% imm0))                  ;copy bit 0 to carry flag
     89  (cmovncl (% temp0) (% arg_z))
    8890  (single-value-return))
    8991
     
    9193  (vector-length bignum imm0)
    9294  (movl (@ (- 4 x8632::misc-data-offset) (% bignum)) (% imm0))
    93   (testl ($ #x8000000) (% imm0))
    9495  (movl ($ x8632::nil-value) (% temp0))
    95   (cmovnel (% temp0) (% arg_z))
     96  (cmpl ($ 1) (% imm0))
     97  (cmovbl (% temp0) (% arg_z))
    9698  (single-value-return))
    9799
     
    104106  (vector-length bignum imm0)
    105107  (movl (@ (- 4 x8632::misc-data-offset) (% bignum) (% imm0)) (% imm0))
    106   (testl ($ #x8000000) (% imm0))
    107108  (movl ($ x8632::nil-value) (% temp0))
    108   (cmovel (% temp0) (% arg_z))
     109  (testl (% imm0) (% imm0))
     110  (cmovnsl (% temp0) (% arg_z))
    109111  (single-value-return))
    110112
     
    128130  ;; unboxed a or a[i] now in temp0
    129131  ;; unboxed b or b[j] now in imm0
    130   (xorl (% arg_z) (% arg_z))
     132  (movl ($ x8632::fixnumone) (% arg_z)) ;for outgoing carry
    131133  (movl (@ c (% esp)) (% arg_y))
    132134  (testl (% arg_y) (% arg_y))           ;clears carry flag
    133135  (jz @add)
     136  (xorl (% arg_y) (% arg_y))
    134137  (stc)
    135138  @add
     139  ;; arg_y = 0, arg_z = fixnum 1
    136140  (adc (% temp0) (% imm0))
    137141  (movl (@ r (% esp)) (% temp0))
    138142  (movl (@ k (% esp)) (% temp1))
    139143  (movl (% imm0) (@ x8632::misc-data-offset (% temp0) (% temp1)))
    140   (adc ($ 0) (% imm0))                  ;propagate carry flag
    141   (box-fixnum imm0 arg_z)
     144  (cmovnc (% arg_y) (% arg_z))          ;outgoing carry
    142145  (mark-as-node temp0)
    143146  (single-value-return 7))
     
    161164  ;; unboxed a or a[i] now in temp0
    162165  ;; unboxed b or b[j] now in imm0
    163   (xorl (% arg_z) (% arg_z))
     166  (movl ($ x8632::fixnumone) (% arg_z)) ;for outgoing carry
    164167  (movl (@ borrow (% esp)) (% arg_y))
    165168  (testl (% arg_y) (% arg_y))           ;clears carry flag
    166169  (jz @sub)
     170  (xorl (% arg_y) (% arg_y))
    167171  (stc)
    168172  @sub
     173  ;; arg_y = 0, arg_z = fixnum 1
    169174  (sbb (% imm0) (% temp0))
    170175  (movl (@ r (% esp)) (% temp0))
    171176  (movl (@ k (% esp)) (% temp1))
    172177  (movl (% imm0) (@ x8632::misc-data-offset (% temp0) (% temp1)))
    173   (adc ($ 0) (% imm0))                  ;propagate carry flag
    174   (box-fixnum imm0 arg_z)
     178  (cmovnc (% arg_y) (% arg_z))          ;outgoing carry
    175179  (mark-as-node temp0)
    176180  (single-value-return 7))
Note: See TracChangeset for help on using the changeset viewer.