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 
     15 
     16   EXPORT  __ARM_ll_mullu
     17   EXPORT  __aeabi_lmul
     18 
     19   AREA  Math, CODE, READONLY
     20 
     21 ;
     22 ;INT64
     23 ;EFIAPI
     24 ;__aeabi_lmul (
     25 ;  IN INT64   Multiplicand
     26 ;  IN INT32   Multiplier
     27 ;  );
     28 ;
     29 __ARM_ll_mullu
     30   mov     r3, #0
     31 // Make upper part of INT64 Multiplier 0 and use __aeabi_lmul
     32 
     33 ;
     34 ;INT64
     35 ;EFIAPI
     36 ;__aeabi_lmul (
     37 ;  IN INT64   Multiplicand
     38 ;  IN INT64   Multiplier
     39 ;  );
     40 ;
     41 __aeabi_lmul
     42   stmdb   sp!, {lr}
     43   mov     lr, r0
     44   umull   r0, ip, r2, lr
     45   mla     r1, r2, r1, ip
     46   mla     r1, r3, lr, r1
     47   ldmia   sp!, {pc}
     48 
     49   END
     50