From patchwork Fri Jul 8 11:41:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu X-Patchwork-Id: 646394 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rmCK05YB2z9sxR for ; Fri, 8 Jul 2016 21:42:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=i/UgL4K1; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=iooEfpGEOsPMpJqW ilRiFOPdgLIuIASVOyE5tIFHqxjT1LbJlFUO+JxESF8Q9RMz7e0zBBTGXv0MM7IN f9QHHnbk795yh/1cx/+LmMYUzEdAJz9MKOoMkG0xJm4036RlxVGTnU18azLQJ4/c wTJRka8yJXfzqWRBRiCrIimOxa4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=f/eNsOHXNR8rvsi9EusYGm nFktE=; b=i/UgL4K1HRH/CBCsowoMRbFXgFi1UPC2+0c8c2aYO7HF5x7gK287yr 2rY823AgkvpMoKgG/3bQrvZ6ptUvShGYHD9fIzOXAQRp2ChPYLMD8R3MCKpw7tTk AY1guMzS8H8HRixgWtbnz+P82PW3dchf6b3N/cZmRQB8FLJ9aGJfY= Received: (qmail 104907 invoked by alias); 8 Jul 2016 11:42:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 104780 invoked by uid 89); 8 Jul 2016 11:42:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=bd, SYM, ********************************************************, UD:as X-HELO: smtprelay.synopsys.com Received: from us01smtprelay-2.synopsys.com (HELO smtprelay.synopsys.com) (198.182.60.111) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 08 Jul 2016 11:42:04 +0000 Received: from us02secmta2.synopsys.com (us02secmta2.synopsys.com [10.12.235.98]) by smtprelay.synopsys.com (Postfix) with ESMTP id 977E110C0E63; Fri, 8 Jul 2016 04:42:02 -0700 (PDT) Received: from us02secmta2.internal.synopsys.com (us02secmta2.internal.synopsys.com [127.0.0.1]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 9534F55F13; Fri, 8 Jul 2016 04:42:02 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 6496E55F02; Fri, 8 Jul 2016 04:42:02 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 47DE7641; Fri, 8 Jul 2016 04:42:02 -0700 (PDT) Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id 325B863C; Fri, 8 Jul 2016 04:42:02 -0700 (PDT) Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.104) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.266.1; Fri, 8 Jul 2016 04:42:02 -0700 Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.105) by IN01WEHTCA.internal.synopsys.com (10.144.199.103) with Microsoft SMTP Server (TLS) id 14.3.266.1; Fri, 8 Jul 2016 17:11:59 +0530 Received: from nl20droid1.internal.synopsys.com (10.100.24.228) by IN01WEHTCB.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.266.1; Fri, 8 Jul 2016 17:11:59 +0530 From: Claudiu Zissulescu To: CC: , , Subject: [PATCH 1/2] [ARC] [libgcc] Add support for QuarkSE processor. Date: Fri, 8 Jul 2016 13:41:22 +0200 Message-ID: <1467978083-27904-2-git-send-email-claziss@synopsys.com> In-Reply-To: <1467978083-27904-1-git-send-email-claziss@synopsys.com> References: <1467978083-27904-1-git-send-email-claziss@synopsys.com> MIME-Version: 1.0 libgcc/ 2016-05-26 Claudiu Zissulescu * config/arc/dp-hack.h (ARC_OPTFPE): Define. (__ARC_NORM__): Use instead ARC_OPTFPE. * config/arc/fp-hack.h: Likewise. * config/arc/lib1funcs.S (ARC_OPTFPE): Define. (__ARC_MPY__): Use it insetead of __ARC700__ and __HS__. --- libgcc/config/arc/dp-hack.h | 12 +++-- libgcc/config/arc/fp-hack.h | 8 +-- libgcc/config/arc/lib1funcs.S | 120 ++++++++++++++++++++++-------------------- 3 files changed, 74 insertions(+), 66 deletions(-) diff --git a/libgcc/config/arc/dp-hack.h b/libgcc/config/arc/dp-hack.h index 3c727b1..1f7f213 100644 --- a/libgcc/config/arc/dp-hack.h +++ b/libgcc/config/arc/dp-hack.h @@ -30,21 +30,23 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define FINE_GRAINED_LIBRARIES #define ARC_DP_DEBUG 1 -#if !defined (__ARC_NORM__) || ARC_DP_DEBUG +#define ARC_OPTFPE (defined (__ARC700__) || defined (__ARC_FPX_QUARK__)) + +#if !ARC_OPTFPE || ARC_DP_DEBUG #define L_pack_df #define L_unpack_df #define L_make_df #define L_thenan_df #define L_sf_to_df #endif -#ifndef __ARC_NORM__ +#if !ARC_OPTFPE #define L_addsub_df #elif ARC_DP_DEBUG #define L_addsub_df #define __adddf3 __adddf3_c #define __subdf3 __subdf3_c #endif -#ifndef __ARC_NORM__ +#if !ARC_OPTFPE #define L_mul_df #define L_div_df #elif (!defined (__ARC700__) && !defined (__ARC_MUL64__) \ @@ -59,7 +61,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define L_div_df #define __divdf3 __divdf3_c #endif -#ifndef __ARC_NORM__ +#if !ARC_OPTFPE #define L_df_to_sf #define L_si_to_df #define L_df_to_si @@ -77,7 +79,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define L_usi_to_df #define __floatunsidf __floatunsidf_c #endif -#ifndef __ARC_NORM__ +#if !ARC_OPTFPE #define L_fpcmp_parts_df #define L_compare_df #define L_eq_df diff --git a/libgcc/config/arc/fp-hack.h b/libgcc/config/arc/fp-hack.h index 30b547a..5144bb9 100644 --- a/libgcc/config/arc/fp-hack.h +++ b/libgcc/config/arc/fp-hack.h @@ -30,13 +30,15 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define ARC_FP_DEBUG 1 #define FINE_GRAINED_LIBRARIES -#if !defined (__ARC_NORM__) || ARC_FP_DEBUG +#define ARC_OPTFPE (defined (__ARC700__) || defined (__ARC_FPX_QUARK__)) + +#if !ARC_OPTFPE || ARC_FP_DEBUG #define L_pack_sf #define L_unpack_sf #define L_make_sf #define L_thenan_sf #endif -#ifndef __ARC_NORM__ +#if !ARC_OPTFPE #define L_addsub_sf #define L_mul_sf #define L_div_sf @@ -61,7 +63,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define L_usi_to_sf #define __floatunsisf __floatunsisf_c #endif -#ifndef __ARC_NORM__ +#if !ARC_OPTFPE #define L_fpcmp_parts_sf #define L_compare_sf #define L_eq_sf diff --git a/libgcc/config/arc/lib1funcs.S b/libgcc/config/arc/lib1funcs.S index 1c8961c..9bb25e0 100644 --- a/libgcc/config/arc/lib1funcs.S +++ b/libgcc/config/arc/lib1funcs.S @@ -32,29 +32,29 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ - + /* ANSI concatenation macros. */ - + #define CONCAT1(a, b) CONCAT2(a, b) #define CONCAT2(a, b) a ## b - + /* Use the right prefix for global labels. */ - + #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) - + #ifndef WORKING_ASSEMBLER #define abs_l abs #define asl_l asl #define mov_l mov #endif - + #define FUNC(X) .type SYM(X),@function #define HIDDEN_FUNC(X) FUNC(X)` .hidden X #define ENDFUNC0(X) .Lfe_##X: .size X,.Lfe_##X-X #define ENDFUNC(X) ENDFUNC0(X) - - + + #ifdef L_mulsi3 .section .text .align 4 @@ -64,10 +64,10 @@ SYM(__mulsi3): /* This the simple version. - while (a) + while (a) { if (a & 1) - r += b; + r += b; a >>= 1; b <<= 1; } @@ -132,7 +132,7 @@ SYM(__mulsi3): add2.cs r0,r0,r1 lsr.f r2,r2 add3.cs r0,r0,r1 - bne.d .Loop + bne.d .Loop add3 r1,r3,r1 j_s [blink] ENDFUNC(__mulsi3) @@ -143,17 +143,17 @@ SYM(__mulsi3): .Lloop: bbit0 r0,0,@.Ly add_s r2,r2,r1 ; r += b -.Ly: +.Ly: lsr_s r0,r0 ; a >>= 1 - asl_s r1,r1 ; b <<= 1 - brne_s r0,0,@.Lloop + asl_s r1,r1 ; b <<= 1 + brne_s r0,0,@.Lloop .Ldone: j_s.d [blink] mov_s r0,r2 ENDFUNC(__mulsi3) /********************************************************/ #endif - + #endif /* L_mulsi3 */ #ifdef L_umulsidi3 @@ -178,10 +178,10 @@ SYM(__umulsi3_highpart): /* This the simple version. - while (a) + while (a) { if (a & 1) - r += b; + r += b; a >>= 1; b <<= 1; } @@ -455,18 +455,18 @@ SYM(__udivmodsi4): mov_s r2,1 ; bit = 1 mov_s r3,0 ; res = 0 .Lloop1: - brhs r1,r0,@.Lloop2 + brhs r1,r0,@.Lloop2 bbit1 r1,31,@.Lloop2 asl_s r1,r1 ; den <<= 1 b.d @.Lloop1 asl_s r2,r2 ; bit <<= 1 .Lloop2: - brlo r0,r1,@.Lshiftdown + brlo r0,r1,@.Lshiftdown sub_s r0,r0,r1 ; num -= den or_s r3,r3,r2 ; res |= bit .Lshiftdown: lsr_s r2,r2 ; bit >>= 1 - lsr_s r1,r1 ; den >>= 1 + lsr_s r1,r1 ; den >>= 1 brne_s r2,0,@.Lloop2 .Ldivmodend: mov_s r1,r0 ; r1 = mod @@ -785,15 +785,15 @@ __muldiv: neg r4,r2 ld.as r5,[pcl,r4] abs_s r12,r0 - bic.f 0,r2,r4 - mpyhu.ne r12,r12,r5 + bic.f 0,r2,r4 + mpyhu.ne r12,r12,r5 norm r3,r2 xor.f 0,r0,r1 - ; write port allocation stall - rsub r3,r3,30 - lsr r0,r12,r3 - j_s.d [blink] - neg.mi r0,r0 + ; write port allocation stall + rsub r3,r3,30 + lsr r0,r12,r3 + j_s.d [blink] + neg.mi r0,r0 .balign 4 SYM(__divsi3): @@ -876,7 +876,7 @@ SYM(__divsi3): #endif /* ifndef __ARC700__ */ ENDFUNC(__divsi3) - + #endif /* L_divsi3 */ #ifdef L_umodsi3 @@ -951,7 +951,7 @@ SYM(__modsi3): .section .text .align 4 .global SYM (__clzsi2) -SYM(__clzsi2): +SYM(__clzsi2): #ifdef __ARC_NORM__ HIDDEN_FUNC(__clzsi2) norm.f r0,r0 @@ -1002,7 +1002,7 @@ SYM(__clzsi2): ;;; MILLICODE THUNK LIB ;*************** - + ;;; .macro push_regs from, to, offset ;;; st_s "\from", [sp, \offset] ;;; .if \to-\from @@ -1019,22 +1019,22 @@ SYM(__clzsi2): ;;;; .set regno, \from+1 ;;;; .set shift, 32 ;;;; .set shift, shift - 1 -;;;; # st_s %shift @3 lsl #shift +;;;; # st_s %shift @3 lsl #shift ;;;; .if \to-\from ;;;; sum "(\from+1)", \to, "(\three)" -;;;; .endif +;;;; .endif ;;;; .endm -;;;; +;;;; ;;;; SUM 0,5, 9 -;;;; -; .altmacro +;;;; +; .altmacro ;; .macro push_regs from=0, to=3, offset ;; st_s r\from, [sp, \offset] ;; .if \to-\from ;; push_regs "\from+1 ",\to,"(\offset+4)" ;; .endif ;; .endm -;; +;; ;; .macro expand_to_push from=13, to ;; ; .section .text ;; ; .align 4 @@ -1042,11 +1042,11 @@ SYM(__clzsi2): ;; ; .type foo, ;; st_13_to_25: ;; ; push_regs \from, \to, 0 -;; push_regs 0,3 ; +;; push_regs 0,3 ; ;; .endm -;; +;; ;; expand_to_push 13,18 -;; +;; ;#endif #ifdef L_millicodethunk_st @@ -1077,25 +1077,25 @@ SYM(__clzsi2): .align 4 SYM(__st_r13_to_r25): st r25, [sp,48] -SYM(__st_r13_to_r24): +SYM(__st_r13_to_r24): st r24, [sp,44] -SYM(__st_r13_to_r23): +SYM(__st_r13_to_r23): st r23, [sp,40] -SYM(__st_r13_to_r22): +SYM(__st_r13_to_r22): st r22, [sp,36] -SYM(__st_r13_to_r21): +SYM(__st_r13_to_r21): st r21, [sp,32] -SYM(__st_r13_to_r20): - st r20, [sp,28] -SYM(__st_r13_to_r19): +SYM(__st_r13_to_r20): + st r20, [sp,28] +SYM(__st_r13_to_r19): st r19, [sp,24] -SYM(__st_r13_to_r18): +SYM(__st_r13_to_r18): st r18, [sp,20] -SYM(__st_r13_to_r17): +SYM(__st_r13_to_r17): st r17, [sp,16] -SYM(__st_r13_to_r16): +SYM(__st_r13_to_r16): st r16, [sp,12] -SYM(__st_r13_to_r15): +SYM(__st_r13_to_r15): #ifdef __ARC700__ st r15, [sp,8] ; minimum function size to avoid stall: 6 bytes. #else @@ -1103,7 +1103,7 @@ SYM(__st_r13_to_r15): #endif st_s r14, [sp,4] j_s.d [%blink] - st_s r13, [sp,0] + st_s r13, [sp,0] ENDFUNC(__st_r13_to_r15) ENDFUNC(__st_r13_to_r16) ENDFUNC(__st_r13_to_r17) @@ -1121,7 +1121,7 @@ SYM(__st_r13_to_r15): #ifdef L_millicodethunk_ld .section .text .align 4 -; ================================== +; ================================== ; the loads .global SYM(__ld_r13_to_r15) @@ -1157,7 +1157,7 @@ SYM(__ld_r13_to_r22): SYM(__ld_r13_to_r21): ld r21, [sp,32] SYM(__ld_r13_to_r20): - ld r20, [sp,28] + ld r20, [sp,28] SYM(__ld_r13_to_r19): ld r19, [sp,24] SYM(__ld_r13_to_r18): @@ -1226,7 +1226,7 @@ SYM(__ld_r13_to_r22_ret): SYM(__ld_r13_to_r21_ret): ld r21, [sp,32] SYM(__ld_r13_to_r20_ret): - ld r20, [sp,28] + ld r20, [sp,28] SYM(__ld_r13_to_r19_ret): ld r19, [sp,24] SYM(__ld_r13_to_r18_ret): @@ -1258,6 +1258,9 @@ SYM(__ld_r13_to_r14_ret): #endif /* L_millicodethunk_ret */ +#define ARC_OPTFPE (defined (__ARC700__) || defined (__ARC_FPX_QUARK__)) + +#if ARC_OPTFPE #ifdef L_adddf3 #ifdef __ARC_NORM__ #include "ieee-754/adddf3.S" @@ -1265,7 +1268,7 @@ SYM(__ld_r13_to_r14_ret): #endif #ifdef L_muldf3 -#if defined (__ARC700__) || defined (__HS__) +#ifdef __ARC_MPY__ #include "ieee-754/muldf3.S" #elif defined (__ARC_NORM__) && defined(__ARC_MUL64__) #include "ieee-754/arc600-mul64/muldf3.S" @@ -1281,7 +1284,7 @@ SYM(__ld_r13_to_r14_ret): #endif #ifdef L_mulsf3 -#if defined (__ARC700__) || defined (__HS__) +#ifdef __ARC_MPY__ #include "ieee-754/mulsf3.S" #elif defined (__ARC_NORM__) && defined(__ARC_MUL64__) #include "ieee-754/arc600-mul64/mulsf3.S" @@ -1293,7 +1296,7 @@ SYM(__ld_r13_to_r14_ret): #endif #ifdef L_divdf3 -#if defined (__ARC700__) || defined (__HS__) +#ifdef __ARC_MPY__ #include "ieee-754/divdf3.S" #elif defined (__ARC_NORM__) && defined(__ARC_MUL64__) #include "ieee-754/arc600-mul64/divdf3.S" @@ -1303,7 +1306,7 @@ SYM(__ld_r13_to_r14_ret): #endif #ifdef L_divsf3 -#if defined (__ARC700__) || defined (__HS__) +#ifdef __ARC_MPY__ #include "ieee-754/divsf3-stdmul.S" #elif defined (__ARC_NORM__) && defined(__ARC_MUL64__) #include "ieee-754/arc600-mul64/divsf3.S" @@ -1421,3 +1424,4 @@ SYM(__ld_r13_to_r14_ret): #include "ieee-754/ordsf2.S" #endif #endif +#endif /* ARC_OPTFPE */