From patchwork Tue Sep 7 10:36:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Seymour X-Patchwork-Id: 63985 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id AB622B6F11 for ; Tue, 7 Sep 2010 20:36:19 +1000 (EST) Received: (qmail 27899 invoked by alias); 7 Sep 2010 10:36:16 -0000 Received: (qmail 27620 invoked by uid 22791); 7 Sep 2010 10:36:14 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from portal.icerasemi.com (HELO pOrtaL.icerasemi.com) (213.249.204.90) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Sep 2010 10:36:05 +0000 X-ASG-Debug-ID: 1283855762-5ebb00070000-Gfy7bY X-Barracuda-URL: http://192.168.1.243:80/cgi-bin/mark.cgi Received: from Exchangevs.Icerasemi.com (cluster1.icerasemi.local [192.168.1.203]) by pOrtaL.icerasemi.com (Spam & Virus Firewall) with ESMTP id 3184AE5741 for ; Tue, 7 Sep 2010 10:36:02 +0000 (GMT) Received: from Exchangevs.Icerasemi.com (cluster1.icerasemi.local [192.168.1.203]) by pOrtaL.icerasemi.com with ESMTP id a2ImGbo1wvTa27bF for ; Tue, 07 Sep 2010 10:36:02 +0000 (GMT) Received: from brsbs01.icerasemi.com ([192.168.1.54]) by Exchangevs.Icerasemi.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 7 Sep 2010 11:36:01 +0100 Received: from brsbs01.icerasemi.com (localhost [127.0.0.1]) by brsbs01.icerasemi.com (8.14.2/8.14.2/Debian-2build1) with ESMTP id o87Aa1eC005909; Tue, 7 Sep 2010 11:36:01 +0100 Received: (from seymour@localhost) by brsbs01.icerasemi.com (8.12.11/8.12.11/Submit) id o87Aa1a6005906; Tue, 7 Sep 2010 11:36:01 +0100 Date: Tue, 7 Sep 2010 11:36:01 +0100 Message-Id: <201009071036.o87Aa1a6005906@brsbs01.icerasemi.com> From: Joe Seymour To: gcc-patches@gcc.gnu.org CC: sdkteam-gnu@icerasemi.com X-ASG-Orig-Subj: GNU Superopt Updated README Subject: GNU Superopt Updated README X-Barracuda-Connect: cluster1.icerasemi.local[192.168.1.203] X-Barracuda-Start-Time: 1283855762 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.40136 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org In addition to the patches, here's an updated README: --- /home/seymour/superopt-2.5/README 1995-05-17 17:13:52.000000000 +0100 +++ README 2010-09-06 17:57:42.327956000 +0100 @@ -22,14 +22,11 @@ cases it is about 5, but for a rich inst instructions long. It took several weeks to generate it... The superoptimizer can't guarantee that it finds the best possible -instruction sequences for all possible goal functions. For example, it -doesn't even try to include immediate constants (other that -1, 0, +1, and -the smallest negative and biggest positive numbers) in the sequences. - -Other reasons why not optimal sequences might be found is that not all -instructions are included, not even in their register-only form. Also, some -instructions included might not be correctly simulated. If you encounter -any of these problems, please report them to the address below. +instruction sequences for all possible goal functions. This is +because not all instructions are included, not even in their +register-only form. Also, some instructions included might not be +correctly simulated. If you encounter any of these problems, please +report them to the address below. WARNING! The generated sequences might be incorrect with a very small probability. Always make sure a sequence is correct before using it. So @@ -70,8 +67,10 @@ superoptimizer and `make install-all' to To run the superoptimizer, type - superopt -f | -all [-assembly] [-max-cost n] - [-shifts] [-extracts] [-no-carry-insns] [-extra-cost n] + superopt -f [-assembly] [-max-cost n] [-min-cost n] + [-consts] [-clist ...] [-cpot] [-cpotmo] + [-no-carry-insns] [-extra-cost n] [-nl] [-limit n] + and wait until the found instructions sequences are printed. For example, @@ -83,9 +82,10 @@ will print all sequences computing the s See below for some examples of possible goal functions. -By default, the superoptimizer doesn't try all immediate shift counts. To -enable all shift counts, pass -shifts as a command line option. To enable -all bit field extracts, use -extracts. +By default, the superoptimizer doesn't try all immediate shift counts. +To enable all shift counts, pass -shifts as a command line option. To +enable all bit field extracts, use -extracts. To enable immediates for +non-shift instructions use -consts, by default only -1 0 1 are tried. OPTIONS @@ -104,6 +104,14 @@ Option names may be abbreviated. stop the search if no instruction sequence of that length or shorter is found. By default this is 4. +-min-cost n + Specify a minimum sequence length. May be used to carry a + search on from a point after failing for shorter sequences. + +-limit n + Limit the number of results to n sequences. May be used to + terminate the search early after a few sequences have been found. + -extra-cost n Search for sequences n more expensive than the cheapest found sequence. Default is 0 meaning that only the cheapest sequence(s) @@ -121,6 +129,24 @@ Option names may be abbreviated. Include all bit field extracts supported by the target architecture in the search. This slows down the search considerably. +-consts + Include all immediate values for instructions that support + them. This slows down the search massivley, using it for sequences + longer than 3 instructions will take a lot of time. + +-cpot + Include all powers of two as immediate values. This may be + used in combination with other constant flags. + +-cpotmo + Include all powers of two minus one as immediate values. This + may be used in combination with other constant flags. + +-clist n ... + Include values specified as immediates, this is useful if a + goal function has magic constants in. This may be used in + combination with other constant flags. + -f where is one of eq, ne, les, ges, lts, gts,