Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/arm/lib1funcs.asm @ 63:b7f97abdc517 gcc-4.6-20100522
update gcc from gcc-4.5.0 to gcc-4.6
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 May 2010 12:47:05 +0900 |
parents | 77e2b8dfacca |
children | f6334be47118 |
comparison
equal
deleted
inserted
replaced
56:3c8a44c06a95 | 63:b7f97abdc517 |
---|---|
1 @ libgcc routines for ARM cpu. | 1 @ libgcc routines for ARM cpu. |
2 @ Division routines, written by Richard Earnshaw, (rearnsha@armltd.co.uk) | 2 @ Division routines, written by Richard Earnshaw, (rearnsha@armltd.co.uk) |
3 | 3 |
4 /* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005, 2007, 2008, | 4 /* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005, 2007, 2008, |
5 2009 Free Software Foundation, Inc. | 5 2009, 2010 Free Software Foundation, Inc. |
6 | 6 |
7 This file is free software; you can redistribute it and/or modify it | 7 This file is free software; you can redistribute it and/or modify it |
8 under the terms of the GNU General Public License as published by the | 8 under the terms of the GNU General Public License as published by the |
9 Free Software Foundation; either version 3, or (at your option) any | 9 Free Software Foundation; either version 3, or (at your option) any |
10 later version. | 10 later version. |
29 .previous | 29 .previous |
30 #endif /* __ELF__ and __linux__ */ | 30 #endif /* __ELF__ and __linux__ */ |
31 | 31 |
32 #ifdef __ARM_EABI__ | 32 #ifdef __ARM_EABI__ |
33 /* Some attributes that are common to all routines in this file. */ | 33 /* Some attributes that are common to all routines in this file. */ |
34 /* Tag_ABI_align8_needed: This code does not require 8-byte | 34 /* Tag_ABI_align_needed: This code does not require 8-byte |
35 alignment from the caller. */ | 35 alignment from the caller. */ |
36 /* .eabi_attribute 24, 0 -- default setting. */ | 36 /* .eabi_attribute 24, 0 -- default setting. */ |
37 /* Tag_ABI_align8_preserved: This code preserves 8-byte | 37 /* Tag_ABI_align_preserved: This code preserves 8-byte |
38 alignment in any callee. */ | 38 alignment in any callee. */ |
39 .eabi_attribute 25, 1 | 39 .eabi_attribute 25, 1 |
40 #endif /* __ARM_EABI__ */ | 40 #endif /* __ARM_EABI__ */ |
41 /* ------------------------------------------------------------------------ */ | 41 /* ------------------------------------------------------------------------ */ |
42 | 42 |
108 # define __ARM_ARCH__ 7 | 108 # define __ARM_ARCH__ 7 |
109 #endif | 109 #endif |
110 | 110 |
111 #ifndef __ARM_ARCH__ | 111 #ifndef __ARM_ARCH__ |
112 #error Unable to determine architecture. | 112 #error Unable to determine architecture. |
113 #endif | |
114 | |
115 /* There are times when we might prefer Thumb1 code even if ARM code is | |
116 permitted, for example, the code might be smaller, or there might be | |
117 interworking problems with switching to ARM state if interworking is | |
118 disabled. */ | |
119 #if (defined(__thumb__) \ | |
120 && !defined(__thumb2__) \ | |
121 && (!defined(__THUMB_INTERWORK__) \ | |
122 || defined (__OPTIMIZE_SIZE__) \ | |
123 || defined(__ARM_ARCH_6M__))) | |
124 # define __prefer_thumb__ | |
113 #endif | 125 #endif |
114 | 126 |
115 /* How to return from a function call depends on the architecture variant. */ | 127 /* How to return from a function call depends on the architecture variant. */ |
116 | 128 |
117 #if (__ARM_ARCH__ > 4) || defined(__ARM_ARCH_4T__) | 129 #if (__ARM_ARCH__ > 4) || defined(__ARM_ARCH_4T__) |
915 /* ------------------------------------------------------------------------ */ | 927 /* ------------------------------------------------------------------------ */ |
916 /* Start of the Real Functions */ | 928 /* Start of the Real Functions */ |
917 /* ------------------------------------------------------------------------ */ | 929 /* ------------------------------------------------------------------------ */ |
918 #ifdef L_udivsi3 | 930 #ifdef L_udivsi3 |
919 | 931 |
920 #if defined(__ARM_ARCH_6M__) | 932 #if defined(__prefer_thumb__) |
921 | 933 |
922 FUNC_START udivsi3 | 934 FUNC_START udivsi3 |
923 FUNC_ALIAS aeabi_uidiv udivsi3 | 935 FUNC_ALIAS aeabi_uidiv udivsi3 |
924 | 936 |
925 cmp divisor, #0 | 937 cmp divisor, #0 |
972 | 984 |
973 #endif /* ARM version */ | 985 #endif /* ARM version */ |
974 | 986 |
975 DIV_FUNC_END udivsi3 unsigned | 987 DIV_FUNC_END udivsi3 unsigned |
976 | 988 |
977 #if defined(__ARM_ARCH_6M__) | 989 #if defined(__prefer_thumb__) |
978 FUNC_START aeabi_uidivmod | 990 FUNC_START aeabi_uidivmod |
979 cmp r1, #0 | 991 cmp r1, #0 |
980 beq LSYM(Ldiv0) | 992 beq LSYM(Ldiv0) |
981 push {r0, r1, lr} | 993 push {r0, r1, lr} |
982 bl LSYM(udivsi3_skip_div0_test) | 994 bl LSYM(udivsi3_skip_div0_test) |
1040 | 1052 |
1041 #endif /* L_umodsi3 */ | 1053 #endif /* L_umodsi3 */ |
1042 /* ------------------------------------------------------------------------ */ | 1054 /* ------------------------------------------------------------------------ */ |
1043 #ifdef L_divsi3 | 1055 #ifdef L_divsi3 |
1044 | 1056 |
1045 #if defined(__ARM_ARCH_6M__) | 1057 #if defined(__prefer_thumb__) |
1046 | 1058 |
1047 FUNC_START divsi3 | 1059 FUNC_START divsi3 |
1048 FUNC_ALIAS aeabi_idiv divsi3 | 1060 FUNC_ALIAS aeabi_idiv divsi3 |
1049 | 1061 |
1050 cmp divisor, #0 | 1062 cmp divisor, #0 |
1128 | 1140 |
1129 #endif /* ARM version */ | 1141 #endif /* ARM version */ |
1130 | 1142 |
1131 DIV_FUNC_END divsi3 signed | 1143 DIV_FUNC_END divsi3 signed |
1132 | 1144 |
1133 #if defined(__ARM_ARCH_6M__) | 1145 #if defined(__prefer_thumb__) |
1134 FUNC_START aeabi_idivmod | 1146 FUNC_START aeabi_idivmod |
1135 cmp r1, #0 | 1147 cmp r1, #0 |
1136 beq LSYM(Ldiv0) | 1148 beq LSYM(Ldiv0) |
1137 push {r0, r1, lr} | 1149 push {r0, r1, lr} |
1138 bl LSYM(divsi3_skip_div0_test) | 1150 bl LSYM(divsi3_skip_div0_test) |