From owner-svn-src-projects@FreeBSD.ORG Sun Feb 5 07:19:01 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FA8A106566C; Sun, 5 Feb 2012 07:19:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CE768FC0A; Sun, 5 Feb 2012 07:19:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q157J1OV071642; Sun, 5 Feb 2012 07:19:01 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q157J1kl071635; Sun, 5 Feb 2012 07:19:01 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201202050719.q157J1kl071635@svn.freebsd.org> From: Andrew Turner Date: Sun, 5 Feb 2012 07:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231008 - in projects/arm_eabi: contrib/compiler-rt/lib contrib/compiler-rt/lib/arm lib/libcompiler_rt X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 07:19:01 -0000 Author: andrew Date: Sun Feb 5 07:19:00 2012 New Revision: 231008 URL: http://svn.freebsd.org/changeset/base/231008 Log: Bring in the __aeabi_*divmod functions from compiler-rt r149242 Added: projects/arm_eabi/contrib/compiler-rt/lib/arm/aeabi_idivmod.S projects/arm_eabi/contrib/compiler-rt/lib/arm/aeabi_ldivmod.S projects/arm_eabi/contrib/compiler-rt/lib/arm/aeabi_uidivmod.S projects/arm_eabi/contrib/compiler-rt/lib/arm/aeabi_uldivmod.S Modified: projects/arm_eabi/contrib/compiler-rt/lib/divmoddi4.c projects/arm_eabi/contrib/compiler-rt/lib/udivmoddi4.c projects/arm_eabi/lib/libcompiler_rt/Makefile Added: projects/arm_eabi/contrib/compiler-rt/lib/arm/aeabi_idivmod.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/arm_eabi/contrib/compiler-rt/lib/arm/aeabi_idivmod.S Sun Feb 5 07:19:00 2012 (r231008) @@ -0,0 +1,27 @@ +//===-- aeabi_idivmod.S - EABI idivmod implementation ---------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "../assembly.h" + +// struct { int quot, int rem} __aeabi_idivmod(int numerator, int denominator) { +// int rem, quot; +// quot = __divmodsi4(numerator, denominator, &rem); +// return {quot, rem}; +// } + + .syntax unified + .align 2 +DEFINE_COMPILERRT_FUNCTION(__aeabi_idivmod) + push { lr } + sub sp, sp, #4 + mov r2, sp + bl SYMBOL_NAME(__divmodsi4) + ldr r1, [sp] + add sp, sp, #4 + pop { pc } Added: projects/arm_eabi/contrib/compiler-rt/lib/arm/aeabi_ldivmod.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/arm_eabi/contrib/compiler-rt/lib/arm/aeabi_ldivmod.S Sun Feb 5 07:19:00 2012 (r231008) @@ -0,0 +1,30 @@ +//===-- aeabi_ldivmod.S - EABI ldivmod implementation ---------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "../assembly.h" + +// struct { int64_t quot, int64_t rem} +// __aeabi_ldivmod(int64_t numerator, int64_t denominator) { +// int64_t rem, quot; +// quot = __divmoddi4(numerator, denominator, &rem); +// return {quot, rem}; +// } + + .syntax unified + .align 2 +DEFINE_COMPILERRT_FUNCTION(__aeabi_ldivmod) + push {r11, lr} + sub sp, sp, #16 + add r12, sp, #8 + str r12, [sp] + bl SYMBOL_NAME(__divmoddi4) + ldr r2, [sp, #8] + ldr r3, [sp, #12] + add sp, sp, #16 + pop {r11, pc} Added: projects/arm_eabi/contrib/compiler-rt/lib/arm/aeabi_uidivmod.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/arm_eabi/contrib/compiler-rt/lib/arm/aeabi_uidivmod.S Sun Feb 5 07:19:00 2012 (r231008) @@ -0,0 +1,28 @@ +//===-- aeabi_uidivmod.S - EABI uidivmod implementation -------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "../assembly.h" + +// struct { unsigned quot, unsigned rem} +// __aeabi_uidivmod(unsigned numerator, unsigned denominator) { +// unsigned rem, quot; +// quot = __udivmodsi4(numerator, denominator, &rem); +// return {quot, rem}; +// } + + .syntax unified + .align 2 +DEFINE_COMPILERRT_FUNCTION(__aeabi_uidivmod) + push { lr } + sub sp, sp, #4 + mov r2, sp + bl SYMBOL_NAME(__udivmodsi4) + ldr r1, [sp] + add sp, sp, #4 + pop { pc } Added: projects/arm_eabi/contrib/compiler-rt/lib/arm/aeabi_uldivmod.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/arm_eabi/contrib/compiler-rt/lib/arm/aeabi_uldivmod.S Sun Feb 5 07:19:00 2012 (r231008) @@ -0,0 +1,30 @@ +//===-- aeabi_uldivmod.S - EABI uldivmod implementation -------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "../assembly.h" + +// struct { uint64_t quot, uint64_t rem} +// __aeabi_uldivmod(uint64_t numerator, uint64_t denominator) { +// uint64_t rem, quot; +// quot = __udivmoddi4(numerator, denominator, &rem); +// return {quot, rem}; +// } + + .syntax unified + .align 2 +DEFINE_COMPILERRT_FUNCTION(__aeabi_uldivmod) + push {r11, lr} + sub sp, sp, #16 + add r12, sp, #8 + str r12, [sp] + bl SYMBOL_NAME(__udivmoddi4) + ldr r2, [sp, #8] + ldr r3, [sp, #12] + add sp, sp, #16 + pop {r11, pc} Modified: projects/arm_eabi/contrib/compiler-rt/lib/divmoddi4.c ============================================================================== --- projects/arm_eabi/contrib/compiler-rt/lib/divmoddi4.c Sun Feb 5 07:11:02 2012 (r231007) +++ projects/arm_eabi/contrib/compiler-rt/lib/divmoddi4.c Sun Feb 5 07:19:00 2012 (r231008) @@ -17,8 +17,6 @@ extern COMPILER_RT_ABI di_int __divdi3(di_int a, di_int b); -ARM_EABI_FNALIAS(ldivmod, divmoddi4); - /* Returns: a / b, *rem = a % b */ COMPILER_RT_ABI di_int Modified: projects/arm_eabi/contrib/compiler-rt/lib/udivmoddi4.c ============================================================================== --- projects/arm_eabi/contrib/compiler-rt/lib/udivmoddi4.c Sun Feb 5 07:11:02 2012 (r231007) +++ projects/arm_eabi/contrib/compiler-rt/lib/udivmoddi4.c Sun Feb 5 07:19:00 2012 (r231008) @@ -21,8 +21,6 @@ /* Translated from Figure 3-40 of The PowerPC Compiler Writer's Guide */ -ARM_EABI_FNALIAS(uldivmod, udivmoddi4); - COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int* rem) { Modified: projects/arm_eabi/lib/libcompiler_rt/Makefile ============================================================================== --- projects/arm_eabi/lib/libcompiler_rt/Makefile Sun Feb 5 07:11:02 2012 (r231007) +++ projects/arm_eabi/lib/libcompiler_rt/Makefile Sun Feb 5 07:19:00 2012 (r231008) @@ -152,6 +152,13 @@ SRCS+= ${file}.c . endif .endfor +.if ${MACHINE_CPUARCH} == "arm" +SRCS+= aeabi_idivmod.S \ + aeabi_ldivmod.S \ + aeabi_uidivmod.S \ + aeabi_uldivmod.S +.endif + .if ${MACHINE_CPUARCH} != "sparc64" && ${MACHINE_CPUARCH} != "mips" . if ${MK_INSTALLLIB} != "no" SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a