From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Date: Wed, 18 Dec 2019 02:01:40 +0000 Subject: Re: can someone solve string_32.h issue for SH ? Message-Id: <87tv5yjssb.wl-kuninori.morimoto.gx@renesas.com> List-Id: References: <339916914.636876.1576627652112.ref@mail.yahoo.com> <339916914.636876.1576627652112@mail.yahoo.com> In-Reply-To: <339916914.636876.1576627652112@mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Karl Nasrallah Cc: dalias@libc.org, geert@linux-m68k.org, ysato@users.sourceforge.jp, linux-sh@vger.kernel.org, linux-renesas-soc@vger.kernel.org Hi > You're using r0 explicitly in the asm but I don't see where you're > reserving it for your use. You need it either on the clobbers or bound > to a dummy output with earlyclobber. (snip) > __asm__ __volatile__ ( > "strncpy_start:\n\t" > "mov.b @%[src]+,%[r0_reg]\n\t" > "cmp/eq #0,%[r0_reg]\n\t" > "bt.s strncpy_pad\n\t" > "cmp/eq %[dest],%[dest_end]\n\t" > "bt.s strncpy_end\n\t" > "mov.b %[r0_reg],@%[dest]\n\t" > "bra strncpy_start\n\t" > "add #1,%[dest]\n\t" > "strncpy_pad:\n\t" > "bt.s strncpy_end\n\t" > "mov.b %[r0_reg],@%[dest]\n\t" > "add #1,%[dest]\n\t" > "bra strncpy_pad\n\t" > "cmp/eq %[dest],%[dest_end]\n\t" > "strncpy_end:\n\t" > : [src] "+r" (__src), [dest] "+r" (__dest), [r0_reg] "+&z" (r0_register) > : [dest_end] "r" (__dest_end) > : "t","memory" > ); Or, can we use general strncpy() instead of SH assemble one ? Thank you for your help !! Best regards --- Kuninori Morimoto From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF67BC43603 for ; Wed, 18 Dec 2019 02:01:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF97421835 for ; Wed, 18 Dec 2019 02:01:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726383AbfLRCBo (ORCPT ); Tue, 17 Dec 2019 21:01:44 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:56777 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725975AbfLRCBo (ORCPT ); Tue, 17 Dec 2019 21:01:44 -0500 Date: 18 Dec 2019 11:01:40 +0900 X-IronPort-AV: E=Sophos;i="5.69,327,1571670000"; d="scan'208";a="34483796" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 18 Dec 2019 11:01:40 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 8A4FA4156FB4; Wed, 18 Dec 2019 11:01:40 +0900 (JST) Message-ID: <87tv5yjssb.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Karl Nasrallah Cc: dalias@libc.org, geert@linux-m68k.org, ysato@users.sourceforge.jp, linux-sh@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: Re: can someone solve string_32.h issue for SH ? In-Reply-To: <339916914.636876.1576627652112@mail.yahoo.com> References: <339916914.636876.1576627652112.ref@mail.yahoo.com> <339916914.636876.1576627652112@mail.yahoo.com> User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Hi > You're using r0 explicitly in the asm but I don't see where you're > reserving it for your use. You need it either on the clobbers or bound > to a dummy output with earlyclobber. (snip) > __asm__ __volatile__ ( > "strncpy_start:\n\t" > "mov.b @%[src]+,%[r0_reg]\n\t" > "cmp/eq #0,%[r0_reg]\n\t" > "bt.s strncpy_pad\n\t" > "cmp/eq %[dest],%[dest_end]\n\t" > "bt.s strncpy_end\n\t" > "mov.b %[r0_reg],@%[dest]\n\t" > "bra strncpy_start\n\t" > "add #1,%[dest]\n\t" > "strncpy_pad:\n\t" > "bt.s strncpy_end\n\t" > "mov.b %[r0_reg],@%[dest]\n\t" > "add #1,%[dest]\n\t" > "bra strncpy_pad\n\t" > "cmp/eq %[dest],%[dest_end]\n\t" > "strncpy_end:\n\t" > : [src] "+r" (__src), [dest] "+r" (__dest), [r0_reg] "+&z" (r0_register) > : [dest_end] "r" (__dest_end) > : "t","memory" > ); Or, can we use general strncpy() instead of SH assemble one ? Thank you for your help !! Best regards --- Kuninori Morimoto