Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: gcc/gcc/config/arm/bpabi.S

Issue 3050029: [gcc] GCC 4.5.0=>4.5.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcc/gcc/config/arm/arm_neon.h ('k') | gcc/gcc/config/arm/constraints.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/gcc/config/arm/bpabi.S
diff --git a/gcc/gcc/config/arm/bpabi.S b/gcc/gcc/config/arm/bpabi.S
index 850381e4af6423ad132f6fbb35e23438632489a3..ccc569e982180ea35e61753249856dea450bcdf6 100644
--- a/gcc/gcc/config/arm/bpabi.S
+++ b/gcc/gcc/config/arm/bpabi.S
@@ -64,9 +64,57 @@ ARM_FUNC_START aeabi_ulcmp
#endif /* L_aeabi_ulcmp */
+.macro test_div_by_zero signed
+/* Tail-call to divide-by-zero handlers which may be overridden by the user,
+ so unwinding works properly. */
+#if defined(__thumb2__)
+ cbnz yyh, 1f
+ cbnz yyl, 1f
+ cmp xxh, #0
+ do_it eq
+ cmpeq xxl, #0
+ .ifc \signed, unsigned
+ beq 2f
+ mov xxh, #0xffffffff
+ mov xxl, xxh
+2:
+ .else
+ do_it lt, t
+ movlt xxl, #0
+ movlt xxh, #0x80000000
+ do_it gt, t
+ movgt xxh, #0x7fffffff
+ movgt xxl, #0xffffffff
+ .endif
+ b SYM (__aeabi_ldiv0) __PLT__
+1:
+#else
+ /* Note: Thumb-1 code calls via an ARM shim on processors which
+ support ARM mode. */
+ cmp yyh, #0
+ cmpeq yyl, #0
+ bne 2f
+ cmp xxh, #0
+ cmpeq xxl, #0
+ .ifc \signed, unsigned
+ movne xxh, #0xffffffff
+ movne xxl, #0xffffffff
+ .else
+ movlt xxh, #0x80000000
+ movlt xxl, #0
+ movgt xxh, #0x7fffffff
+ movgt xxl, #0xffffffff
+ .endif
+ b SYM (__aeabi_ldiv0) __PLT__
+2:
+#endif
+.endm
+
#ifdef L_aeabi_ldivmod
ARM_FUNC_START aeabi_ldivmod
+ test_div_by_zero signed
+
sub sp, sp, #8
#if defined(__thumb2__)
mov ip, sp
@@ -85,6 +133,8 @@ ARM_FUNC_START aeabi_ldivmod
#ifdef L_aeabi_uldivmod
ARM_FUNC_START aeabi_uldivmod
+ test_div_by_zero unsigned
+
sub sp, sp, #8
#if defined(__thumb2__)
mov ip, sp
« no previous file with comments | « gcc/gcc/config/arm/arm_neon.h ('k') | gcc/gcc/config/arm/constraints.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698