public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-1731] libgcc/arc: Update udivmodsi4 and make the lib safe for rf16
@ 2022-07-18 12:01 Claudiu Zissulescu
  0 siblings, 0 replies; only message in thread
From: Claudiu Zissulescu @ 2022-07-18 12:01 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c8697735abaca3b3dfe8ae4188a086d1fd7048eb

commit r13-1731-gc8697735abaca3b3dfe8ae4188a086d1fd7048eb
Author: Claudiu Zissulescu <claziss@synopsys.com>
Date:   Mon Jul 18 14:54:38 2022 +0300

    libgcc/arc: Update udivmodsi4 and make the lib safe for rf16
    
    The ARC soft udivmodsi4 algorithm and as well as using umodsi3
    for reduced register set configurations are wrong.
    
    libgcc/
            * config/arc/lib2funcs.c (udivmodsi4): Update AND mask.
            * config/arc/lib1funcs.S (umodsi3): Don't use it for RF16
            configurations.

Diff:
---
 libgcc/config/arc/lib1funcs.S | 2 ++
 libgcc/config/arc/lib2funcs.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libgcc/config/arc/lib1funcs.S b/libgcc/config/arc/lib1funcs.S
index 14fd1d2f303..b06361257d1 100644
--- a/libgcc/config/arc/lib1funcs.S
+++ b/libgcc/config/arc/lib1funcs.S
@@ -936,6 +936,7 @@ SYM(__divsi3):
 
 #endif /* L_divsi3 */
 
+#ifndef __ARC_RF16__
 #ifdef  L_umodsi3
 	.section .text
 	.align 4
@@ -950,6 +951,7 @@ SYM(__umodsi3):
 	ENDFUNC(__umodsi3)
 
 #endif /* L_umodsi3 */
+#endif /* !__ARC_RF16__ */
 
 #ifdef  L_modsi3
 	.section .text
diff --git a/libgcc/config/arc/lib2funcs.c b/libgcc/config/arc/lib2funcs.c
index 70727b55365..8cba45172b2 100644
--- a/libgcc/config/arc/lib2funcs.c
+++ b/libgcc/config/arc/lib2funcs.c
@@ -59,7 +59,7 @@ udivmodsi4 (nint32_t num, nint32_t den, word_t modwanted)
   nint32_t bit = 1;
   nint32_t res = 0;
 
-  while (den < num && bit && !(den & (1LL << 63)))
+  while (den < num && bit && !(den & (1L << 31)))
     {
       den <<= 1;
       bit <<= 1;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-18 12:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 12:01 [gcc r13-1731] libgcc/arc: Update udivmodsi4 and make the lib safe for rf16 Claudiu Zissulescu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).