From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14903 invoked by alias); 18 Jul 2009 20:54:53 -0000 Received: (qmail 14895 invoked by uid 22791); 18 Jul 2009 20:54:52 -0000 X-SWARE-Spam-Status: No, hits=1.5 required=5.0 tests=AWL,BAYES_00,DNS_FROM_RFC_BOGUSMX,J_CHICKENPOX_33,J_CHICKENPOX_43,J_CHICKENPOX_53,J_CHICKENPOX_63,J_CHICKENPOX_73,J_CHICKENPOX_83 X-Spam-Check-By: sourceware.org Received: from sebabeach.org (HELO sebabeach.org) (64.165.110.50) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 18 Jul 2009 20:54:46 +0000 Received: by sebabeach.org (Postfix, from userid 500) id 626D46E3D1; Sat, 18 Jul 2009 13:54:44 -0700 (PDT) From: Doug Evans To: cgen@sourceware.org Subject: speed up of opcodes m32c file generation Message-Id: <20090718205444.626D46E3D1@sebabeach.org> Date: Sat, 18 Jul 2009 20:54:00 -0000 X-IsSubscribed: yes 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 X-SW-Source: 2009-q3/txt/msg00030.txt.bz2 Hi. I checked in a patch to change the way iflds, operands, insns, and macro-insns are stored. It significantly speeds up opcodes m32c file generation (by a factor of 6 to 7 on my machine). http://sourceware.org/ml/cgen-cvs/2009/msg00075.html Things are still not good enough, but it's progress. Tested by regenerating all files for opcodes, sim, sid, doc, intrinsics. [opcodes and sim will see a small change in ifield tables, ifields f-nil and f-anyof now live in all isas, which is the right thing anyway] I had to add some hacks to preserve the existing output. We can remove them at any time, but it was useful for testing. [And if someone really needs guile 1.4 we could provide hash-fold in guile.scm, but I'm guessing folks would rather just delete support for 1.4.] 2009-07-17 Doug Evans Use hash tables to record ifields, operands, insns, macro-insns. * attr.scm (attr-builtin!): Tweak some comments. * hardware.scm (hardware-builtin!): Call all-isas-attr-value. * ifield.scm (): Subclass from instead of . (): New constructor. (ifield-builtin!): Add isa attr to f-nil, f-anyof. * insn.scm (): Subclass from instead of . (-sub-insn-make!): Add hack to avoid differences in generated code. (multi-insn-instantiate!): Add total number of multi-insns to logging message. * mach.scm (): Rename members ifld-list, op-list, insn-list, minsn-list to foo-table. New member next-ordinal. Update getters/setters. (arch-ifld-list, arch-op-list, arch-insn-list, arch-minsn-list): New functions. (-get-next-ordinal!, -get-lowest-ordinal): New function. (-make-ident-object-table, -ident-object-table->list, -ident-object-table-add!, -ident-object-table-lookup): New functions. (current-ifld-list, current-ifld-add! current-ifld-lookup, -ifld-already-defined?): Rewrite. (current-op-list, current-op-add! current-op-lookup, -op-already-defined?): Rewrite. (current-raw-insn-list, insn-list-car, insn-list-splice!): Delete. (current-insn-list, current-insn-add! current-insn-lookup, -insn-already-defined?): Rewrite. (current-minsn-list, current-minsn-add! current-minsn-lookup, -minsn-already-defined?): Rewrite. (all-isas-attr-value, all-isas-attr, attr-isa-list): New functions. (MAX-VIRTUAL-INSNS): Define. (arch-analyze-insns!): Add hack to avoid differences in generated code. Update use of arch-insn-list. (mach-init!): Initialize ifld-table, op-table, insn-table, minsn-table. (arch-finish!): Delete references to ifld-table, op-table, insn-table, minsn-table. * minsn.scm (): Subclass from instead of . New constructor. * operand.scm (): Subclass from instead of . * sid.scm (-virtual-insn-add!): New function. (-create-virtual-insns!): Call it. (-fill-sim-insn-list!): Rewrite. * sim.scm (-virtual-insn-add!, -create-virtual-insns!): New functions. (sim-finish!): Move contents to -create-virtual-insns!, and call it. * utils-cgen.scm (): New class. (obj-ordinal, obj-set-ordinal!): New functions. (add-ident-methods!): Delete. * model.scm (parse-insn-timing): Change logging message to level 3.