From patchwork Sat Jan 20 03:46:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 863919 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-471720-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tcDWpFft"; dkim-atps=neutral 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 3zNkCS2RYfz9t3B for ; Sat, 20 Jan 2018 14:46:58 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=y08M/ fJw/Ik7bGPB84eU/3GPab1wRCqa71ZimRV9QqlGNTVrbkSLmEGkLo9+IKT6//Fvc JUKQEYHLfKCyqtmTRbMBb3CHVn/YOqmXzV4dgc/hIhz8pgBTMYSCyS/gtgC8KG5x 0bwClHdqjKVgvgVMAVNjnKV1whGytmWrds96LQ= 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:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=HTyc8MH99qG /oQldw/ABxA0OaZQ=; b=tcDWpFftKW75aJqy+jUKsWtVQCRd+5PylUuH6ISSnht hCQCTjdNTJmNi8ohy/ALAbzoEyOa/4SY2pgHtQ6fAmP2IHC43L4ymrewolr9l3ow knkpexQBxrYVYe8PTEpjos2tbeFl17zfwfyYf4d0A/9RPyafz9zUkdrGmfyj2LU8 = Received: (qmail 23259 invoked by alias); 20 Jan 2018 03:46:51 -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 23189 invoked by uid 89); 20 Jan 2018 03:46:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 20 Jan 2018 03:46:34 +0000 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0K3ihf3093871 for ; Fri, 19 Jan 2018 22:46:33 -0500 Received: from e37.co.us.ibm.com (e37.co.us.ibm.com [32.97.110.158]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fksbs032p-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 19 Jan 2018 22:46:32 -0500 Received: from localhost by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 Jan 2018 20:46:31 -0700 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 19 Jan 2018 20:46:29 -0700 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0K3kS3n9765342; Fri, 19 Jan 2018 20:46:28 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7B1D5C603C; Fri, 19 Jan 2018 20:46:28 -0700 (MST) Received: from bigmac.rchland.ibm.com (unknown [9.10.86.45]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id 3B832C6037; Fri, 19 Jan 2018 20:46:28 -0700 (MST) To: GCC Patches Cc: Segher Boessenkool , David Edelsohn From: Bill Schmidt Subject: [PATCH, rs6000] Requested cleanups for BE handling of -mno-speculate-indirect-jumps Date: Fri, 19 Jan 2018 21:46:27 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18012003-0024-0000-0000-000017D19D94 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008406; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000247; SDB=6.00977578; UDB=6.00495584; IPR=6.00757366; BA=6.00005786; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019133; XFM=3.00000015; UTC=2018-01-20 03:46:29 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18012003-0025-0000-0000-00004E5F6EC9 Message-Id: <425ae17f-4bca-0bdb-7728-b99ac6dd1b2c@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-20_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801200053 X-IsSubscribed: yes Hi, Segher had previously requested some cleanups in https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01605.html. Due to time pressures, I delayed those, but they are ready now. Here they are, bootstrapped and tested on powerpc64le-linux-gnu and powerpc64-linux-gnu. Is this okay for trunk? I don't intend to backport these. Thanks, Bill 2018-01-19 Bill Schmidt * config/rs6000/rs6000.md (*call_indirect_nonlocal_sysv): Simplify the clause that sets the length attribute. (*call_value_indirect_nonlocal_sysv): Likewise. (*sibcall_nonlocal_sysv): Clean up code block; simplify the clause that sets the length attribute. (*sibcall_value_nonlocal_sysv): Likewise. Index: gcc/config/rs6000/rs6000.md =================================================================== --- gcc/config/rs6000/rs6000.md (revision 256894) +++ gcc/config/rs6000/rs6000.md (working copy) @@ -10463,17 +10463,11 @@ (set (attr "length") (cond [(and (eq (symbol_ref "which_alternative") (const_int 0)) (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 1))) - (const_string "4") - (and (eq (symbol_ref "which_alternative") (const_int 0)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") (const_int 0))) (const_string "8") - (eq (symbol_ref "which_alternative") (const_int 1)) - (const_string "4") (and (eq (symbol_ref "which_alternative") (const_int 2)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 1))) + (ne (symbol_ref "rs6000_speculate_indirect_jumps") + (const_int 0))) (const_string "8") (and (eq (symbol_ref "which_alternative") (const_int 2)) (eq (symbol_ref "rs6000_speculate_indirect_jumps") @@ -10576,17 +10570,11 @@ (set (attr "length") (cond [(and (eq (symbol_ref "which_alternative") (const_int 0)) (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 1))) - (const_string "4") - (and (eq (symbol_ref "which_alternative") (const_int 0)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") (const_int 0))) (const_string "8") - (eq (symbol_ref "which_alternative") (const_int 1)) - (const_string "4") (and (eq (symbol_ref "which_alternative") (const_int 2)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 1))) + (ne (symbol_ref "rs6000_speculate_indirect_jumps") + (const_int 0))) (const_string "8") (and (eq (symbol_ref "which_alternative") (const_int 2)) (eq (symbol_ref "rs6000_speculate_indirect_jumps") @@ -10973,47 +10961,40 @@ "(DEFAULT_ABI == ABI_DARWIN || DEFAULT_ABI == ABI_V4) && (INTVAL (operands[2]) & CALL_LONG) == 0" - "* { if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS) - output_asm_insn (\"crxor 6,6,6\", operands); + output_asm_insn ("crxor 6,6,6", operands); else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS) - output_asm_insn (\"creqv 6,6,6\", operands); + output_asm_insn ("creqv 6,6,6", operands); if (which_alternative >= 2) { if (rs6000_speculate_indirect_jumps) - return \"b%T0\"; + return "b%T0"; else /* Can use CR0 since it is volatile across sibcalls. */ - return \"crset eq\;beq%T0-\;b $\"; + return "crset eq;beq%T0-;b $"; } else if (DEFAULT_ABI == ABI_V4 && flag_pic) { gcc_assert (!TARGET_SECURE_PLT); - return \"b %z0@plt\"; + return "b %z0@plt"; } else - return \"b %z0\"; -}" + return "b %z0"; +} [(set_attr "type" "branch") (set (attr "length") - (cond [(eq (symbol_ref "which_alternative") (const_int 0)) - (const_string "4") - (eq (symbol_ref "which_alternative") (const_int 1)) + (cond [(eq (symbol_ref "which_alternative") (const_int 1)) (const_string "8") (and (eq (symbol_ref "which_alternative") (const_int 2)) (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 1))) - (const_string "4") - (and (eq (symbol_ref "which_alternative") (const_int 2)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") (const_int 0))) (const_string "12") (and (eq (symbol_ref "which_alternative") (const_int 3)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 1))) + (ne (symbol_ref "rs6000_speculate_indirect_jumps") + (const_int 0))) (const_string "8") (and (eq (symbol_ref "which_alternative") (const_int 3)) (eq (symbol_ref "rs6000_speculate_indirect_jumps") @@ -11030,47 +11011,40 @@ "(DEFAULT_ABI == ABI_DARWIN || DEFAULT_ABI == ABI_V4) && (INTVAL (operands[3]) & CALL_LONG) == 0" - "* { if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS) - output_asm_insn (\"crxor 6,6,6\", operands); + output_asm_insn ("crxor 6,6,6", operands); else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS) - output_asm_insn (\"creqv 6,6,6\", operands); + output_asm_insn ("creqv 6,6,6", operands); if (which_alternative >= 2) { if (rs6000_speculate_indirect_jumps) - return \"b%T1\"; + return "b%T1"; else /* Can use CR0 since it is volatile across sibcalls. */ - return \"crset eq\;beq%T1-\;b $\"; + return "crset eq;beq%T1-;b $"; } else if (DEFAULT_ABI == ABI_V4 && flag_pic) { gcc_assert (!TARGET_SECURE_PLT); - return \"b %z1@plt\"; + return "b %z1@plt"; } else - return \"b %z1\"; -}" + return "b %z1"; +} [(set_attr "type" "branch") (set (attr "length") - (cond [(eq (symbol_ref "which_alternative") (const_int 0)) - (const_string "4") - (eq (symbol_ref "which_alternative") (const_int 1)) + (cond [(eq (symbol_ref "which_alternative") (const_int 1)) (const_string "8") (and (eq (symbol_ref "which_alternative") (const_int 2)) (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 1))) - (const_string "4") - (and (eq (symbol_ref "which_alternative") (const_int 2)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") (const_int 0))) (const_string "12") (and (eq (symbol_ref "which_alternative") (const_int 3)) - (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 1))) + (ne (symbol_ref "rs6000_speculate_indirect_jumps") + (const_int 0))) (const_string "8") (and (eq (symbol_ref "which_alternative") (const_int 3)) (eq (symbol_ref "rs6000_speculate_indirect_jumps")