Home | History | Annotate | Line # | Download | only in arm64
      1 dnl  ARM64 mpn_bdiv_dbm1c.
      2 
      3 dnl  Copyright 2008, 2011, 2012, 2014 Free Software Foundation, Inc.
      4 
      5 dnl  This file is part of the GNU MP Library.
      6 dnl
      7 dnl  The GNU MP Library is free software; you can redistribute it and/or modify
      8 dnl  it under the terms of either:
      9 dnl
     10 dnl    * the GNU Lesser General Public License as published by the Free
     11 dnl      Software Foundation; either version 3 of the License, or (at your
     12 dnl      option) any later version.
     13 dnl
     14 dnl  or
     15 dnl
     16 dnl    * the GNU General Public License as published by the Free Software
     17 dnl      Foundation; either version 2 of the License, or (at your option) any
     18 dnl      later version.
     19 dnl
     20 dnl  or both in parallel, as here.
     21 dnl
     22 dnl  The GNU MP Library is distributed in the hope that it will be useful, but
     23 dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
     24 dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     25 dnl  for more details.
     26 dnl
     27 dnl  You should have received copies of the GNU General Public License and the
     28 dnl  GNU Lesser General Public License along with the GNU MP Library.  If not,
     29 dnl  see https://www.gnu.org/licenses/.
     30 
     31 include(`../config.m4')
     32 
     33 C	     cycles/limb
     34 C Cortex-A53	 8
     35 C Cortex-A57	 7
     36 C X-Gene	 4.25
     37 
     38 define(`qp',	  `x0')
     39 define(`up',	  `x1')
     40 define(`n',	  `x2')
     41 define(`bd',	  `x3')
     42 define(`cy',	  `x4')
     43 
     44 ASM_START()
     45 	TEXT
     46 	ALIGN(16)
     47 PROLOGUE(mpn_bdiv_dbm1c)
     48 	ldr	x5, [up], #8
     49 	ands	x6, n, #3
     50 	b.eq	L(fi0)
     51 	cmp	x6, #2
     52 	b.cc	L(fi1)
     53 	b.eq	L(fi2)
     54 
     55 L(fi3):	mul	x12, x5, bd
     56 	umulh	x13, x5, bd
     57 	ldr	x5, [up], #8
     58 	b	L(lo3)
     59 
     60 L(fi0):	mul	x10, x5, bd
     61 	umulh	x11, x5, bd
     62 	ldr	x5, [up], #8
     63 	b	L(lo0)
     64 
     65 L(fi1):	subs	n, n, #1
     66 	mul	x12, x5, bd
     67 	umulh	x13, x5, bd
     68 	b.ls	L(wd1)
     69 	ldr	x5, [up], #8
     70 	b	L(lo1)
     71 
     72 L(fi2):	mul	x10, x5, bd
     73 	umulh	x11, x5, bd
     74 	ldr	x5, [up], #8
     75 	b	L(lo2)
     76 
     77 L(top):	ldr	x5, [up], #8
     78 	subs	x4, x4, x10
     79 	str	x4, [qp], #8
     80 	sbc	x4, x4, x11
     81 L(lo1):	mul	x10, x5, bd
     82 	umulh	x11, x5, bd
     83 	ldr	x5, [up], #8
     84 	subs	x4, x4, x12
     85 	str	x4, [qp], #8
     86 	sbc	x4, x4, x13
     87 L(lo0):	mul	x12, x5, bd
     88 	umulh	x13, x5, bd
     89 	ldr	x5, [up], #8
     90 	subs	x4, x4, x10
     91 	str	x4, [qp], #8
     92 	sbc	x4, x4, x11
     93 L(lo3):	mul	x10, x5, bd
     94 	umulh	x11, x5, bd
     95 	ldr	x5, [up], #8
     96 	subs	x4, x4, x12
     97 	str	x4, [qp], #8
     98 	sbc	x4, x4, x13
     99 L(lo2):	subs	n, n, #4
    100 	mul	x12, x5, bd
    101 	umulh	x13, x5, bd
    102 	b.hi	L(top)
    103 
    104 L(wd2):	subs	x4, x4, x10
    105 	str	x4, [qp], #8
    106 	sbc	x4, x4, x11
    107 L(wd1):	subs	x4, x4, x12
    108 	str	x4, [qp]
    109 	sbc	x0, x4, x13
    110 	ret
    111 EPILOGUE()
    112