From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8049 invoked by alias); 8 Sep 2005 13:56:29 -0000 Mailing-List: contact cgen-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sources.redhat.com Received: (qmail 7579 invoked by uid 22791); 8 Sep 2005 13:55:26 -0000 Received: from multi.imgtec.com (HELO multi.imgtec.com) (194.200.65.239) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 08 Sep 2005 13:55:26 +0000 X-SEF-Processed: 5_0_0_812__2005_09_08_14_55_18 Received: from Unknown [192.168.5.239] by multi.imgtec.com - SurfControl E-mail Filter (5.0); Thu, 08 Sep 2005 14:55:18 +0100 Received: from lemail1.le.imgtec.org ([192.168.152.65]) by klmail1.kl.imgtec.org with Microsoft SMTPSVC(6.0.3790.1830); Thu, 8 Sep 2005 14:55:17 +0100 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Constraints between operands Date: Thu, 08 Sep 2005 13:56:00 -0000 Message-ID: <0D107966AF6D79418315B7C5549F4B5104DFDC@lemail1.le.imgtec.org> From: "Will Newton" To: X-SW-Source: 2005-q3/txt/msg00019.txt.bz2 I'm using cgen to write a binutils port for a processor. I've come across a problem I haven't been able to solve yet with expressing a constraint between a number of fields in an instruction. The instruction is encoded like this: Bit 24: Data Unit Specifier Bits 23-19: Destination Register Bites 18-14: Source Register (other bits omitted for simplicity) The data unit bit specifies with set of registers this instruction operates on. I have modelled this as a multi field for each register. However I need to ensure that the assembler only allows destination and source registers from the same unit to be specified and gives an error otherwise, e.g.: ADD D0.1,D0.2 ; Data unit 0 for both regs, OK ADD D0.1,D1.2 ; Data unit mismatch, error! Is there a way to express this with cgen? I have tried using (error) to notify the user about this but cgen_rtx_error is not defined by opcodes and I don't really know if it's possible to define it appropriately.