From 6c128c65b5ec0e5b8b5a0ccb165f3afd29e485f8 Mon Sep 17 00:00:00 2001 From: Guo Mang Date: Wed, 2 Aug 2017 09:54:47 +0800 Subject: Remove core packages since we can get them from edk2 repository Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Mang --- .../Library/CompilerIntrinsicsLib/AArch64/memcpy.S | 125 --------- .../Library/CompilerIntrinsicsLib/AArch64/memset.c | 25 -- .../CompilerIntrinsicsLib/Arm/Llvm_int_lib.h | 99 ------- ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S | 35 --- ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.c | 83 ------ ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S | 36 --- ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.c | 84 ------ ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S | 57 ---- ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.c | 96 ------- ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S | 49 ---- ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.c | 98 ------- ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.S | 153 ----------- ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm | 155 ----------- ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S | 49 ---- ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.c | 77 ------ ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S | 32 --- ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.c | 78 ------ ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.asm | 41 --- ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S | 59 ----- .../Library/CompilerIntrinsicsLib/Arm/ldivmod.asm | 58 ----- ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.S | 40 --- ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.asm | 43 --- ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.S | 40 --- ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm | 44 ---- ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S | 35 --- ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.c | 83 ------ ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.S | 32 --- .../Library/CompilerIntrinsicsLib/Arm/memcpy.asm | 41 --- .../Library/CompilerIntrinsicsLib/Arm/memcpy4.asm | 61 ----- ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S | 48 ---- .../Library/CompilerIntrinsicsLib/Arm/memmove.asm | 53 ---- ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S | 38 --- .../Library/CompilerIntrinsicsLib/Arm/memset.asm | 50 ---- ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S | 46 ---- ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.c | 77 ------ ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S | 27 -- ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.c | 70 ----- ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S | 58 ----- ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.c | 98 ------- ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.S | 44 ---- ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.asm | 49 ---- .../Library/CompilerIntrinsicsLib/Arm/sourcery.S | 55 ---- .../Library/CompilerIntrinsicsLib/Arm/switch.asm | 29 --- .../Library/CompilerIntrinsicsLib/Arm/switch16.S | 31 --- .../Library/CompilerIntrinsicsLib/Arm/switch32.S | 30 --- ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch8.S | 28 -- .../Library/CompilerIntrinsicsLib/Arm/switchu8.S | 29 --- ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S | 38 --- ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.c | 82 ------ ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S | 27 -- ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.c | 71 ----- .../Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S | 242 ----------------- .../Library/CompilerIntrinsicsLib/Arm/udivmoddi4.c | 287 --------------------- ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S | 57 ---- ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.c | 111 -------- ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S | 267 ------------------- ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm | 268 ------------------- .../Library/CompilerIntrinsicsLib/Arm/uldivmod.c | 43 --- ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S | 29 --- ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.c | 72 ------ ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S | 28 -- ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.c | 68 ----- ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.asm | 66 ----- .../Library/CompilerIntrinsicsLib/Arm/uwrite.asm | 68 ----- .../CompilerIntrinsicsLib.inf | 107 -------- 65 files changed, 4699 deletions(-) delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/AArch64/memcpy.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/AArch64/memset.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/Llvm_int_lib.h delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.asm delete mode 100755 ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.asm delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.asm delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy4.asm delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S delete mode 100755 ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.asm delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S delete mode 100755 ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.asm delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.asm delete mode 100755 ArmPkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch.asm delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch16.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch32.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch8.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.c delete mode 100755 ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm delete mode 100755 ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldivmod.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.c delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.asm delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/Arm/uwrite.asm delete mode 100644 ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf (limited to 'ArmPkg/Library/CompilerIntrinsicsLib') diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/memcpy.S b/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/memcpy.S deleted file mode 100644 index 66102da14b..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/memcpy.S +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2011 - 2013, ARM Ltd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the company may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -.text -.align 2 - - -GCC_ASM_EXPORT(memcpy) - - -// Taken from Newlib BSD implementation. -ASM_PFX(memcpy): - // Copy dst to x6, so we can preserve return value. - mov x6, x0 - - // NOTE: although size_t is unsigned, this code uses signed - // comparisons on x2 so relies on nb never having its top bit - // set. In practice this is not going to be a real problem. - - // Require at least 64 bytes to be worth aligning. - cmp x2, #64 - blt qwordcopy - - // Compute offset to align destination to 16 bytes. - neg x3, x0 - and x3, x3, 15 - - cbz x3, blockcopy // offset == 0 is likely - - // We know there is at least 64 bytes to be done, so we - // do a 16 byte misaligned copy at first and then later do - // all 16-byte aligned copies. Some bytes will be copied - // twice, but there's no harm in that since memcpy does not - // guarantee correctness on overlap. - - sub x2, x2, x3 // nb -= offset - ldp x4, x5, [x1] - add x1, x1, x3 - stp x4, x5, [x6] - add x6, x6, x3 - - // The destination pointer is now qword (16 byte) aligned. - // (The src pointer might be.) - -blockcopy: - // Copy 64 bytes at a time. - subs x2, x2, #64 - blt 3f -2: subs x2, x2, #64 - ldp x4, x5, [x1,#0] - ldp x8, x9, [x1,#16] - ldp x10,x11,[x1,#32] - ldp x12,x13,[x1,#48] - add x1, x1, #64 - stp x4, x5, [x6,#0] - stp x8, x9, [x6,#16] - stp x10,x11,[x6,#32] - stp x12,x13,[x6,#48] - add x6, x6, #64 - bge 2b - - // Unwind pre-decrement -3: add x2, x2, #64 - -qwordcopy: - // Copy 0-48 bytes, 16 bytes at a time. - subs x2, x2, #16 - blt tailcopy -2: ldp x4, x5, [x1],#16 - subs x2, x2, #16 - stp x4, x5, [x6],#16 - bge 2b - - // No need to unwind the pre-decrement, it would not change - // the low 4 bits of the count. But how likely is it for the - // byte count to be multiple of 16? Is it worth the overhead - // of testing for x2 == -16? - -tailcopy: - // Copy trailing 0-15 bytes. - tbz x2, #3, 1f - ldr x4, [x1],#8 // copy 8 bytes - str x4, [x6],#8 -1: - tbz x2, #2, 1f - ldr w4, [x1],#4 // copy 4 bytes - str w4, [x6],#4 -1: - tbz x2, #1, 1f - ldrh w4, [x1],#2 // copy 2 bytes - strh w4, [x6],#2 -1: - tbz x2, #0, return - ldrb w4, [x1] // copy 1 byte - strb w4, [x6] - -return: - // This is the only return point of memcpy. - ret diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/memset.c b/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/memset.c deleted file mode 100644 index 069c932a67..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/memset.c +++ /dev/null @@ -1,25 +0,0 @@ -/** @file - - Copyright (c) 2014, ARM Ltd. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include - -void *memset(void *Destination, int Value, int Count) -{ - CHAR8 *Ptr = Destination; - - while (Count--) - *Ptr++ = Value; - - return Destination; -} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/Llvm_int_lib.h b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/Llvm_int_lib.h deleted file mode 100644 index 78d3e218ed..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/Llvm_int_lib.h +++ /dev/null @@ -1,99 +0,0 @@ -/** @file - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - -#include -#include - -#define CHAR_BIT 8 - -typedef union { - INT64 all; - struct { - UINT32 low; - INT32 high; - }; -} dwords; - -typedef union { - UINT64 all; - struct { - UINT32 low; - UINT32 high; - }; -} udwords; - -// __aeabi_ return values -typedef struct { - UINT64 Quotent; - UINT64 Remainder; -} ulldiv_t; - -typedef struct { - INT64 Quotent; - INT64 Remainder; -} lldiv_t; - -typedef struct { - UINT32 Quotent; - UINT32 Remainder; -} uidiv_return; - -#if __GNUC__ - #define COUNT_LEADING_ZEROS(_a) __builtin_clz((_a)) - #define COUNT_TRAILING_ZEROS(_a) __builtin_ctz((_a)) -#else -#error COUNT_LEADING_ZEROS() and COUNT_TRAILING_ZEROS() macros not ported to your compiler -#endif diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S deleted file mode 100644 index 74960b1df1..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S +++ /dev/null @@ -1,35 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__ashldi3) - -ASM_PFX(__ashldi3): - cmp r2, #31 - bls L2 - cmp r2, #63 - subls r2, r2, #32 - movls r2, r0, asl r2 - movhi r2, #0 - mov r1, r2 - mov r0, #0 - bx lr -L2: - cmp r2, #0 - rsbne r3, r2, #32 - movne r3, r0, lsr r3 - movne r0, r0, asl r2 - orrne r1, r3, r1, asl r2 - bx lr diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.c deleted file mode 100644 index e13ea016f5..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.c +++ /dev/null @@ -1,83 +0,0 @@ -/** @file - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - -#include "Llvm_int_lib.h" - -// Returns: a << b - -// Precondition: 0 <= b < bits_in_dword - -INT64 -__ashldi3(INT64 a, INT32 b) -{ - const int bits_in_word = (int)(sizeof(INT32) * CHAR_BIT); - dwords input; - dwords result; - input.all = a; - if (b & bits_in_word) // bits_in_word <= b < bits_in_dword - { - result.low = 0; - result.high = input.low << (b - bits_in_word); - } - else // 0 <= b < bits_in_word - { - if (b == 0) - return a; - result.low = input.low << b; - result.high = (input.high << b) | (input.low >> (bits_in_word - b)); - } - return result.all; -} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S deleted file mode 100644 index 3cee2c1085..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S +++ /dev/null @@ -1,36 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__ashrdi3) - -ASM_PFX(__ashrdi3): - cmp r2, #31 - bls L2 - cmp r2, #63 - subls r2, r2, #32 - mov ip, r1, asr #31 - movls r2, r1, asr r2 - movhi r2, ip - mov r0, r2 - mov r1, ip - bx lr -L2: - cmp r2, #0 - rsbne r3, r2, #32 - movne r3, r1, asl r3 - movne r1, r1, asr r2 - orrne r0, r3, r0, lsr r2 - bx lr diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.c deleted file mode 100644 index 1617543ef5..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.c +++ /dev/null @@ -1,84 +0,0 @@ -/** @file - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - -#include "Llvm_int_lib.h" - -// Returns: arithmetic a >> b - -// Precondition: 0 <= b < bits_in_dword - -INT64 -__ashrdi3(INT64 a, INT32 b) -{ - const int bits_in_word = (int)(sizeof(INT32) * CHAR_BIT); - dwords input; - dwords result; - input.all = a; - if (b & bits_in_word) // bits_in_word <= b < bits_in_dword - { - // result.high = input.high < 0 ? -1 : 0 - result.high = input.high >> (bits_in_word - 1); - result.low = input.high >> (b - bits_in_word); - } - else // 0 <= b < bits_in_word - { - if (b == 0) - return a; - result.high = input.high >> b; - result.low = (input.high << (bits_in_word - b)) | (input.low >> b); - } - return result.all; -} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S deleted file mode 100644 index 4cef265757..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S +++ /dev/null @@ -1,57 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__clzsi2) - -ASM_PFX(__clzsi2): - @ frame_needed = 1, uses_anonymous_args = 0 - stmfd sp!, {r7, lr} - add r7, sp, #0 - movs r3, r0, lsr #16 - movne r3, #16 - moveq r3, #0 - movne r9, #0 - moveq r9, #16 - mov r3, r0, lsr r3 - tst r3, #65280 - movne r0, #8 - moveq r0, #0 - movne lr, #0 - moveq lr, #8 - mov r3, r3, lsr r0 - tst r3, #240 - movne r0, #4 - moveq r0, #0 - movne ip, #0 - moveq ip, #4 - mov r3, r3, lsr r0 - tst r3, #12 - movne r0, #2 - moveq r0, #0 - movne r1, #0 - moveq r1, #2 - mov r2, r3, lsr r0 - add r3, lr, r9 - add r0, r3, ip - add r1, r0, r1 - mov r0, r2, lsr #1 - eor r0, r0, #1 - ands r0, r0, #1 - mvnne r0, #0 - rsb r3, r2, #2 - and r0, r0, r3 - add r0, r1, r0 - ldmfd sp!, {r7, pc} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.c deleted file mode 100644 index 5c2a3ea2b4..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.c +++ /dev/null @@ -1,96 +0,0 @@ -/** @file - Compiler intrinsic to return the number of leading zeros, ported from LLVM code. - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - - -#include "Llvm_int_lib.h" - -// Returns: the number of leading 0-bits - -// Precondition: a != 0 - -INT32 -__clzsi2(INT32 a) -{ - UINT32 x = (UINT32)a; - INT32 t = ((x & 0xFFFF0000) == 0) << 4; // if (x is small) t = 16 else 0 - x >>= 16 - t; // x = [0 - 0xFFFF] - UINT32 r = t; // r = [0, 16] - // return r + clz(x) - t = ((x & 0xFF00) == 0) << 3; - x >>= 8 - t; // x = [0 - 0xFF] - r += t; // r = [0, 8, 16, 24] - // return r + clz(x) - t = ((x & 0xF0) == 0) << 2; - x >>= 4 - t; // x = [0 - 0xF] - r += t; // r = [0, 4, 8, 12, 16, 20, 24, 28] - // return r + clz(x) - t = ((x & 0xC) == 0) << 1; - x >>= 2 - t; // x = [0 - 3] - r += t; // r = [0 - 30] and is even - // return r + clz(x) -// switch (x) -// { -// case 0: -// return r + 2; -// case 1: -// return r + 1; -// case 2: -// case 3: -// return r; -// } - return r + ((2 - x) & -((x & 2) == 0)); -} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S deleted file mode 100644 index 108072eef7..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S +++ /dev/null @@ -1,49 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__ctzsi2) - -ASM_PFX(__ctzsi2): - uxth r3, r0 - cmp r3, #0 - moveq ip, #16 - movne ip, #0 - @ lr needed for prologue - mov r0, r0, lsr ip - tst r0, #255 - movne r3, #0 - moveq r3, #8 - mov r0, r0, lsr r3 - tst r0, #15 - movne r1, #0 - moveq r1, #4 - add r3, r3, ip - mov r0, r0, lsr r1 - tst r0, #3 - movne r2, #0 - moveq r2, #2 - add r3, r3, r1 - mov r0, r0, lsr r2 - and r0, r0, #3 - add r2, r3, r2 - eor r3, r0, #1 - mov r0, r0, lsr #1 - ands r3, r3, #1 - mvnne r3, #0 - rsb r0, r0, #2 - and r0, r3, r0 - add r0, r2, r0 - bx lr diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.c deleted file mode 100644 index 12cad92da7..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.c +++ /dev/null @@ -1,98 +0,0 @@ -/** @file - Compiler intrinsic to return the number of trailing zeros, ported from LLVM code. - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - - -#include "Llvm_int_lib.h" - -// Returns: the number of trailing 0-bits - -// Precondition: a != 0 - -INT32 -__ctzsi2(INT32 a) -{ - UINT32 x = (UINT32)a; - INT32 t = ((x & 0x0000FFFF) == 0) << 4; // if (x has no small bits) t = 16 else 0 - x >>= t; // x = [0 - 0xFFFF] + higher garbage bits - UINT32 r = t; // r = [0, 16] - // return r + ctz(x) - t = ((x & 0x00FF) == 0) << 3; - x >>= t; // x = [0 - 0xFF] + higher garbage bits - r += t; // r = [0, 8, 16, 24] - // return r + ctz(x) - t = ((x & 0x0F) == 0) << 2; - x >>= t; // x = [0 - 0xF] + higher garbage bits - r += t; // r = [0, 4, 8, 12, 16, 20, 24, 28] - // return r + ctz(x) - t = ((x & 0x3) == 0) << 1; - x >>= t; - x &= 3; // x = [0 - 3] - r += t; // r = [0 - 30] and is even - // return r + ctz(x) -// The branch-less return statement below is equivalent -// to the following switch statement: -// switch (x) -// { -// case 0: -// return r + 2; -// case 2: -// return r + 1; -// case 1: -// case 3: -// return r; -// } - return r + ((2 - (x >> 1)) & -((x & 1) == 0)); -} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.S deleted file mode 100644 index faf70dbf45..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.S +++ /dev/null @@ -1,153 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2011, ARM. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - -.text -.align 2 -GCC_ASM_EXPORT(__aeabi_uidiv) -GCC_ASM_EXPORT(__aeabi_uidivmod) -GCC_ASM_EXPORT(__aeabi_idiv) -GCC_ASM_EXPORT(__aeabi_idivmod) - -# AREA Math, CODE, READONLY - -# -#UINT32 -#EFIAPI -#__aeabi_uidivmode ( -# IN UINT32 Dividen -# IN UINT32 Divisor -# ); -# - -ASM_PFX(__aeabi_uidiv): -ASM_PFX(__aeabi_uidivmod): - rsbs r12, r1, r0, LSR #4 - mov r2, #0 - bcc ASM_PFX(__arm_div4) - rsbs r12, r1, r0, LSR #8 - bcc ASM_PFX(__arm_div8) - mov r3, #0 - b ASM_PFX(__arm_div_large) - -# -#INT32 -#EFIAPI -#__aeabi_idivmode ( -# IN INT32 Dividen -# IN INT32 Divisor -# ); -# -ASM_PFX(__aeabi_idiv): -ASM_PFX(__aeabi_idivmod): - orrs r12, r0, r1 - bmi ASM_PFX(__arm_div_negative) - rsbs r12, r1, r0, LSR #1 - mov r2, #0 - bcc ASM_PFX(__arm_div1) - rsbs r12, r1, r0, LSR #4 - bcc ASM_PFX(__arm_div4) - rsbs r12, r1, r0, LSR #8 - bcc ASM_PFX(__arm_div8) - mov r3, #0 - b ASM_PFX(__arm_div_large) -ASM_PFX(__arm_div8): - rsbs r12, r1, r0, LSR #7 - subcs r0, r0, r1, LSL #7 - adc r2, r2, r2 - rsbs r12, r1, r0,LSR #6 - subcs r0, r0, r1, LSL #6 - adc r2, r2, r2 - rsbs r12, r1, r0, LSR #5 - subcs r0, r0, r1, LSL #5 - adc r2, r2, r2 - rsbs r12, r1, r0, LSR #4 - subcs r0, r0, r1, LSL #4 - adc r2, r2, r2 -ASM_PFX(__arm_div4): - rsbs r12, r1, r0, LSR #3 - subcs r0, r0, r1, LSL #3 - adc r2, r2, r2 - rsbs r12, r1, r0, LSR #2 - subcs r0, r0, r1, LSL #2 - adcs r2, r2, r2 - rsbs r12, r1, r0, LSR #1 - subcs r0, r0, r1, LSL #1 - adc r2, r2, r2 -ASM_PFX(__arm_div1): - subs r1, r0, r1 - movcc r1, r0 - adc r0, r2, r2 - bx r14 -ASM_PFX(__arm_div_negative): - ands r2, r1, #0x80000000 - rsbmi r1, r1, #0 - eors r3, r2, r0, ASR #32 - rsbcs r0, r0, #0 - rsbs r12, r1, r0, LSR #4 - bcc label1 - rsbs r12, r1, r0, LSR #8 - bcc label2 -ASM_PFX(__arm_div_large): - lsl r1, r1, #6 - rsbs r12, r1, r0, LSR #8 - orr r2, r2, #0xfc000000 - bcc label2 - lsl r1, r1, #6 - rsbs r12, r1, r0, LSR #8 - orr r2, r2, #0x3f00000 - bcc label2 - lsl r1, r1, #6 - rsbs r12, r1, r0, LSR #8 - orr r2, r2, #0xfc000 - orrcs r2, r2, #0x3f00 - lslcs r1, r1, #6 - rsbs r12, r1, #0 - bcs ASM_PFX(__aeabi_idiv0) -label3: - lsrcs r1, r1, #6 -label2: - rsbs r12, r1, r0, LSR #7 - subcs r0, r0, r1, LSL #7 - adc r2, r2, r2 - rsbs r12, r1, r0, LSR #6 - subcs r0, r0, r1, LSL #6 - adc r2, r2, r2 - rsbs r12, r1, r0, LSR #5 - subcs r0, r0, r1, LSL #5 - adc r2, r2, r2 - rsbs r12, r1, r0, LSR #4 - subcs r0, r0, r1, LSL #4 - adc r2, r2, r2 -label1: - rsbs r12, r1, r0, LSR #3 - subcs r0, r0, r1, LSL #3 - adc r2, r2, r2 - rsbs r12, r1, r0, LSR #2 - subcs r0, r0, r1, LSL #2 - adcs r2, r2, r2 - bcs label3 - rsbs r12, r1, r0, LSR #1 - subcs r0, r0, r1, LSL #1 - adc r2, r2, r2 - subs r1, r0, r1 - movcc r1, r0 - adc r0, r2, r2 - asrs r3, r3, #31 - rsbmi r0, r0, #0 - rsbcs r1, r1, #0 - bx r14 - - @ What to do about division by zero? For now, just return. -ASM_PFX(__aeabi_idiv0): - bx r14 diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm deleted file mode 100644 index b539e51689..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm +++ /dev/null @@ -1,155 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - EXPORT __aeabi_uidiv - EXPORT __aeabi_uidivmod - EXPORT __aeabi_idiv - EXPORT __aeabi_idivmod - - AREA Math, CODE, READONLY - -; -;UINT32 -;EFIAPI -;__aeabi_uidivmode ( -; IN UINT32 Dividen -; IN UINT32 Divisor -; ); -; - -__aeabi_uidiv -__aeabi_uidivmod - RSBS r12, r1, r0, LSR #4 - MOV r2, #0 - BCC __arm_div4 - RSBS r12, r1, r0, LSR #8 - BCC __arm_div8 - MOV r3, #0 - B __arm_div_large - -; -;INT32 -;EFIAPI -;__aeabi_idivmode ( -; IN INT32 Dividen -; IN INT32 Divisor -; ); -; -__aeabi_idiv -__aeabi_idivmod - ORRS r12, r0, r1 - BMI __arm_div_negative - RSBS r12, r1, r0, LSR #1 - MOV r2, #0 - BCC __arm_div1 - RSBS r12, r1, r0, LSR #4 - BCC __arm_div4 - RSBS r12, r1, r0, LSR #8 - BCC __arm_div8 - MOV r3, #0 - B __arm_div_large -__arm_div8 - RSBS r12, r1, r0, LSR #7 - SUBCS r0, r0, r1, LSL #7 - ADC r2, r2, r2 - RSBS r12, r1, r0,LSR #6 - SUBCS r0, r0, r1, LSL #6 - ADC r2, r2, r2 - RSBS r12, r1, r0, LSR #5 - SUBCS r0, r0, r1, LSL #5 - ADC r2, r2, r2 - RSBS r12, r1, r0, LSR #4 - SUBCS r0, r0, r1, LSL #4 - ADC r2, r2, r2 -__arm_div4 - RSBS r12, r1, r0, LSR #3 - SUBCS r0, r0, r1, LSL #3 - ADC r2, r2, r2 - RSBS r12, r1, r0, LSR #2 - SUBCS r0, r0, r1, LSL #2 - ADCS r2, r2, r2 - RSBS r12, r1, r0, LSR #1 - SUBCS r0, r0, r1, LSL #1 - ADC r2, r2, r2 -__arm_div1 - SUBS r1, r0, r1 - MOVCC r1, r0 - ADC r0, r2, r2 - BX r14 -__arm_div_negative - ANDS r2, r1, #0x80000000 - RSBMI r1, r1, #0 - EORS r3, r2, r0, ASR #32 - RSBCS r0, r0, #0 - RSBS r12, r1, r0, LSR #4 - BCC label1 - RSBS r12, r1, r0, LSR #8 - BCC label2 -__arm_div_large - LSL r1, r1, #6 - RSBS r12, r1, r0, LSR #8 - ORR r2, r2, #0xfc000000 - BCC label2 - LSL r1, r1, #6 - RSBS r12, r1, r0, LSR #8 - ORR r2, r2, #0x3f00000 - BCC label2 - LSL r1, r1, #6 - RSBS r12, r1, r0, LSR #8 - ORR r2, r2, #0xfc000 - ORRCS r2, r2, #0x3f00 - LSLCS r1, r1, #6 - RSBS r12, r1, #0 - BCS __aeabi_idiv0 -label3 - LSRCS r1, r1, #6 -label2 - RSBS r12, r1, r0, LSR #7 - SUBCS r0, r0, r1, LSL #7 - ADC r2, r2, r2 - RSBS r12, r1, r0, LSR #6 - SUBCS r0, r0, r1, LSL #6 - ADC r2, r2, r2 - RSBS r12, r1, r0, LSR #5 - SUBCS r0, r0, r1, LSL #5 - ADC r2, r2, r2 - RSBS r12, r1, r0, LSR #4 - SUBCS r0, r0, r1, LSL #4 - ADC r2, r2, r2 -label1 - RSBS r12, r1, r0, LSR #3 - SUBCS r0, r0, r1, LSL #3 - ADC r2, r2, r2 - RSBS r12, r1, r0, LSR #2 - SUBCS r0, r0, r1, LSL #2 - ADCS r2, r2, r2 - BCS label3 - RSBS r12, r1, r0, LSR #1 - SUBCS r0, r0, r1, LSL #1 - ADC r2, r2, r2 - SUBS r1, r0, r1 - MOVCC r1, r0 - ADC r0, r2, r2 - ASRS r3, r3, #31 - RSBMI r0, r0, #0 - RSBCS r1, r1, #0 - BX r14 - - ; What to do about division by zero? For now, just return. -__aeabi_idiv0 - BX r14 - - END - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S deleted file mode 100644 index 23c8e8ffbf..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S +++ /dev/null @@ -1,49 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__divdi3) - -ASM_PFX(__divdi3): - @ args = 0, pretend = 0, frame = 0 - @ frame_needed = 1, uses_anonymous_args = 0 - stmfd sp!, {r4, r5, r7, lr} - mov r4, r3, asr #31 - add r7, sp, #8 - stmfd sp!, {r10, r11} - mov r10, r1, asr #31 - sub sp, sp, #8 - mov r11, r10 - mov r5, r4 - eor r0, r0, r10 - eor r1, r1, r10 - eor r2, r2, r4 - eor r3, r3, r4 - subs r2, r2, r4 - sbc r3, r3, r5 - mov ip, #0 - subs r0, r0, r10 - sbc r1, r1, r11 - str ip, [sp, #0] - bl ASM_PFX(__udivmoddi4) - eor r2, r10, r4 - eor r3, r10, r4 - eor r0, r0, r2 - eor r1, r1, r3 - subs r0, r0, r2 - sbc r1, r1, r3 - sub sp, r7, #16 - ldmfd sp!, {r10, r11} - ldmfd sp!, {r4, r5, r7, pc} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.c deleted file mode 100644 index c7916b8009..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.c +++ /dev/null @@ -1,77 +0,0 @@ -/** @file - Compiler intrinsic for 64-bit compare, ported from LLVM code. - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - - -#include "Llvm_int_lib.h" - -UINT64 __udivmoddi4(UINT64 a, UINT64 b, UINT64* rem); - -// Returns: a / b - -INT64 -__divdi3(INT64 a, INT64 b) -{ - const int bits_in_dword_m1 = (int)(sizeof(INT64) * CHAR_BIT) - 1; - INT64 s_a = a >> bits_in_dword_m1; // s_a = a < 0 ? -1 : 0 - INT64 s_b = b >> bits_in_dword_m1; // s_b = b < 0 ? -1 : 0 - a = (a ^ s_a) - s_a; // negate if s_a == -1 - b = (b ^ s_b) - s_b; // negate if s_b == -1 - s_a ^= s_b; // sign of quotient - return (__udivmoddi4(a, b, (UINT64*)0) ^ s_a) - s_a; // negate if s_a == -1 -} - - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S deleted file mode 100644 index d585146878..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S +++ /dev/null @@ -1,32 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__divsi3) - -ASM_PFX(__divsi3): - eor r3, r0, r0, asr #31 - eor r2, r1, r1, asr #31 - stmfd sp!, {r4, r5, r7, lr} - mov r5, r0, asr #31 - add r7, sp, #8 - mov r4, r1, asr #31 - sub r0, r3, r0, asr #31 - sub r1, r2, r1, asr #31 - bl ASM_PFX(__udivsi3) - eor r1, r5, r4 - eor r0, r0, r1 - rsb r0, r1, r0 - ldmfd sp!, {r4, r5, r7, pc} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.c deleted file mode 100644 index 24e43dd6d7..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.c +++ /dev/null @@ -1,78 +0,0 @@ -/** @file - Compiler intrinsic for 32--bit unsigned division, ported from LLVM code. - - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - - -#include "Llvm_int_lib.h" - -UINT32 __udivsi3(UINT32 n, UINT32 d); - -// Returns: a / b - -INT32 -__divsi3(INT32 a, INT32 b) -{ - const int bits_in_word_m1 = (int)(sizeof(INT32) * CHAR_BIT) - 1; - INT32 s_a = a >> bits_in_word_m1; // s_a = a < 0 ? -1 : 0 - INT32 s_b = b >> bits_in_word_m1; // s_b = b < 0 ? -1 : 0 - a = (a ^ s_a) - s_a; // negate if s_a == -1 - b = (b ^ s_b) - s_b; // negate if s_b == -1 - s_a ^= s_b; // sign of quotient - return (__udivsi3(a, b) ^ s_a) - s_a; // negate if s_a == -1 -} - - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.asm deleted file mode 100644 index feb267a65e..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.asm +++ /dev/null @@ -1,41 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - EXPORT __aeabi_lasr - - AREA Math, CODE, READONLY - -; -;UINT32 -;EFIAPI -;__aeabi_lasr ( -; IN UINT32 Dividen -; IN UINT32 Divisor -; ); -; -__aeabi_lasr - SUBS r3,r2,#0x20 - BPL {pc} + 0x18 ; 0x1c - RSB r3,r2,#0x20 - LSR r0,r0,r2 - ORR r0,r0,r1,LSL r3 - ASR r1,r1,r2 - BX lr - ASR r0,r1,r3 - ASR r1,r1,#31 - BX lr - - END - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S deleted file mode 100755 index e7a05de589..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - .text - .align 2 - GCC_ASM_EXPORT(__aeabi_ldivmod) - -// -// A pair of (unsigned) long longs is returned in {{r0, r1}, {r2, r3}}, -// the quotient in {r0, r1}, and the remainder in {r2, r3}. -// -//__value_in_regs lldiv_t -//EFIAPI -//__aeabi_ldivmod ( -// IN UINT64 Dividen -// IN UINT64 Divisor -// )// -// - -ASM_PFX(__aeabi_ldivmod): - push {r4,lr} - asrs r4,r1,#1 - eor r4,r4,r3,LSR #1 - bpl L_Test1 - rsbs r0,r0,#0 - rsc r1,r1,#0 -L_Test1: - tst r3,r3 - bpl L_Test2 - rsbs r2,r2,#0 - rsc r3,r3,#0 -L_Test2: - bl ASM_PFX(__aeabi_uldivmod) - tst r4,#0x40000000 - beq L_Test3 - rsbs r0,r0,#0 - rsc r1,r1,#0 -L_Test3: - tst r4,#0x80000000 - beq L_Exit - rsbs r2,r2,#0 - rsc r3,r3,#0 -L_Exit: - pop {r4,pc} - - - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm deleted file mode 100644 index 9c14e89a01..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm +++ /dev/null @@ -1,58 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - EXPORT __aeabi_ldivmod - EXTERN __aeabi_uldivmod - - AREA Math, CODE, READONLY - -; -;UINT32 -;EFIAPI -;__aeabi_uidivmode ( -; IN UINT32 Dividen -; IN UINT32 Divisor -; ); -; - -__aeabi_ldivmod - PUSH {r4,lr} - ASRS r4,r1,#1 - EOR r4,r4,r3,LSR #1 - BPL L_Test1 - RSBS r0,r0,#0 - RSC r1,r1,#0 -L_Test1 - TST r3,r3 - BPL L_Test2 - RSBS r2,r2,#0 - RSC r3,r3,#0 -L_Test2 - BL __aeabi_uldivmod ; - TST r4,#0x40000000 - BEQ L_Test3 - RSBS r0,r0,#0 - RSC r1,r1,#0 -L_Test3 - TST r4,#0x80000000 - BEQ L_Exit - RSBS r2,r2,#0 - RSC r3,r3,#0 -L_Exit - POP {r4,pc} - - END - - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.S deleted file mode 100644 index ba8ab1cf58..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.S +++ /dev/null @@ -1,40 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2013, ARM. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - -.text -.align 2 -GCC_ASM_EXPORT(__aeabi_llsl) - -# -#VOID -#EFIAPI -#__aeabi_llsl ( -# IN VOID *Destination, -# IN VOID *Source, -# IN UINT32 Size -# ); -# -ASM_PFX(__aeabi_llsl): - subs r3,r2,#0x20 - bpl 1f - rsb r3,r2,#0x20 - lsl r1,r1,r2 - orr r1,r1,r0,lsr r3 - lsl r0,r0,r2 - bx lr -1: - lsl r1,r0,r3 - mov r0,#0 - bx lr diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.asm deleted file mode 100644 index f6fc208dee..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.asm +++ /dev/null @@ -1,43 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - EXPORT __aeabi_llsl - - AREA Math, CODE, READONLY - -; -;VOID -;EFIAPI -;__aeabi_llsl ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINT32 Size -; ); -; - -__aeabi_llsl - SUBS r3,r2,#0x20 - BPL {pc} + 0x18 ; 0x1c - RSB r3,r2,#0x20 - LSL r1,r1,r2 - ORR r1,r1,r0,LSR r3 - LSL r0,r0,r2 - BX lr - LSL r1,r0,r3 - MOV r0,#0 - BX lr - - END - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.S deleted file mode 100644 index 3d2c106270..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.S +++ /dev/null @@ -1,40 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2013, ARM. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - -.text -.align 2 -GCC_ASM_EXPORT(__aeabi_llsr) - -# -#VOID -#EFIAPI -#__aeabi_llsr ( -# IN VOID *Destination, -# IN VOID *Source, -# IN UINT32 Size -# ); -# -ASM_PFX(__aeabi_llsr): - subs r3,r2,#0x20 - bpl 1f - rsb r3,r2,#0x20 - lsr r0,r0,r2 - orr r0,r0,r1,lsl r3 - lsr r1,r1,r2 - bx lr -1: - lsr r0,r1,r3 - mov r1,#0 - bx lr diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm deleted file mode 100644 index 829c871d94..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm +++ /dev/null @@ -1,44 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - EXPORT __aeabi_llsr - - AREA Math, CODE, READONLY - -; -;VOID -;EFIAPI -;__aeabi_llsr ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINT32 Size -; ); -; -__aeabi_llsr - SUBS r3,r2,#0x20 - BPL {pc} + 0x18 ; 0x1c - RSB r3,r2,#0x20 - LSR r0,r0,r2 - ORR r0,r0,r1,LSL r3 - LSR r1,r1,r2 - BX lr - LSR r0,r1,r3 - MOV r1,#0 - BX lr - - END - - - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S deleted file mode 100644 index a3133206a5..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S +++ /dev/null @@ -1,35 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__lshrdi3) - -ASM_PFX(__lshrdi3): - cmp r2, #31 - bls L2 - cmp r2, #63 - subls r2, r2, #32 - movls r2, r1, lsr r2 - movhi r2, #0 - mov r0, r2 - mov r1, #0 - bx lr -L2: - cmp r2, #0 - rsbne r3, r2, #32 - movne r3, r1, asl r3 - movne r1, r1, lsr r2 - orrne r0, r3, r0, lsr r2 - bx lr diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.c deleted file mode 100644 index 2175cd9b54..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.c +++ /dev/null @@ -1,83 +0,0 @@ -/** @file - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - -#include "Llvm_int_lib.h" - -// Returns: logical a >> b - -// Precondition: 0 <= b < bits_in_dword - -INT64 -__lshrdi3(INT64 a, INT32 b) -{ - const int bits_in_word = (int)(sizeof(INT32) * CHAR_BIT); - udwords input; - udwords result; - input.all = a; - if (b & bits_in_word) // bits_in_word <= b < bits_in_dword - { - result.high = 0; - result.low = input.high >> (b - bits_in_word); - } - else // 0 <= b < bits_in_word - { - if (b == 0) - return a; - result.high = input.high >> b; - result.low = (input.high << (bits_in_word - b)) | (input.low >> b); - } - return result.all; -} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.S deleted file mode 100644 index b68ed8a6ea..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.S +++ /dev/null @@ -1,32 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__aeabi_memcpy) - GCC_ASM_EXPORT(memcpy) - -ASM_PFX(__aeabi_memcpy): -ASM_PFX(memcpy): - cmp r2, #0 - bxeq lr - push {lr} - mov lr, r0 -L5: - ldrb r3, [r1], #1 @ zero_extendqisi2 - strb r3, [lr], #1 - subs r2, r2, #1 - bne L5 - pop {pc} - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.asm deleted file mode 100644 index 60556b105d..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.asm +++ /dev/null @@ -1,41 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - EXPORT __aeabi_memcpy - - AREA Memcpy, CODE, READONLY - -; -;VOID -;EFIAPI -;__aeabi_memcpy ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINT32 Size -; ); -; -__aeabi_memcpy - cmp r2, #0 - bxeq lr - push {lr} - mov lr, r0 -L5 - ldrb r3, [r1], #1 - strb r3, [lr], #1 - subs r2, r2, #1 - bne L5 - pop {pc} - - END diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy4.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy4.asm deleted file mode 100644 index ecaa86f51e..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy4.asm +++ /dev/null @@ -1,61 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - EXPORT __aeabi_memcpy4 - - AREA Memcpy4, CODE, READONLY - -; -;VOID -;EFIAPI -;__aeabi_memcpy ( -; IN VOID *Destination, -; IN VOID *Source, -; IN UINT32 Size -; ); -; -__aeabi_memcpy4 - stmdb sp!, {r4, lr} - subs r2, r2, #32 ; 0x20 - bcc memcpy4_label2 -memcpy4_label1 - ldmcsia r1!, {r3, r4, ip, lr} - stmcsia r0!, {r3, r4, ip, lr} - ldmcsia r1!, {r3, r4, ip, lr} - stmcsia r0!, {r3, r4, ip, lr} - subcss r2, r2, #32 ; 0x20 - bcs memcpy4_label1 -memcpy4_label2 - movs ip, r2, lsl #28 - ldmcsia r1!, {r3, r4, ip, lr} - stmcsia r0!, {r3, r4, ip, lr} - ldmmiia r1!, {r3, r4} - stmmiia r0!, {r3, r4} - ldmia sp!, {r4, lr} - movs ip, r2, lsl #30 - ldrcs r3, [r1], #4 - strcs r3, [r0], #4 - bxeq lr - -_memcpy4_lastbytes_aligned - movs r2, r2, lsl #31 - ldrcsh r3, [r1], #2 - ldrmib r2, [r1], #1 - strcsh r3, [r0], #2 - strmib r2, [r0], #1 - bx lr - - END - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S deleted file mode 100644 index 79f95b007d..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S +++ /dev/null @@ -1,48 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2011-2014, ARM Limited. All rights reserved. -# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT (memmove) - -# VOID -# EFIAPI -# memmove ( -# IN VOID *Destination, -# IN CONST VOID *Source, -# IN UINT32 Size -# ); -ASM_PFX(memmove): - CMP r2, #0 - BXEQ lr - CMP r0, r1 - BXEQ lr - BHI memmove_backward - -memmove_forward: - LDRB r3, [r1], #1 - STRB r3, [r0], #1 - SUBS r2, r2, #1 - BXEQ lr - B memmove_forward - -memmove_backward: - add r0, r2 - add r1, r2 -memmove_backward_loop: - LDRB r3, [r1, #-1]! - STRB r3, [r0, #-1]! - SUBS r2, r2, #1 - BXEQ lr - B memmove_backward_loop diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.asm deleted file mode 100755 index 2147e29dbd..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.asm +++ /dev/null @@ -1,53 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2011-2014, ARM Limited. All rights reserved. -// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - EXPORT __aeabi_memmove - - AREA Memmove, CODE, READONLY - -; -;VOID -;EFIAPI -;__aeabi_memmove ( -; IN VOID *Destination, -; IN CONST VOID *Source, -; IN UINT32 Size -; ); -; -__aeabi_memmove - CMP r2, #0 - BXEQ lr - CMP r0, r1 - BXEQ lr - BHI memmove_backward - -memmove_forward - LDRB r3, [r1], #1 - STRB r3, [r0], #1 - SUBS r2, r2, #1 - BNE memmove_forward - BX lr - -memmove_backward - add r0, r2 - add r1, r2 -memmove_backward_loop - LDRB r3, [r1, #-1]! - STRB r3, [r0, #-1]! - SUBS r2, r2, #1 - BNE memmove_backward_loop - BX lr - - END diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S deleted file mode 100644 index 0c7789eb58..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S +++ /dev/null @@ -1,38 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Copyright (c) 2014, ARM Ltd. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - - .text - .align 2 - GCC_ASM_EXPORT (memset) - -# VOID -# EFIAPI -# memset ( -# IN VOID *Destination, -# IN UINT32 Character, -# IN UINT32 Size -# ); -ASM_PFX(memset): - cmp r2, #0 - bxeq lr - @ args = 0, pretend = 0, frame = 0 - @ frame_needed = 1, uses_anonymous_args = 0 -L10: - strb r1, [r0], #1 - subs r2, r2, #1 - @ While size is not 0 - bne L10 - bx lr diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.asm deleted file mode 100755 index bae3c1fada..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.asm +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// Copyright (c) 2014, ARM Ltd. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - EXPORT __aeabi_memset - EXPORT __aeabi_memclr - EXPORT __aeabi_memclr4 - - AREA Memset, CODE, READONLY - -; void __aeabi_memclr4(void *dest, size_t n); -; void __aeabi_memclr(void *dest, size_t n); -__aeabi_memclr -__aeabi_memclr4 - mov r2, #0 - -; -;VOID -;EFIAPI -;__aeabi_memset ( -; IN VOID *Destination, -; IN UINT32 Size, -; IN UINT32 Character -; ); -; -__aeabi_memset - cmp r1, #0 - bxeq lr - ; args = 0, pretend = 0, frame = 0 - ; frame_needed = 1, uses_anonymous_args = 0 -L10 - strb r2, [r0], #1 - subs r1, r1, #1 - ; While size is not 0 - bne L10 - bx lr - - END diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S deleted file mode 100644 index 7b618eb06b..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S +++ /dev/null @@ -1,46 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__moddi3) - -ASM_PFX(__moddi3): - stmfd sp!, {r4, r5, r7, lr} - mov r4, r1, asr #31 - add r7, sp, #8 - stmfd sp!, {r10, r11} - mov r10, r3, asr #31 - sub sp, sp, #16 - mov r5, r4 - mov r11, r10 - eor r0, r0, r4 - eor r1, r1, r4 - eor r2, r2, r10 - eor r3, r3, r10 - add ip, sp, #8 - subs r0, r0, r4 - sbc r1, r1, r5 - subs r2, r2, r10 - sbc r3, r3, r11 - str ip, [sp, #0] - bl ASM_PFX(__udivmoddi4) - ldrd r0, [sp, #8] - eor r0, r0, r4 - eor r1, r1, r4 - subs r0, r0, r4 - sbc r1, r1, r5 - sub sp, r7, #16 - ldmfd sp!, {r10, r11} - ldmfd sp!, {r4, r5, r7, pc} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.c deleted file mode 100644 index 04562de4c3..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.c +++ /dev/null @@ -1,77 +0,0 @@ -/** @file - Compiler intrinsic for 64-bit mod, ported from LLVM code. - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - - -#include "Llvm_int_lib.h" - -UINT64 __udivmoddi4(UINT64 a, UINT64 b, UINT64* rem); - -// Returns: a % b - -INT64 -__moddi3(INT64 a, INT64 b) -{ - const int bits_in_dword_m1 = (int)(sizeof(INT64) * CHAR_BIT) - 1; - INT64 s = b >> bits_in_dword_m1; // s = b < 0 ? -1 : 0 - b = (b ^ s) - s; // negate if s == -1 - s = a >> bits_in_dword_m1; // s = a < 0 ? -1 : 0 - a = (a ^ s) - s; // negate if s == -1 - INT64 r; - __udivmoddi4(a, b, (UINT64*)&r); - return (r ^ s) - s; // negate if s == -1 -} - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S deleted file mode 100644 index 047501e929..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S +++ /dev/null @@ -1,27 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__modsi3) - -ASM_PFX(__modsi3): - stmfd sp!, {r4, r5, r7, lr} - add r7, sp, #8 - mov r5, r0 - mov r4, r1 - bl ___divsi3 - mul r0, r4, r0 - rsb r0, r0, r5 - ldmfd sp!, {r4, r5, r7, pc} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.c deleted file mode 100644 index 91ee6aa279..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.c +++ /dev/null @@ -1,70 +0,0 @@ -/** @file - Compiler intrinsic for 32-bit mod, ported from LLVM code. - - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - - -#include "Llvm_int_lib.h" - -// Returns: a % b - -INT32 -__modsi3(INT32 a, INT32 b) -{ - return a - (a / b) * b; -} - - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S deleted file mode 100644 index dff61ef7a4..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S +++ /dev/null @@ -1,58 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__muldi3) - -ASM_PFX(__muldi3): - stmfd sp!, {r4, r5, r6, r7, lr} - add r7, sp, #12 - stmfd sp!, {r8, r10, r11} - ldr r11, L4 - mov r4, r0, lsr #16 - and r8, r0, r11 - and ip, r2, r11 - mul lr, ip, r8 - mul ip, r4, ip - sub sp, sp, #8 - add r10, ip, lr, lsr #16 - and ip, r10, r11 - and lr, lr, r11 - mov r6, r2, lsr #16 - str r4, [sp, #4] - add r4, lr, ip, asl #16 - mul ip, r8, r6 - mov r5, r10, lsr #16 - add r10, ip, r4, lsr #16 - and ip, r10, r11 - and lr, r4, r11 - add r4, lr, ip, asl #16 - mul r0, r3, r0 - add ip, r5, r10, lsr #16 - ldr r5, [sp, #4] - mla r0, r2, r1, r0 - mla r5, r6, r5, ip - mov r10, r4 - add r11, r0, r5 - mov r1, r11 - mov r0, r4 - sub sp, r7, #24 - ldmfd sp!, {r8, r10, r11} - ldmfd sp!, {r4, r5, r6, r7, pc} - .p2align 2 -L5: - .align 2 -L4: - .long 65535 diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.c deleted file mode 100644 index dbdda86c13..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.c +++ /dev/null @@ -1,98 +0,0 @@ -/** @file - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - -#include -#include "Llvm_int_lib.h" - - -// Returns: a * b - -static -INT64 -__muldsi3(UINT32 a, UINT32 b) -{ - dwords r; - const int bits_in_word_2 = (int)(sizeof(INT32) * CHAR_BIT) / 2; - const UINT32 lower_mask = (UINT32)~0 >> bits_in_word_2; - r.low = (a & lower_mask) * (b & lower_mask); - UINT32 t = r.low >> bits_in_word_2; - r.low &= lower_mask; - t += (a >> bits_in_word_2) * (b & lower_mask); - r.low += (t & lower_mask) << bits_in_word_2; - r.high = t >> bits_in_word_2; - t = r.low >> bits_in_word_2; - r.low &= lower_mask; - t += (b >> bits_in_word_2) * (a & lower_mask); - r.low += (t & lower_mask) << bits_in_word_2; - r.high += t >> bits_in_word_2; - r.high += (a >> bits_in_word_2) * (b >> bits_in_word_2); - return r.all; -} - -// Returns: a * b - -INT64 -__muldi3(INT64 a, INT64 b) -{ - dwords x; - x.all = a; - dwords y; - y.all = b; - dwords r; - r.all = __muldsi3(x.low, y.low); - r.high += x.high * y.low + x.low * y.high; - return r.all; -} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.S deleted file mode 100644 index e65355970b..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.S +++ /dev/null @@ -1,44 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ -.text - -GCC_ASM_EXPORT(__ARM_ll_mullu) -GCC_ASM_EXPORT(__aeabi_lmul) -# -#INT64 -#EFIAPI -#__aeabi_lmul ( -# IN INT64 Multiplicand -# IN INT32 Multiplier -# ); -# -ASM_PFX(__ARM_ll_mullu): - mov r3, #0 -# Make upper part of INT64 Multiplier 0 and use __aeabi_lmul - -# -#INT64 -#EFIAPI -#__aeabi_lmul ( -# IN INT64 Multiplicand -# IN INT64 Multiplier -# ); -# -ASM_PFX(__aeabi_lmul): - stmdb sp!, {lr} - mov lr, r0 - umull r0, ip, r2, lr - mla r1, r2, r1, ip - mla r1, r3, lr, r1 - ldmia sp!, {pc} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.asm deleted file mode 100644 index 3451c2c943..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.asm +++ /dev/null @@ -1,49 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - EXPORT __ARM_ll_mullu - EXPORT __aeabi_lmul - - AREA Math, CODE, READONLY - -; -;INT64 -;EFIAPI -;__aeabi_lmul ( -; IN INT64 Multiplicand -; IN INT32 Multiplier -; ); -; -__ARM_ll_mullu - mov r3, #0 -// Make upper part of INT64 Multiplier 0 and use __aeabi_lmul - -; -;INT64 -;EFIAPI -;__aeabi_lmul ( -; IN INT64 Multiplicand -; IN INT64 Multiplier -; ); -; -__aeabi_lmul - stmdb sp!, {lr} - mov lr, r0 - umull r0, ip, r2, lr - mla r1, r2, r1, ip - mla r1, r3, lr, r1 - ldmia sp!, {pc} - - END diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S deleted file mode 100755 index 1e0b524cfe..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S +++ /dev/null @@ -1,55 +0,0 @@ -#------s------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - - .text - .align 2 - GCC_ASM_EXPORT(__aeabi_ulcmp) - -ASM_PFX(__aeabi_ulcmp): - stmfd sp!, {r4, r5, r8} - cmp r3, r1 - mov r8, r0 - mov r9, r1 - mov r4, r2 - mov r5, r3 - bls L16 -L2: - mvn r0, #0 -L1: - ldmfd sp!, {r4, r5, r8} - bx lr -L16: - beq L17 -L4: - cmp r9, r5 - bhi L7 - beq L18 - cmp r8, r4 -L14: - cmpeq r9, r5 - moveq r0, #0 - beq L1 - b L1 -L18: - cmp r8, r4 - bls L14 -L7: - mov r0, #1 - b L1 -L17: - cmp r2, r0 - bhi L2 - b L4 - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch.asm deleted file mode 100644 index e09c90cda4..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch.asm +++ /dev/null @@ -1,29 +0,0 @@ -///------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - - EXPORT __ARM_switch8 - - AREA ArmSwitch, CODE, READONLY - -__ARM_switch8 - LDRB r12,[lr,#-1] - CMP r3,r12 - LDRBCC r3,[lr,r3] - LDRBCS r3,[lr,r12] - ADD r12,lr,r3,LSL #1 - BX r12 - - END diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch16.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch16.S deleted file mode 100644 index 7f41353e01..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch16.S +++ /dev/null @@ -1,31 +0,0 @@ -#/** @file -# Compiler intrinsic for ARM compiler -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.; -# -#**/ -# - -.text -.p2align 2 - -GCC_ASM_EXPORT(__switch16) - -ASM_PFX(__switch16): - ldrh ip, [lr, #-1] - cmp r0, ip - add r0, lr, r0, lsl #1 - ldrccsh r0, [r0, #1] - add ip, lr, ip, lsl #1 - ldrcssh r0, [ip, #1] - add ip, lr, r0, lsl #1 - bx ip - - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch32.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch32.S deleted file mode 100644 index 8675a4aeb7..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch32.S +++ /dev/null @@ -1,30 +0,0 @@ -#/** @file -# Compiler intrinsic for ARM compiler -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.; -# -#**/ -# - -.text -.p2align 2 - -GCC_ASM_EXPORT(__switch32) - -ASM_PFX(__switch32): - ldr ip, [lr, #-1] - cmp r0, ip - add r0, lr, r0, lsl #2 - ldrcc r0, [r0, #3] - add ip, lr, ip, lsl #2 - ldrcs r0, [ip, #3] - add ip, lr, r0 - bx ip - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch8.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch8.S deleted file mode 100644 index 27edccbf77..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch8.S +++ /dev/null @@ -1,28 +0,0 @@ -#/** @file -# Compiler intrinsic for ARM compiler -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http)://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.; -# -#**/ -# - -.text -.p2align 2 - -GCC_ASM_EXPORT(__switch8) - -ASM_PFX(__switch8): - ldrb ip, [lr, #-1] - cmp r0, ip - ldrccsb r0, [lr, r0] - ldrcssb r0, [lr, ip] - add ip, lr, r0, lsl #1 - bx ip - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S deleted file mode 100644 index 39c4a7fdff..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S +++ /dev/null @@ -1,29 +0,0 @@ -#/** @file -# Compiler intrinsic for ARM compiler -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http)://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.; -# -#**/ -# - -.text -.p2align 2 - -GCC_ASM_EXPORT(__switchu8) - - -ASM_PFX(__switchu8): - ldrb ip,[lr,#-1] - cmp r0,ip - ldrccb r0,[lr,r0] - ldrcsb r0,[lr,ip] - add ip,lr,r0,LSL #1 - bx ip - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S deleted file mode 100644 index da57423bf1..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S +++ /dev/null @@ -1,38 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__ucmpdi2) - -ASM_PFX(__ucmpdi2): - stmfd sp!, {r4, r5, r8, lr} - cmp r1, r3 - mov r8, r0 - mov r4, r2 - mov r5, r3 - bcc L2 - bhi L4 - cmp r0, r2 - bcc L2 - movls r0, #1 - bls L8 - b L4 -L2: - mov r0, #0 - b L8 -L4: - mov r0, #2 -L8: - ldmfd sp!, {r4, r5, r8, pc} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.c deleted file mode 100644 index aa03a3db39..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.c +++ /dev/null @@ -1,82 +0,0 @@ -/** @file - Compiler intrinsic for 64-bit compare, ported from LLVM code. - - Copyright (c) 2008-2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - - -#include "Llvm_int_lib.h" - - -// Returns: if (a < b) returns 0 -// if (a == b) returns 1 -// if (a > b) returns 2 - -UINT32 -__ucmpdi2(UINT64 a, UINT64 b) -{ - udwords x; - x.all = a; - udwords y; - y.all = b; - if (x.high < y.high) - return 0; - if (x.high > y.high) - return 2; - if (x.low < y.low) - return 0; - if (x.low > y.low) - return 2; - return 1; -} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S deleted file mode 100644 index cbfb127350..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S +++ /dev/null @@ -1,27 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__udivdi3) - -ASM_PFX(__udivdi3): - stmfd sp!, {r7, lr} - add r7, sp, #0 - sub sp, sp, #8 - mov ip, #0 - str ip, [sp, #0] - bl ASM_PFX(__udivmoddi4) - sub sp, r7, #0 - ldmfd sp!, {r7, pc} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.c deleted file mode 100644 index fc383b47e8..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.c +++ /dev/null @@ -1,71 +0,0 @@ -/** @file - Compiler intrinsic for 64-bit unisigned div, ported from LLVM code. - - Copyright (c) 2008-2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - - -#include "Llvm_int_lib.h" - -UINT64 __udivmoddi4 (UINT64 a, UINT64 b, UINT64 *rem); - -// Returns: a / b - -UINT64 -__udivdi3(UINT64 a, UINT64 b) -{ - return __udivmoddi4(a, b, 0); -} - - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S deleted file mode 100644 index 4c0ef5a598..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S +++ /dev/null @@ -1,242 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__udivmoddi4) - -ASM_PFX(__udivmoddi4): - stmfd sp!, {r4, r5, r6, r7, lr} - add r7, sp, #12 - stmfd sp!, {r10, r11} - sub sp, sp, #20 - stmia sp, {r2-r3} - ldr r6, [sp, #48] - orrs r2, r2, r3 - mov r10, r0 - mov r11, r1 - beq L2 - subs ip, r1, #0 - bne L4 - cmp r3, #0 - bne L6 - cmp r6, #0 - beq L8 - mov r1, r2 - bl ASM_PFX(__umodsi3) - mov r1, #0 - stmia r6, {r0-r1} -L8: - ldr r1, [sp, #0] - mov r0, r10 - b L45 -L6: - cmp r6, #0 - movne r1, #0 - stmneia r6, {r0-r1} - b L2 -L4: - ldr r1, [sp, #0] - cmp r1, #0 - bne L12 - ldr r2, [sp, #4] - cmp r2, #0 - bne L14 - cmp r6, #0 - beq L16 - mov r1, r2 - mov r0, r11 - bl ASM_PFX(__umodsi3) - mov r1, #0 - stmia r6, {r0-r1} -L16: - ldr r1, [sp, #4] - mov r0, r11 -L45: - bl ASM_PFX(__udivsi3) -L46: - mov r10, r0 - mov r11, #0 - b L10 -L14: - subs r1, r0, #0 - bne L18 - cmp r6, #0 - beq L16 - ldr r1, [sp, #4] - mov r0, r11 - bl ASM_PFX(__umodsi3) - mov r4, r10 - mov r5, r0 - stmia r6, {r4-r5} - b L16 -L18: - sub r3, r2, #1 - tst r2, r3 - bne L22 - cmp r6, #0 - movne r4, r0 - andne r5, ip, r3 - stmneia r6, {r4-r5} -L24: - rsb r3, r2, #0 - and r3, r2, r3 - clz r3, r3 - rsb r3, r3, #31 - mov r0, ip, lsr r3 - b L46 -L22: - clz r2, r2 - clz r3, ip - rsb r3, r3, r2 - cmp r3, #30 - bhi L48 - rsb r2, r3, #31 - add lr, r3, #1 - mov r3, r1, asl r2 - str r3, [sp, #12] - mov r3, r1, lsr lr - ldr r0, [sp, #0] - mov r5, ip, lsr lr - orr r4, r3, ip, asl r2 - str r0, [sp, #8] - b L29 -L12: - ldr r3, [sp, #4] - cmp r3, #0 - bne L30 - sub r3, r1, #1 - tst r1, r3 - bne L32 - cmp r6, #0 - andne r3, r3, r0 - movne r2, r3 - movne r3, #0 - stmneia r6, {r2-r3} -L34: - cmp r1, #1 - beq L10 - rsb r3, r1, #0 - and r3, r1, r3 - clz r3, r3 - rsb r0, r3, #31 - mov r1, ip, lsr r0 - rsb r3, r0, #32 - mov r0, r10, lsr r0 - orr ip, r0, ip, asl r3 - str r1, [sp, #12] - str ip, [sp, #8] - ldrd r10, [sp, #8] - b L10 -L32: - clz r2, r1 - clz r3, ip - rsb r3, r3, r2 - rsb r4, r3, #31 - mov r2, r0, asl r4 - mvn r1, r3 - and r2, r2, r1, asr #31 - add lr, r3, #33 - str r2, [sp, #8] - add r2, r3, #1 - mov r3, r3, asr #31 - and r0, r3, r0, asl r1 - mov r3, r10, lsr r2 - orr r3, r3, ip, asl r4 - and r3, r3, r1, asr #31 - orr r0, r0, r3 - mov r3, ip, lsr lr - str r0, [sp, #12] - mov r0, r10, lsr lr - and r5, r3, r2, asr #31 - rsb r3, lr, #31 - mov r3, r3, asr #31 - orr r0, r0, ip, asl r1 - and r3, r3, ip, lsr r2 - and r0, r0, r2, asr #31 - orr r4, r3, r0 - b L29 -L30: - clz r2, r3 - clz r3, ip - rsb r3, r3, r2 - cmp r3, #31 - bls L37 -L48: - cmp r6, #0 - stmneia r6, {r10-r11} - b L2 -L37: - rsb r1, r3, #31 - mov r0, r0, asl r1 - add lr, r3, #1 - mov r2, #0 - str r0, [sp, #12] - mov r0, r10, lsr lr - str r2, [sp, #8] - sub r2, r3, #31 - and r0, r0, r2, asr #31 - mov r3, ip, lsr lr - orr r4, r0, ip, asl r1 - and r5, r3, r2, asr #31 -L29: - mov ip, #0 - mov r10, ip - b L40 -L41: - ldr r1, [sp, #12] - ldr r2, [sp, #8] - mov r3, r4, lsr #31 - orr r5, r3, r5, asl #1 - mov r3, r1, lsr #31 - orr r4, r3, r4, asl #1 - mov r3, r2, lsr #31 - orr r0, r3, r1, asl #1 - orr r1, ip, r2, asl #1 - ldmia sp, {r2-r3} - str r0, [sp, #12] - subs r2, r2, r4 - sbc r3, r3, r5 - str r1, [sp, #8] - subs r0, r2, #1 - sbc r1, r3, #0 - mov r2, r1, asr #31 - ldmia sp, {r0-r1} - mov r3, r2 - and ip, r2, #1 - and r3, r3, r1 - and r2, r2, r0 - subs r4, r4, r2 - sbc r5, r5, r3 - add r10, r10, #1 -L40: - cmp r10, lr - bne L41 - ldrd r0, [sp, #8] - adds r0, r0, r0 - adc r1, r1, r1 - cmp r6, #0 - orr r10, r0, ip - mov r11, r1 - stmneia r6, {r4-r5} - b L10 -L2: - mov r10, #0 - mov r11, #0 -L10: - mov r0, r10 - mov r1, r11 - sub sp, r7, #20 - ldmfd sp!, {r10, r11} - ldmfd sp!, {r4, r5, r6, r7, pc} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.c deleted file mode 100644 index a268596a11..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.c +++ /dev/null @@ -1,287 +0,0 @@ -/** @file - Compiler intrinsic for 64-bit compare, ported from LLVM code. - - Copyright (c) 2008-2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - - -#include "Llvm_int_lib.h" - -// Effects: if rem != 0, *rem = a % b -// Returns: a / b - -// Translated from Figure 3-40 of The PowerPC Compiler Writer's Guide - -UINT64 -__udivmoddi4 (UINT64 a, UINT64 b, UINT64* rem) -{ - const unsigned n_uword_bits = sizeof(UINT32) * CHAR_BIT; - const unsigned n_udword_bits = sizeof(UINT64) * CHAR_BIT; - udwords n; - n.all = a; - udwords d; - d.all = b; - udwords q; - udwords r; - unsigned sr; - - if (b == 0) { -// ASSERT (FALSE); - return 0; - } - - // special cases, X is unknown, K != 0 - if (n.high == 0) - { - if (d.high == 0) - { - // 0 X - // --- - // 0 X - if (rem) - *rem = n.low % d.low; - return n.low / d.low; - } - // 0 X - // --- - // K X - if (rem) - *rem = n.low; - return 0; - } - // n.high != 0 - if (d.low == 0) - { - if (d.high == 0) - { - // K X - // --- - // 0 0 - if (rem) - *rem = n.high % d.low; - return n.high / d.low; - } - // d.high != 0 - if (n.low == 0) - { - // K 0 - // --- - // K 0 - if (rem) - { - r.high = n.high % d.high; - r.low = 0; - *rem = r.all; - } - return n.high / d.high; - } - // K K - // --- - // K 0 - if ((d.high & (d.high - 1)) == 0) // if d is a power of 2 - { - if (rem) - { - r.low = n.low; - r.high = n.high & (d.high - 1); - *rem = r.all; - } - return n.high >> COUNT_TRAILING_ZEROS(d.high); - } - // K K - // --- - // K 0 - sr = COUNT_LEADING_ZEROS(d.high) - COUNT_LEADING_ZEROS(n.high); - // 0 <= sr <= n_uword_bits - 2 or sr large - if (sr > n_uword_bits - 2) - { - if (rem) - *rem = n.all; - return 0; - } - ++sr; - // 1 <= sr <= n_uword_bits - 1 - // q.all = n.all << (n_udword_bits - sr); - q.low = 0; - q.high = n.low << (n_uword_bits - sr); - // r.all = n.all >> sr; - r.high = n.high >> sr; - r.low = (n.high << (n_uword_bits - sr)) | (n.low >> sr); - } - else // d.low != 0 - { - if (d.high == 0) - { - // K X - // --- - // 0 K - if ((d.low & (d.low - 1)) == 0) // if d is a power of 2 - { - if (rem) - *rem = n.low & (d.low - 1); - if (d.low == 1) - return n.all; - unsigned sr = COUNT_TRAILING_ZEROS(d.low); - q.high = n.high >> sr; - q.low = (n.high << (n_uword_bits - sr)) | (n.low >> sr); - return q.all; - } - // K X - // --- - // 0 K - sr = 1 + n_uword_bits + COUNT_LEADING_ZEROS(d.low) - COUNT_LEADING_ZEROS(n.high); - // 2 <= sr <= n_udword_bits - 1 - // q.all = n.all << (n_udword_bits - sr); - // r.all = n.all >> sr; - // if (sr == n_uword_bits) - // { - // q.low = 0; - // q.high = n.low; - // r.high = 0; - // r.low = n.high; - // } - // else if (sr < n_uword_bits) // 2 <= sr <= n_uword_bits - 1 - // { - // q.low = 0; - // q.high = n.low << (n_uword_bits - sr); - // r.high = n.high >> sr; - // r.low = (n.high << (n_uword_bits - sr)) | (n.low >> sr); - // } - // else // n_uword_bits + 1 <= sr <= n_udword_bits - 1 - // { - // q.low = n.low << (n_udword_bits - sr); - // q.high = (n.high << (n_udword_bits - sr)) | - // (n.low >> (sr - n_uword_bits)); - // r.high = 0; - // r.low = n.high >> (sr - n_uword_bits); - // } - q.low = (n.low << (n_udword_bits - sr)) & - ((INT32)(n_uword_bits - sr) >> (n_uword_bits-1)); - q.high = ((n.low << ( n_uword_bits - sr)) & - ((INT32)(sr - n_uword_bits - 1) >> (n_uword_bits-1))) | - (((n.high << (n_udword_bits - sr)) | - (n.low >> (sr - n_uword_bits))) & - ((INT32)(n_uword_bits - sr) >> (n_uword_bits-1))); - r.high = (n.high >> sr) & - ((INT32)(sr - n_uword_bits) >> (n_uword_bits-1)); - r.low = ((n.high >> (sr - n_uword_bits)) & - ((INT32)(n_uword_bits - sr - 1) >> (n_uword_bits-1))) | - (((n.high << (n_uword_bits - sr)) | - (n.low >> sr)) & - ((INT32)(sr - n_uword_bits) >> (n_uword_bits-1))); - } - else - { - // K X - // --- - // K K - sr = COUNT_LEADING_ZEROS(d.high) - COUNT_LEADING_ZEROS(n.high); - // 0 <= sr <= n_uword_bits - 1 or sr large - if (sr > n_uword_bits - 1) - { - if (rem) - *rem = n.all; - return 0; - } - ++sr; - // 1 <= sr <= n_uword_bits - // q.all = n.all << (n_udword_bits - sr); - q.low = 0; - q.high = n.low << (n_uword_bits - sr); - // r.all = n.all >> sr; - // if (sr < n_uword_bits) - // { - // r.high = n.high >> sr; - // r.low = (n.high << (n_uword_bits - sr)) | (n.low >> sr); - // } - // else - // { - // r.high = 0; - // r.low = n.high; - // } - r.high = (n.high >> sr) & - ((INT32)(sr - n_uword_bits) >> (n_uword_bits-1)); - r.low = (n.high << (n_uword_bits - sr)) | - ((n.low >> sr) & - ((INT32)(sr - n_uword_bits) >> (n_uword_bits-1))); - } - } - // Not a special case - // q and r are initialized with: - // q.all = n.all << (n_udword_bits - sr); - // r.all = n.all >> sr; - // 1 <= sr <= n_udword_bits - 1 - UINT32 carry = 0; - for (; sr > 0; --sr) - { - // r:q = ((r:q) << 1) | carry - r.high = (r.high << 1) | (r.low >> (n_uword_bits - 1)); - r.low = (r.low << 1) | (q.high >> (n_uword_bits - 1)); - q.high = (q.high << 1) | (q.low >> (n_uword_bits - 1)); - q.low = (q.low << 1) | carry; - // carry = 0; - // if (r.all >= d.all) - // { - // r.all -= d.all; - // carry = 1; - // } - const INT64 s = (INT64)(d.all - r.all - 1) >> (n_udword_bits - 1); - carry = s & 1; - r.all -= d.all & s; - } - q.all = (q.all << 1) | carry; - if (rem) - *rem = r.all; - return q.all; -} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S deleted file mode 100644 index 5e2d31cc11..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S +++ /dev/null @@ -1,57 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__udivsi3) - -ASM_PFX(__udivsi3): - cmp r1, #0 - cmpne r0, #0 - stmfd sp!, {r4, r5, r7, lr} - add r7, sp, #8 - beq L2 - clz r2, r1 - clz r3, r0 - rsb r3, r3, r2 - cmp r3, #31 - bhi L2 - ldmeqfd sp!, {r4, r5, r7, pc} - add r5, r3, #1 - rsb r3, r3, #31 - mov lr, #0 - mov r2, r0, asl r3 - mov ip, r0, lsr r5 - mov r4, lr - b L8 -L9: - mov r0, r2, lsr #31 - orr ip, r0, ip, asl #1 - orr r2, r3, lr - rsb r3, ip, r1 - sub r3, r3, #1 - and r0, r1, r3, asr #31 - mov lr, r3, lsr #31 - rsb ip, r0, ip - add r4, r4, #1 -L8: - cmp r4, r5 - mov r3, r2, asl #1 - bne L9 - orr r0, r3, lr - ldmfd sp!, {r4, r5, r7, pc} -L2: - mov r0, #0 - ldmfd sp!, {r4, r5, r7, pc} - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.c deleted file mode 100644 index 8b9cb9f170..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.c +++ /dev/null @@ -1,111 +0,0 @@ -/** @file - Compiler intrinsic for 32-bit unsigned div, ported from LLVM code. - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - - -#include "Llvm_int_lib.h" - - -// Returns: n / d - -// Translated from Figure 3-40 of The PowerPC Compiler Writer's Guide - -UINT32 -__udivsi3(UINT32 n, UINT32 d) -{ - const unsigned n_uword_bits = sizeof(UINT32) * CHAR_BIT; - UINT32 q; - UINT32 r; - unsigned sr; - - // special cases - if (d == 0) { -// ASSERT (FALSE); - return 0; // ?! - } - if (n == 0) - return 0; - - sr = COUNT_LEADING_ZEROS(d) - COUNT_LEADING_ZEROS(n); - // 0 <= sr <= n_uword_bits - 1 or sr large - if (sr > n_uword_bits - 1) // d > r - return 0; - if (sr == n_uword_bits - 1) // d == 1 - return n; - ++sr; - // 1 <= sr <= n_uword_bits - 1 - // Not a special case - q = n << (n_uword_bits - sr); - r = n >> sr; - UINT32 carry = 0; - for (; sr > 0; --sr) - { - // r:q = ((r:q) << 1) | carry - r = (r << 1) | (q >> (n_uword_bits - 1)); - q = (q << 1) | carry; - // carry = 0; - // if (r.all >= d.all) - // { - // r.all -= d.all; - // carry = 1; - // } - const INT32 s = (INT32)(d - r - 1) >> (n_uword_bits - 1); - carry = s & 1; - r -= d & s; - } - q = (q << 1) | carry; - return q; -} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S deleted file mode 100755 index 4481c6d677..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S +++ /dev/null @@ -1,267 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - - .text - .align 2 - GCC_ASM_EXPORT(__aeabi_uldivmod) - -// -//UINT64 -//EFIAPI -//__aeabi_uldivmod ( -// IN UINT64 Dividend -// IN UINT64 Divisor -// ) -// -ASM_PFX(__aeabi_uldivmod): - stmdb sp!, {r4, r5, r6, lr} - mov r4, r1 - mov r5, r0 - mov r6, #0 // 0x0 - orrs ip, r3, r2, lsr #31 - bne ASM_PFX(__aeabi_uldivmod_label1) - tst r2, r2 - beq ASM_PFX(_ll_div0) - movs ip, r2, lsr #15 - addeq r6, r6, #16 // 0x10 - mov ip, r2, lsl r6 - movs lr, ip, lsr #23 - moveq ip, ip, lsl #8 - addeq r6, r6, #8 // 0x8 - movs lr, ip, lsr #27 - moveq ip, ip, lsl #4 - addeq r6, r6, #4 // 0x4 - movs lr, ip, lsr #29 - moveq ip, ip, lsl #2 - addeq r6, r6, #2 // 0x2 - movs lr, ip, lsr #30 - moveq ip, ip, lsl #1 - addeq r6, r6, #1 // 0x1 - b ASM_PFX(_ll_udiv_small) -ASM_PFX(__aeabi_uldivmod_label1): - tst r3, #-2147483648 // 0x80000000 - bne ASM_PFX(__aeabi_uldivmod_label2) - movs ip, r3, lsr #15 - addeq r6, r6, #16 // 0x10 - mov ip, r3, lsl r6 - movs lr, ip, lsr #23 - moveq ip, ip, lsl #8 - addeq r6, r6, #8 // 0x8 - movs lr, ip, lsr #27 - moveq ip, ip, lsl #4 - addeq r6, r6, #4 // 0x4 - movs lr, ip, lsr #29 - moveq ip, ip, lsl #2 - addeq r6, r6, #2 // 0x2 - movs lr, ip, lsr #30 - addeq r6, r6, #1 // 0x1 - rsb r3, r6, #32 // 0x20 - moveq ip, ip, lsl #1 - orr ip, ip, r2, lsr r3 - mov lr, r2, lsl r6 - b ASM_PFX(_ll_udiv_big) -ASM_PFX(__aeabi_uldivmod_label2): - mov ip, r3 - mov lr, r2 - b ASM_PFX(_ll_udiv_ginormous) - -ASM_PFX(_ll_udiv_small): - cmp r4, ip, lsl #1 - mov r3, #0 // 0x0 - subcs r4, r4, ip, lsl #1 - addcs r3, r3, #2 // 0x2 - cmp r4, ip - subcs r4, r4, ip - adcs r3, r3, #0 // 0x0 - add r2, r6, #32 // 0x20 - cmp r2, #32 // 0x20 - rsb ip, ip, #0 // 0x0 - bcc ASM_PFX(_ll_udiv_small_label1) - orrs r0, r4, r5, lsr #30 - moveq r4, r5 - moveq r5, #0 // 0x0 - subeq r2, r2, #32 // 0x20 -ASM_PFX(_ll_udiv_small_label1): - mov r1, #0 // 0x0 - cmp r2, #16 // 0x10 - bcc ASM_PFX(_ll_udiv_small_label2) - movs r0, r4, lsr #14 - moveq r4, r4, lsl #16 - addeq r1, r1, #16 // 0x10 -ASM_PFX(_ll_udiv_small_label2): - sub lr, r2, r1 - cmp lr, #8 // 0x8 - bcc ASM_PFX(_ll_udiv_small_label3) - movs r0, r4, lsr #22 - moveq r4, r4, lsl #8 - addeq r1, r1, #8 // 0x8 -ASM_PFX(_ll_udiv_small_label3): - rsb r0, r1, #32 // 0x20 - sub r2, r2, r1 - orr r4, r4, r5, lsr r0 - mov r5, r5, lsl r1 - cmp r2, #1 // 0x1 - bcc ASM_PFX(_ll_udiv_small_label5) - sub r2, r2, #1 // 0x1 - and r0, r2, #7 // 0x7 - eor r0, r0, #7 // 0x7 - adds r0, r0, r0, lsl #1 - add pc, pc, r0, lsl #2 - nop // (mov r0,r0) -ASM_PFX(_ll_udiv_small_label4): - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - rsbcc r4, ip, r4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - rsbcc r4, ip, r4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - rsbcc r4, ip, r4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - rsbcc r4, ip, r4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - rsbcc r4, ip, r4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - rsbcc r4, ip, r4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - rsbcc r4, ip, r4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - sub r2, r2, #8 // 0x8 - tst r2, r2 - rsbcc r4, ip, r4 - bpl ASM_PFX(_ll_udiv_small_label4) -ASM_PFX(_ll_udiv_small_label5): - mov r2, r4, lsr r6 - bic r4, r4, r2, lsl r6 - adcs r0, r5, r5 - adc r1, r4, r4 - add r1, r1, r3, lsl r6 - mov r3, #0 // 0x0 - ldmia sp!, {r4, r5, r6, pc} - -ASM_PFX(_ll_udiv_big): - subs r0, r5, lr - mov r3, #0 // 0x0 - sbcs r1, r4, ip - movcs r5, r0 - movcs r4, r1 - adcs r3, r3, #0 // 0x0 - subs r0, r5, lr - sbcs r1, r4, ip - movcs r5, r0 - movcs r4, r1 - adcs r3, r3, #0 // 0x0 - subs r0, r5, lr - sbcs r1, r4, ip - movcs r5, r0 - movcs r4, r1 - adcs r3, r3, #0 // 0x0 - mov r1, #0 // 0x0 - rsbs lr, lr, #0 // 0x0 - rsc ip, ip, #0 // 0x0 - cmp r6, #16 // 0x10 - bcc ASM_PFX(_ll_udiv_big_label1) - movs r0, r4, lsr #14 - moveq r4, r4, lsl #16 - addeq r1, r1, #16 // 0x10 -ASM_PFX(_ll_udiv_big_label1): - sub r2, r6, r1 - cmp r2, #8 // 0x8 - bcc ASM_PFX(_ll_udiv_big_label2) - movs r0, r4, lsr #22 - moveq r4, r4, lsl #8 - addeq r1, r1, #8 // 0x8 -ASM_PFX(_ll_udiv_big_label2): - rsb r0, r1, #32 // 0x20 - sub r2, r6, r1 - orr r4, r4, r5, lsr r0 - mov r5, r5, lsl r1 - cmp r2, #1 // 0x1 - bcc ASM_PFX(_ll_udiv_big_label4) - sub r2, r2, #1 // 0x1 - and r0, r2, #3 // 0x3 - rsb r0, r0, #3 // 0x3 - adds r0, r0, r0, lsl #1 - add pc, pc, r0, lsl #3 - nop // (mov r0,r0) -ASM_PFX(_ll_udiv_big_label3): - adcs r5, r5, r5 - adcs r4, r4, r4 - adcs r0, lr, r5 - adcs r1, ip, r4 - movcs r5, r0 - movcs r4, r1 - adcs r5, r5, r5 - adcs r4, r4, r4 - adcs r0, lr, r5 - adcs r1, ip, r4 - movcs r5, r0 - movcs r4, r1 - adcs r5, r5, r5 - adcs r4, r4, r4 - adcs r0, lr, r5 - adcs r1, ip, r4 - movcs r5, r0 - movcs r4, r1 - sub r2, r2, #4 // 0x4 - adcs r5, r5, r5 - adcs r4, r4, r4 - adcs r0, lr, r5 - adcs r1, ip, r4 - tst r2, r2 - movcs r5, r0 - movcs r4, r1 - bpl ASM_PFX(_ll_udiv_big_label3) -ASM_PFX(_ll_udiv_big_label4): - mov r1, #0 // 0x0 - mov r2, r5, lsr r6 - bic r5, r5, r2, lsl r6 - adcs r0, r5, r5 - adc r1, r1, #0 // 0x0 - movs lr, r3, lsl r6 - mov r3, r4, lsr r6 - bic r4, r4, r3, lsl r6 - adc r1, r1, #0 // 0x0 - adds r0, r0, lr - orr r2, r2, r4, ror r6 - adc r1, r1, #0 // 0x0 - ldmia sp!, {r4, r5, r6, pc} - -ASM_PFX(_ll_udiv_ginormous): - subs r2, r5, lr - mov r1, #0 // 0x0 - sbcs r3, r4, ip - adc r0, r1, r1 - movcc r2, r5 - movcc r3, r4 - ldmia sp!, {r4, r5, r6, pc} - -ASM_PFX(_ll_div0): - ldmia sp!, {r4, r5, r6, lr} - mov r0, #0 // 0x0 - mov r1, #0 // 0x0 - b ASM_PFX(__aeabi_ldiv0) - -ASM_PFX(__aeabi_ldiv0): - bx r14 - - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm deleted file mode 100644 index aed649b151..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm +++ /dev/null @@ -1,268 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - - EXPORT __aeabi_uldivmod - - AREA Uldivmod, CODE, READONLY - -; -;UINT64 -;EFIAPI -;__aeabi_uldivmod ( -; IN UINT64 Dividend -; IN UINT64 Divisor -; ) -; -__aeabi_uldivmod - stmdb sp!, {r4, r5, r6, lr} - mov r4, r1 - mov r5, r0 - mov r6, #0 ; 0x0 - orrs ip, r3, r2, lsr #31 - bne __aeabi_uldivmod_label1 - tst r2, r2 - beq _ll_div0 - movs ip, r2, lsr #15 - addeq r6, r6, #16 ; 0x10 - mov ip, r2, lsl r6 - movs lr, ip, lsr #23 - moveq ip, ip, lsl #8 - addeq r6, r6, #8 ; 0x8 - movs lr, ip, lsr #27 - moveq ip, ip, lsl #4 - addeq r6, r6, #4 ; 0x4 - movs lr, ip, lsr #29 - moveq ip, ip, lsl #2 - addeq r6, r6, #2 ; 0x2 - movs lr, ip, lsr #30 - moveq ip, ip, lsl #1 - addeq r6, r6, #1 ; 0x1 - b _ll_udiv_small -__aeabi_uldivmod_label1 - tst r3, #-2147483648 ; 0x80000000 - bne __aeabi_uldivmod_label2 - movs ip, r3, lsr #15 - addeq r6, r6, #16 ; 0x10 - mov ip, r3, lsl r6 - movs lr, ip, lsr #23 - moveq ip, ip, lsl #8 - addeq r6, r6, #8 ; 0x8 - movs lr, ip, lsr #27 - moveq ip, ip, lsl #4 - addeq r6, r6, #4 ; 0x4 - movs lr, ip, lsr #29 - moveq ip, ip, lsl #2 - addeq r6, r6, #2 ; 0x2 - movs lr, ip, lsr #30 - addeq r6, r6, #1 ; 0x1 - rsb r3, r6, #32 ; 0x20 - moveq ip, ip, lsl #1 - orr ip, ip, r2, lsr r3 - mov lr, r2, lsl r6 - b _ll_udiv_big -__aeabi_uldivmod_label2 - mov ip, r3 - mov lr, r2 - b _ll_udiv_ginormous - -_ll_udiv_small - cmp r4, ip, lsl #1 - mov r3, #0 ; 0x0 - subcs r4, r4, ip, lsl #1 - addcs r3, r3, #2 ; 0x2 - cmp r4, ip - subcs r4, r4, ip - adcs r3, r3, #0 ; 0x0 - add r2, r6, #32 ; 0x20 - cmp r2, #32 ; 0x20 - rsb ip, ip, #0 ; 0x0 - bcc _ll_udiv_small_label1 - orrs r0, r4, r5, lsr #30 - moveq r4, r5 - moveq r5, #0 ; 0x0 - subeq r2, r2, #32 ; 0x20 -_ll_udiv_small_label1 - mov r1, #0 ; 0x0 - cmp r2, #16 ; 0x10 - bcc _ll_udiv_small_label2 - movs r0, r4, lsr #14 - moveq r4, r4, lsl #16 - addeq r1, r1, #16 ; 0x10 -_ll_udiv_small_label2 - sub lr, r2, r1 - cmp lr, #8 ; 0x8 - bcc _ll_udiv_small_label3 - movs r0, r4, lsr #22 - moveq r4, r4, lsl #8 - addeq r1, r1, #8 ; 0x8 -_ll_udiv_small_label3 - rsb r0, r1, #32 ; 0x20 - sub r2, r2, r1 - orr r4, r4, r5, lsr r0 - mov r5, r5, lsl r1 - cmp r2, #1 ; 0x1 - bcc _ll_udiv_small_label5 - sub r2, r2, #1 ; 0x1 - and r0, r2, #7 ; 0x7 - eor r0, r0, #7 ; 0x7 - adds r0, r0, r0, lsl #1 - add pc, pc, r0, lsl #2 - nop ; (mov r0,r0) -_ll_udiv_small_label4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - rsbcc r4, ip, r4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - rsbcc r4, ip, r4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - rsbcc r4, ip, r4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - rsbcc r4, ip, r4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - rsbcc r4, ip, r4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - rsbcc r4, ip, r4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - rsbcc r4, ip, r4 - adcs r5, r5, r5 - adcs r4, ip, r4, lsl #1 - sub r2, r2, #8 ; 0x8 - tst r2, r2 - rsbcc r4, ip, r4 - bpl _ll_udiv_small_label4 -_ll_udiv_small_label5 - mov r2, r4, lsr r6 - bic r4, r4, r2, lsl r6 - adcs r0, r5, r5 - adc r1, r4, r4 - add r1, r1, r3, lsl r6 - mov r3, #0 ; 0x0 - ldmia sp!, {r4, r5, r6, pc} - -_ll_udiv_big - subs r0, r5, lr - mov r3, #0 ; 0x0 - sbcs r1, r4, ip - movcs r5, r0 - movcs r4, r1 - adcs r3, r3, #0 ; 0x0 - subs r0, r5, lr - sbcs r1, r4, ip - movcs r5, r0 - movcs r4, r1 - adcs r3, r3, #0 ; 0x0 - subs r0, r5, lr - sbcs r1, r4, ip - movcs r5, r0 - movcs r4, r1 - adcs r3, r3, #0 ; 0x0 - mov r1, #0 ; 0x0 - rsbs lr, lr, #0 ; 0x0 - rsc ip, ip, #0 ; 0x0 - cmp r6, #16 ; 0x10 - bcc _ll_udiv_big_label1 - movs r0, r4, lsr #14 - moveq r4, r4, lsl #16 - addeq r1, r1, #16 ; 0x10 -_ll_udiv_big_label1 - sub r2, r6, r1 - cmp r2, #8 ; 0x8 - bcc _ll_udiv_big_label2 - movs r0, r4, lsr #22 - moveq r4, r4, lsl #8 - addeq r1, r1, #8 ; 0x8 -_ll_udiv_big_label2 - rsb r0, r1, #32 ; 0x20 - sub r2, r6, r1 - orr r4, r4, r5, lsr r0 - mov r5, r5, lsl r1 - cmp r2, #1 ; 0x1 - bcc _ll_udiv_big_label4 - sub r2, r2, #1 ; 0x1 - and r0, r2, #3 ; 0x3 - rsb r0, r0, #3 ; 0x3 - adds r0, r0, r0, lsl #1 - add pc, pc, r0, lsl #3 - nop ; (mov r0,r0) -_ll_udiv_big_label3 - adcs r5, r5, r5 - adcs r4, r4, r4 - adcs r0, lr, r5 - adcs r1, ip, r4 - movcs r5, r0 - movcs r4, r1 - adcs r5, r5, r5 - adcs r4, r4, r4 - adcs r0, lr, r5 - adcs r1, ip, r4 - movcs r5, r0 - movcs r4, r1 - adcs r5, r5, r5 - adcs r4, r4, r4 - adcs r0, lr, r5 - adcs r1, ip, r4 - movcs r5, r0 - movcs r4, r1 - sub r2, r2, #4 ; 0x4 - adcs r5, r5, r5 - adcs r4, r4, r4 - adcs r0, lr, r5 - adcs r1, ip, r4 - tst r2, r2 - movcs r5, r0 - movcs r4, r1 - bpl _ll_udiv_big_label3 -_ll_udiv_big_label4 - mov r1, #0 ; 0x0 - mov r2, r5, lsr r6 - bic r5, r5, r2, lsl r6 - adcs r0, r5, r5 - adc r1, r1, #0 ; 0x0 - movs lr, r3, lsl r6 - mov r3, r4, lsr r6 - bic r4, r4, r3, lsl r6 - adc r1, r1, #0 ; 0x0 - adds r0, r0, lr - orr r2, r2, r4, ror r6 - adc r1, r1, #0 ; 0x0 - ldmia sp!, {r4, r5, r6, pc} - -_ll_udiv_ginormous - subs r2, r5, lr - mov r1, #0 ; 0x0 - sbcs r3, r4, ip - adc r0, r1, r1 - movcc r2, r5 - movcc r3, r4 - ldmia sp!, {r4, r5, r6, pc} - -_ll_div0 - ldmia sp!, {r4, r5, r6, lr} - mov r0, #0 ; 0x0 - mov r1, #0 ; 0x0 - b __aeabi_ldiv0 - -__aeabi_ldiv0 - BX r14 - - END - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldivmod.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldivmod.c deleted file mode 100755 index 8887938362..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldivmod.c +++ /dev/null @@ -1,43 +0,0 @@ -/** @file - - Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "Llvm_int_lib.h" -#include - - -UINT32 __udivsi3(UINT32 n, UINT32 d); -UINT32 __umodsi3(UINT32 a, UINT32 b); - - -UINT64 -__aeabi_uidivmod(unsigned numerator, unsigned denominator) -{ - UINT64 Return; - - Return = __udivsi3 (numerator, denominator); - Return |= LShiftU64 (__umodsi3 (numerator, denominator), 32); - - return Return; -} - -unsigned -__aeabi_uidiv (unsigned n, unsigned d) -{ - return __udivsi3 (n, d); -} - - - - - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S deleted file mode 100644 index 6b718a6574..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S +++ /dev/null @@ -1,29 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__umoddi3) - -ASM_PFX(__umoddi3): - stmfd sp!, {r7, lr} - add r7, sp, #0 - sub sp, sp, #16 - add ip, sp, #8 - str ip, [sp, #0] - bl ASM_PFX(__udivmoddi4) - ldrd r0, [sp, #8] - sub sp, r7, #0 - ldmfd sp!, {r7, pc} - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.c deleted file mode 100644 index 2a2ec61fd1..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.c +++ /dev/null @@ -1,72 +0,0 @@ -/** @file - Compiler intrinsic for 64-bit unsigned mod, ported from LLVM code. - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - - -#include "Llvm_int_lib.h" - -UINT64 __udivmoddi4(UINT64 a, UINT64 b, UINT64* rem); - -// Returns: a % b - -UINT64 -__umoddi3(UINT64 a, UINT64 b) -{ - UINT64 r; - __udivmoddi4(a, b, &r); - return r; -} - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S deleted file mode 100644 index 76c26beb0b..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S +++ /dev/null @@ -1,28 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -#------------------------------------------------------------------------------ - - .text - .align 2 - GCC_ASM_EXPORT(__umodsi3) - -ASM_PFX(__umodsi3): - stmfd sp!, {r4, r5, r7, lr} - add r7, sp, #8 - mov r5, r0 - mov r4, r1 - bl ASM_PFX(__udivsi3) - mul r0, r4, r0 - rsb r0, r0, r5 - ldmfd sp!, {r4, r5, r7, pc} - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.c b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.c deleted file mode 100644 index d0a5b76f40..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.c +++ /dev/null @@ -1,68 +0,0 @@ -/** @file - Compiler intrinsic for 32-bit unsigned mod, ported from LLVM code. - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -/** - University of Illinois/NCSA - Open Source License - - Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign. - All rights reserved. - - Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal with - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE - SOFTWARE. -**/ - - -#include "Llvm_int_lib.h" - - -// Returns: a % b - -UINT32 -__umodsi3(UINT32 a, UINT32 b) -{ - return a - (a / b) * b; -} diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.asm deleted file mode 100644 index 3d589654f0..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.asm +++ /dev/null @@ -1,66 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - - EXPORT __aeabi_uread4 - EXPORT __aeabi_uread8 - - AREA Uread4, CODE, READONLY - -; -;UINT32 -;EFIAPI -;__aeabi_uread4 ( -; IN VOID *Pointer -; ); -; -__aeabi_uread4 - ldrb r1, [r0] - ldrb r2, [r0, #1] - ldrb r3, [r0, #2] - ldrb r0, [r0, #3] - orr r1, r1, r2, lsl #8 - orr r1, r1, r3, lsl #16 - orr r0, r1, r0, lsl #24 - bx lr - -; -;UINT64 -;EFIAPI -;__aeabi_uread8 ( -; IN VOID *Pointer -; ); -; -__aeabi_uread8 - mov r3, r0 - - ldrb r1, [r3] - ldrb r2, [r3, #1] - orr r1, r1, r2, lsl #8 - ldrb r2, [r3, #2] - orr r1, r1, r2, lsl #16 - ldrb r0, [r3, #3] - orr r0, r1, r0, lsl #24 - - ldrb r1, [r3, #4] - ldrb r2, [r3, #5] - orr r1, r1, r2, lsl #8 - ldrb r2, [r3, #6] - orr r1, r1, r2, lsl #16 - ldrb r2, [r3, #7] - orr r1, r1, r2, lsl #24 - - bx lr - END diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uwrite.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uwrite.asm deleted file mode 100644 index 85e1ba8d6d..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uwrite.asm +++ /dev/null @@ -1,68 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -//------------------------------------------------------------------------------ - - - EXPORT __aeabi_uwrite4 - EXPORT __aeabi_uwrite8 - - AREA Uwrite4, CODE, READONLY - -; -;UINT32 -;EFIAPI -;__aeabi_uwrite4 ( -; IN UINT32 Data, -; IN VOID *Pointer -; ); -; -; -__aeabi_uwrite4 - mov r2, r0, lsr #8 - strb r0, [r1] - strb r2, [r1, #1] - mov r2, r0, lsr #16 - strb r2, [r1, #2] - mov r2, r0, lsr #24 - strb r2, [r1, #3] - bx lr - -; -;UINT64 -;EFIAPI -;__aeabi_uwrite8 ( -; IN UINT64 Data, //r0-r1 -; IN VOID *Pointer //r2 -; ); -; -; -__aeabi_uwrite8 - mov r3, r0, lsr #8 - strb r0, [r2] - strb r3, [r2, #1] - mov r3, r0, lsr #16 - strb r3, [r2, #2] - mov r3, r0, lsr #24 - strb r3, [r2, #3] - - mov r3, r1, lsr #8 - strb r1, [r2, #4] - strb r3, [r2, #5] - mov r3, r1, lsr #16 - strb r3, [r2, #6] - mov r3, r1, lsr #24 - strb r3, [r2, #7] - bx lr - - END - diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf b/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf deleted file mode 100644 index 3487787a9c..0000000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf +++ /dev/null @@ -1,107 +0,0 @@ -#/** @file -# Base Library implementation. -# -# Copyright (c) 2009, Apple Inc. All rights reserved.
-# Copyright (c) 2011-2013, ARM Limited. All rights reserved. -# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# -#**/ - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = CompilerIntrinsicsLib - FILE_GUID = 855274FA-3575-4C20-9709-C031DC5589FA - MODULE_TYPE = BASE - VERSION_STRING = 1.0 - LIBRARY_CLASS = CompilerIntrinsicsLib - -[Sources.AARCH64] - AArch64/memcpy.S - AArch64/memset.c - -[Sources.ARM] - Arm/mullu.asm | RVCT - Arm/switch.asm | RVCT - Arm/llsr.asm | RVCT - Arm/memcpy.asm | RVCT - Arm/memcpy4.asm | RVCT - Arm/memset.asm | RVCT - Arm/memmove.asm | RVCT - Arm/uread.asm | RVCT - Arm/uwrite.asm | RVCT - Arm/lasr.asm | RVCT - Arm/llsl.asm | RVCT - Arm/div.asm | RVCT - Arm/uldiv.asm | RVCT - Arm/ldivmod.asm | RVCT - - -# -# Move .c to .s to work around LLVM issues -# -# Arm/ashrdi3.c | GCC -# Arm/ashldi3.c | GCC -# Arm/divdi3.c | GCC -# Arm/divsi3.c | GCC -# Arm/lshrdi3.c | GCC - Arm/ashrdi3.S | GCC - Arm/ashldi3.S | GCC - Arm/div.S | GCC - Arm/divdi3.S | GCC - Arm/divsi3.S | GCC - Arm/lshrdi3.S | GCC - - Arm/memcpy.S | GCC - Arm/memset.S | GCC - Arm/memmove.S | GCC - -# Arm/modsi3.c | GCC -# Arm/moddi3.c | GCC -# Arm/muldi3.c | GCC - Arm/modsi3.S | GCC - Arm/moddi3.S | GCC - Arm/muldi3.S | GCC - Arm/mullu.S | GCC - -# Arm/udivsi3.c | GCC -# Arm/umodsi3.c | GCC -# Arm/udivdi3.c | GCC -# Arm/umoddi3.c | GCC -# Arm/udivmoddi4.c | GCC - Arm/udivsi3.S | GCC - Arm/umodsi3.S | GCC - Arm/udivdi3.S | GCC - Arm/umoddi3.S | GCC - Arm/udivmoddi4.S | GCC - -# Arm/clzsi2.c | GCC -# Arm/ctzsi2.c | GCC -# Arm/ucmpdi2.c | GCC - Arm/clzsi2.S | GCC - Arm/ctzsi2.S | GCC - Arm/ucmpdi2.S | GCC - Arm/switch8.S | GCC - Arm/switchu8.S | GCC - Arm/switch16.S | GCC - Arm/switch32.S | GCC - - Arm/sourcery.S | GCC - Arm/uldiv.S | GCC - Arm/ldivmod.S | GCC - - Arm/llsr.S | GCC - Arm/llsl.S | GCC - - -[Packages] - MdePkg/MdePkg.dec - -[LibraryClasses] - -- cgit v1.2.3