From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T53gS-00069C-1h for qemu-devel@nongnu.org; Fri, 24 Aug 2012 19:53:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T53gQ-00048a-Ob for qemu-devel@nongnu.org; Fri, 24 Aug 2012 19:52:59 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:38137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T53gQ-00048V-IM for qemu-devel@nongnu.org; Fri, 24 Aug 2012 19:52:58 -0400 Received: by dadn15 with SMTP id n15so1157143dad.4 for ; Fri, 24 Aug 2012 16:52:57 -0700 (PDT) Sender: Richard Henderson Message-ID: <503813D9.6000709@twiddle.net> Date: Fri, 24 Aug 2012 16:52:57 -0700 From: Richard Henderson MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC] Rewrite target-s390x List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel@nongnu.org I wanted to add some new insns, so that I could start testing gcc changes for z10+, but found the more or less ad-hoc disassembly routines difficult and error prone. I've begun rewriting the translator into a more table-driven approach, which I have so far found much easier to manage. I'd hoped to get all of the insns converted before the weekend, but there's 14 control insns left and I've run out of time. The approach assumes we don't care about performance on a 32-bit host. In practice we can't run anything on such a one anyway. Therefore we handle everything as a TCGv_i64 and be done with it. This greatly simplifies things. Translation proceeds by calling a sequence of small functions to load up the arguments as directed by the insn and the format, perform the operation, and setup the condition codes. All of the hooks are optional, and in extremis the operation can handle all of its arguments itself. This is not uncommon in some of the string functions where we simply load up register numbers and pass those down to a helper func. The current branch consists of 102 patches, most of which convert one or two instruction (groups) at a time. The format of the table went through at least 4 revisions, all but the last of which have been compressed together. Thus ignore the form of the table before patch 15: "Reboot^2 reorg". And because of that I'll not bother posting patches here yet, and simply direct those interested to git://repo.or.cz/qemu/rth.git rth/s390-reorg While I'll probably keep working on this for myself in either case, I'm wondering about commitment to reviewing this monster. I'm also of course interested in obvious errors and the like as well. r~