From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by sourceware.org (Postfix) with ESMTPS id 399473857C46 for ; Fri, 18 Sep 2020 11:44:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 399473857C46 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08IBe2IO054514 for ; Fri, 18 Sep 2020 11:44:26 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 33gnrrer2j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 18 Sep 2020 11:44:26 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08IBa1Vc014659 for ; Fri, 18 Sep 2020 11:44:26 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 33hm36q14r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 18 Sep 2020 11:44:26 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 08IBiPLm031275 for ; Fri, 18 Sep 2020 11:44:25 GMT Received: from termi.oracle.com (/10.175.21.78) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 18 Sep 2020 11:44:25 +0000 From: "Jose E. Marchesi" To: David Faust via Binutils Subject: Re: [PATCH] bpf: xBPF SDIV, SMOD instructions References: <20200917170905.31816-1-david.faust@oracle.com> Date: Fri, 18 Sep 2020 13:44:20 +0200 In-Reply-To: <20200917170905.31816-1-david.faust@oracle.com> (David Faust via Binutils's message of "Thu, 17 Sep 2020 10:09:05 -0700") Message-ID: <87tuvv1f8r.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9747 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxlogscore=704 malwarescore=0 mlxscore=0 phishscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009180097 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9747 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 mlxscore=0 bulkscore=0 suspectscore=0 clxscore=1015 mlxlogscore=723 adultscore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009180097 X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 11:44:28 -0000 Hi David. > +(define-pmacro (define-alu-insn-xbpf x-basename x-suffix x-op-class x-op-code > + x-endian x-mode x-semop) > + (begin > + ;; dst = dst OP immediate > + (dni (.sym x-basename x-suffix "i" x-endian) > + (.str x-basename x-suffix " immediate") > + ((ISA (.sym xbpf x-endian))) > + (.str x-basename x-suffix " $dst" x-endian ",$imm32") > + (+ imm32 (f-offset16 0) ((.sym f-src x-endian) 0) (.sym dst x-endian) > + x-op-class OP_SRC_K x-op-code) > + (set x-mode (.sym dst x-endian) (x-semop x-mode (.sym dst x-endian) imm32)) > + ()) > + ;; dst = dst OP src > + (dni (.sym x-basename x-suffix "r" x-endian) > + (.str x-basename x-suffix " register") > + ((ISA (.sym xbpf x-endian))) > + (.str x-basename x-suffix " $dst" x-endian ",$src" x-endian) > + (+ (f-imm32 0) (f-offset16 0) (.sym src x-endian) (.sym dst x-endian) > + x-op-class OP_SRC_X x-op-code) > + (set x-mode (.sym dst x-endian) > + (x-semop x-mode (.sym dst x-endian) (.sym src x-endian))) > + ()))) > + [...] > +(define-pmacro (daix x-basename x-op-code x-endian x-semop) > + (begin > + (define-alu-insn-xbpf x-basename "" OP_CLASS_ALU64 x-op-code x-endian DI x-semop) > + (define-alu-insn-xbpf x-basename "32" OP_CLASS_ALU x-op-code x-endian USI x-semop))) > + Why not using define-alu-insn-bin and daib instead of defining an additional pair of macros? We can pass the ISAs as arguments to daib/daiu and thus avoid replicating logic ...