[BACK]Return to lshift.asm CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gmp / mpn / mips32

Annotation of OpenXM_contrib/gmp/mpn/mips32/lshift.asm, Revision 1.1.1.1

1.1       ohara       1: dnl  MIPS32 mpn_lshift -- Left shift.
                      2:
                      3: dnl  Copyright 1995, 2000, 2002 Free Software Foundation, Inc.
                      4:
                      5: dnl  This file is part of the GNU MP Library.
                      6:
                      7: dnl  The GNU MP Library is free software; you can redistribute it and/or modify
                      8: dnl  it under the terms of the GNU Lesser General Public License as published
                      9: dnl  by the Free Software Foundation; either version 2.1 of the License, or (at
                     10: dnl  your option) any later version.
                     11:
                     12: dnl  The GNU MP Library is distributed in the hope that it will be useful, but
                     13: dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
                     14: dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
                     15: dnl  License for more details.
                     16:
                     17: dnl  You should have received a copy of the GNU Lesser General Public License
                     18: dnl  along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
                     19: dnl  the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
                     20: dnl  MA 02111-1307, USA.
                     21:
                     22: include(`../config.m4')
                     23:
                     24: C INPUT PARAMETERS
                     25: C res_ptr      $4
                     26: C src_ptr      $5
                     27: C size         $6
                     28: C cnt          $7
                     29:
                     30: ASM_START()
                     31: PROLOGUE(mpn_lshift)
                     32:        sll     $2,$6,2
                     33:        addu    $5,$5,$2        C make r5 point at end of src
                     34:        lw      $10,-4($5)      C load first limb
                     35:        subu    $13,$0,$7
                     36:        addu    $4,$4,$2        C make r4 point at end of res
                     37:        addiu   $6,$6,-1
                     38:        and     $9,$6,4-1       C number of limbs in first loop
                     39:        beq     $9,$0,.L0       C if multiple of 4 limbs, skip first loop
                     40:         srl    $2,$10,$13      C compute function result
                     41:
                     42:        subu    $6,$6,$9
                     43:
                     44: .Loop0:        lw      $3,-8($5)
                     45:        addiu   $4,$4,-4
                     46:        addiu   $5,$5,-4
                     47:        addiu   $9,$9,-1
                     48:        sll     $11,$10,$7
                     49:        srl     $12,$3,$13
                     50:        move    $10,$3
                     51:        or      $8,$11,$12
                     52:        bne     $9,$0,.Loop0
                     53:         sw     $8,0($4)
                     54:
                     55: .L0:   beq     $6,$0,.Lend
                     56:         nop
                     57:
                     58: .Loop: lw      $3,-8($5)
                     59:        addiu   $4,$4,-16
                     60:        addiu   $6,$6,-4
                     61:        sll     $11,$10,$7
                     62:        srl     $12,$3,$13
                     63:
                     64:        lw      $10,-12($5)
                     65:        sll     $14,$3,$7
                     66:        or      $8,$11,$12
                     67:        sw      $8,12($4)
                     68:        srl     $9,$10,$13
                     69:
                     70:        lw      $3,-16($5)
                     71:        sll     $11,$10,$7
                     72:        or      $8,$14,$9
                     73:        sw      $8,8($4)
                     74:        srl     $12,$3,$13
                     75:
                     76:        lw      $10,-20($5)
                     77:        sll     $14,$3,$7
                     78:        or      $8,$11,$12
                     79:        sw      $8,4($4)
                     80:        srl     $9,$10,$13
                     81:
                     82:        addiu   $5,$5,-16
                     83:        or      $8,$14,$9
                     84:        bgtz    $6,.Loop
                     85:         sw     $8,0($4)
                     86:
                     87: .Lend: sll     $8,$10,$7
                     88:        j       $31
                     89:        sw      $8,-4($4)
                     90: EPILOGUE(mpn_lshift)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>