Home | History | Annotate | Download | only in Arm
      1 #------------------------------------------------------------------------------
      2 #
      3 # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
      4 #
      5 # This program and the accompanying materials
      6 # are licensed and made available under the terms and conditions of the BSD License
      7 # which accompanies this distribution.  The full text of the license may be found at
      8 # http://opensource.org/licenses/bsd-license.php
      9 #
     10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     12 #
     13 #------------------------------------------------------------------------------
     14 .text
     15 
     16 GCC_ASM_EXPORT(__ARM_ll_mullu)
     17 GCC_ASM_EXPORT(__aeabi_lmul)
     18 #
     19 #INT64
     20 #EFIAPI
     21 #__aeabi_lmul (
     22 #  IN INT64   Multiplicand
     23 #  IN INT32   Multiplier
     24 #  );
     25 #
     26 ASM_PFX(__ARM_ll_mullu):
     27   mov     r3, #0
     28 # Make upper part of INT64 Multiplier 0 and use __aeabi_lmul
     29 
     30 #
     31 #INT64
     32 #EFIAPI
     33 #__aeabi_lmul (
     34 #  IN INT64   Multiplicand
     35 #  IN INT64   Multiplier
     36 #  );
     37 #
     38 ASM_PFX(__aeabi_lmul):
     39   stmdb   sp!, {lr}
     40   mov     lr, r0
     41   umull   r0, ip, r2, lr
     42   mla     r1, r2, r1, ip
     43   mla     r1, r3, lr, r1
     44   ldmia   sp!, {pc}
     45