From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4564 invoked by alias); 18 Sep 2009 12:06:50 -0000 Received: (qmail 4553 invoked by uid 22791); 18 Sep 2009 12:06:50 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mtagate7.de.ibm.com (HELO mtagate7.de.ibm.com) (195.212.17.167) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Sep 2009 12:06:45 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate7.de.ibm.com (8.13.1/8.13.1) with ESMTP id n8IC6gBM013117 for ; Fri, 18 Sep 2009 12:06:42 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n8IC6f2a2678926 for ; Fri, 18 Sep 2009 14:06:42 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n8IC6fo6017690 for ; Fri, 18 Sep 2009 14:06:41 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id n8IC6eVW017655; Fri, 18 Sep 2009 14:06:40 +0200 Message-Id: <200909181206.n8IC6eVW017655@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 18 Sep 2009 14:06:40 +0200 Subject: Re: i370 port To: mutazilah@gmail.com (Paul Edwards) Date: Fri, 18 Sep 2009 12:06:00 -0000 From: "Ulrich Weigand" Cc: joseph@codesourcery.com (Joseph S. Myers), gcc@gcc.gnu.org In-Reply-To: from "Paul Edwards" at Sep 18, 2009 10:35:22 AM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-09/txt/msg00317.txt.bz2 Paul Edwards wrote: > > As an alternative to the operand predicate, you might also add > > an extra check to the insn condition. For example, something > > along the following lines should work: > > > > (define_insn "" > > [(set (match_operand:SI 0 "register_operand" "=d") > > (mult:SI (match_operand:SI 1 "register_operand" "0") > > (match_operand:SI 2 "const_int_operand" "K")))] > > "CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')" > > My eyes lit up when I saw that! However, it produced a compiler > error when I tried it. But undeterred, I tried this: > > (define_insn "" > [(set (match_operand:SI 0 "register_operand" "=d") > (mult:SI (match_operand:SI 1 "register_operand" "0") > (match_operand:SI 2 "immediate_operand" "K")))] > "(GET_CODE (operands[2]) == CONST_INT > && REG_P (operands[0]) > && CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K'))" Huh. Instead of adding an explicit CONST_INT check, my approach above used a const_int_operand predicate (instead of immediate_operand). That should have had the exact same effect ... I'm not sure why the REG_P check on the other operand would be necessary at this point. > And it worked (verified by self-compile)! And I relaxed the > constraint on the "M" instruction as well. Those old warnings > are apparently irrelevant now. Thank you sir. :-) OK, that's good to know. Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com