From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9881 invoked by alias); 11 Jun 2013 09:58:28 -0000 Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org Received: (qmail 9871 invoked by uid 89); 11 Jun 2013 09:58:28 -0000 X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL,BAYES_40,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-we0-f176.google.com (HELO mail-we0-f176.google.com) (74.125.82.176) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 11 Jun 2013 09:58:27 +0000 Received: by mail-we0-f176.google.com with SMTP id t56so5696549wes.35 for ; Tue, 11 Jun 2013 02:58:25 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.107.104 with SMTP id hb8mr762755wib.26.1370944705368; Tue, 11 Jun 2013 02:58:25 -0700 (PDT) Received: by 10.180.5.3 with HTTP; Tue, 11 Jun 2013 02:58:25 -0700 (PDT) Date: Tue, 11 Jun 2013 09:58:00 -0000 Message-ID: Subject: ifield's value processing -- help is needed From: Lev Yudalevich To: cgen@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2013-q2/txt/msg00004.txt.bz2 Hello, (I'm not 100% sure if this is a correct place to ask, but I'd very appreciate any answer) I'm wandering if there is a possibility to specify (either in a `.cpu' file or in a corresponding `.opc' file) an additional processing function for a value of an instruction's ifield. For example, I'd like to define several isa sets. Suppose that these sets differ by opcode values only. In this case, I may supply a simple lookup function that picks the correct value depending on the isa. My problem is that I can not find a way to pass such a function (nor in Scheme neither in C) as a part of the format list of an instruction definition. Having user-defined parse and print handlers (as for operand definitions) would have solve the problem, but there are none for ifields. Another workaround is to hardcode all opcodes for all isas, but in this case I have no way to distinguish between different isas inside cgen_dis_hash function, which only gets a buffer and a value as arguments. Any advice is highly welcome. Sincerely, Lev.