From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96063 invoked by alias); 26 Oct 2016 15:05:29 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 95941 invoked by uid 89); 26 Oct 2016 15:05:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,RCVD_IN_SEMBACKSCATTER,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=phd, sk:acsawde, U*acsawdey, acsawdeylinuxvnetibmcom X-HELO: mx0a-001b2d01.pphosted.com Subject: _HAVE_STRING_ARCH_strcpy/strncpy and ppc64 macro expansion of strcpy/strncpy. From: Aaron Sawdey To: libc-alpha@sourceware.org Cc: tuliom@linux.vnet.ibm.com, munroesj@linux.vnet.ibm.com, wschmidt@linux.vnet.ibm.com Date: Wed, 26 Oct 2016 15:05:00 -0000 Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16102615-0012-0000-0000-000010FB1407 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005982; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000188; SDB=6.00773043; UDB=6.00371133; IPR=6.00549875; BA=6.00004835; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013108; XFM=3.00000011; UTC=2016-10-26 15:04:31 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16102615-0013-0000-0000-000046A25DA3 Message-Id: <1477494262.5924.13.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-26_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610260261 X-SW-Source: 2016-10/txt/msg00465.txt.bz2 At present, powerpc uses the generic macros for strcpy/strncpy expansion, which includes an expansion into code that compares the strings character by character if one string is a string constant and is less than 4 chars.  I'm currently working on builtin expansion of strcmp/strncmp in gcc7 for powerpc, similar to the memcmp builtin expansion I checked in a couple weeks ago. This will potentialy generate much better code for these short comparisons because gcc often knows the alignment which allows it to generate word or doubleword comparisons reducing the number of branches greatly. However as things currently stand, comparisons to constant strings < 4 chars never see a strcmp/strncmp call because they get macro expanded into comparison code. What would be helpful would be a change to have powerpc specific code that doesn't invoke __strcmp_cg if compiled with gcc7 or higher. Thanks,     Aaron -- Aaron Sawdey, Ph.D. acsawdey@linux.vnet.ibm.com 050-2/C113 (507) 253-7520 home: 507/263-0782 IBM Linux Technology Center - PPC Toolchain