Chris@10: (* Chris@10: * Copyright (c) 1997-1999 Massachusetts Institute of Technology Chris@10: * Copyright (c) 2003, 2007-11 Matteo Frigo Chris@10: * Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology Chris@10: * Chris@10: * This program is free software; you can redistribute it and/or modify Chris@10: * it under the terms of the GNU General Public License as published by Chris@10: * the Free Software Foundation; either version 2 of the License, or Chris@10: * (at your option) any later version. Chris@10: * Chris@10: * This program is distributed in the hope that it will be useful, Chris@10: * but WITHOUT ANY WARRANTY; without even the implied warranty of Chris@10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Chris@10: * GNU General Public License for more details. Chris@10: * Chris@10: * You should have received a copy of the GNU General Public License Chris@10: * along with this program; if not, write to the Free Software Chris@10: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Chris@10: * Chris@10: *) Chris@10: Chris@10: (* magic parameters *) Chris@10: let verbose = ref false Chris@10: let vneg = ref false Chris@10: let karatsuba_min = ref 15 Chris@10: let karatsuba_variant = ref 2 Chris@10: let circular_min = ref 64 Chris@10: let rader_min = ref 13 Chris@10: let rader_list = ref [5] Chris@10: let alternate_convolution = ref 17 Chris@10: let threemult = ref false Chris@10: let inline_single = ref true Chris@10: let inline_loads = ref false Chris@10: let inline_loads_constants = ref false Chris@10: let inline_constants = ref true Chris@10: let trivial_stores = ref false Chris@10: let locations_are_special = ref false Chris@10: let strength_reduce_mul = ref false Chris@10: let number_of_variables = ref 4 Chris@10: let codelet_name = ref "unnamed" Chris@10: let randomized_cse = ref true Chris@10: let dif_split_radix = ref false Chris@10: let enable_fma = ref false Chris@10: let deep_collect_depth = ref 1 Chris@10: let schedule_type = ref 0 Chris@10: let compact = ref false Chris@10: let dag_dump_file = ref "" Chris@10: let alist_dump_file = ref "" Chris@10: let asched_dump_file = ref "" Chris@10: let lisp_syntax = ref false Chris@10: let network_transposition = ref true Chris@10: let inklude = ref "" Chris@10: let generic_arith = ref false Chris@10: let reorder_insns = ref false Chris@10: let reorder_loads = ref false Chris@10: let reorder_stores = ref false Chris@10: let precompute_twiddles = ref false Chris@10: let newsplit = ref false Chris@10: let standalone = ref false Chris@10: let pipeline_latency = ref 0 Chris@10: let schedule_for_pipeline = ref false Chris@10: let generate_bytw = ref true Chris@10: Chris@10: (* command-line parser for magic parameters *) Chris@10: let undocumented = " Undocumented voodoo parameter" Chris@10: Chris@10: let set_bool var = Arg.Unit (fun () -> var := true) Chris@10: let unset_bool var = Arg.Unit (fun () -> var := false) Chris@10: let set_int var = Arg.Int(fun i -> var := i) Chris@10: let set_string var = Arg.String(fun s -> var := s) Chris@10: Chris@10: let speclist = [ Chris@10: "-name", set_string codelet_name, " set codelet name"; Chris@10: "-standalone", set_bool standalone, " standalone codelet (no desc)"; Chris@10: "-include", set_string inklude, undocumented; Chris@10: Chris@10: "-verbose", set_bool verbose, " Enable verbose logging messages to stderr"; Chris@10: Chris@10: "-rader-min", set_int rader_min, Chris@10: " : Use Rader's algorithm for prime sizes >= "; Chris@10: Chris@10: "-threemult", set_bool threemult, Chris@10: " Use 3-multiply complex multiplications"; Chris@10: Chris@10: "-karatsuba-min", set_int karatsuba_min, undocumented; Chris@10: "-karatsuba-variant", set_int karatsuba_variant, undocumented; Chris@10: "-circular-min", set_int circular_min, undocumented; Chris@10: Chris@10: "-compact", set_bool compact, Chris@10: " Mangle variable names to reduce size of source code"; Chris@10: "-no-compact", unset_bool compact, Chris@10: " Disable -compact"; Chris@10: Chris@10: "-dump-dag", set_string dag_dump_file, undocumented; Chris@10: "-dump-alist", set_string alist_dump_file, undocumented; Chris@10: "-dump-asched", set_string asched_dump_file, undocumented; Chris@10: "-lisp-syntax", set_bool lisp_syntax, undocumented; Chris@10: Chris@10: "-alternate-convolution", set_int alternate_convolution, undocumented; Chris@10: "-deep-collect-depth", set_int deep_collect_depth, undocumented; Chris@10: "-schedule-type", set_int schedule_type, undocumented; Chris@10: "-pipeline-latency", set_int pipeline_latency, undocumented; Chris@10: "-schedule-for-pipeline", set_bool schedule_for_pipeline, undocumented; Chris@10: Chris@10: "-dif-split-radix", set_bool dif_split_radix, undocumented; Chris@10: "-dit-split-radix", unset_bool dif_split_radix, undocumented; Chris@10: Chris@10: "-generic-arith", set_bool generic_arith, undocumented; Chris@10: "-no-generic-arith", unset_bool generic_arith, undocumented; Chris@10: Chris@10: "-precompute-twiddles", set_bool precompute_twiddles, undocumented; Chris@10: "-no-precompute-twiddles", unset_bool precompute_twiddles, undocumented; Chris@10: Chris@10: "-inline-single", set_bool inline_single, undocumented; Chris@10: "-no-inline-single", unset_bool inline_single, undocumented; Chris@10: Chris@10: "-inline-loads", set_bool inline_loads, undocumented; Chris@10: "-no-inline-loads", unset_bool inline_loads, undocumented; Chris@10: Chris@10: "-inline-loads-constants", set_bool inline_loads_constants, undocumented; Chris@10: "-no-inline-loads-constants", Chris@10: unset_bool inline_loads_constants, undocumented; Chris@10: Chris@10: "-inline-constants", set_bool inline_constants, undocumented; Chris@10: "-no-inline-constants", unset_bool inline_constants, undocumented; Chris@10: Chris@10: "-trivial-stores", set_bool trivial_stores, undocumented; Chris@10: "-no-trivial-stores", unset_bool trivial_stores, undocumented; Chris@10: Chris@10: "-locations-are-special", set_bool locations_are_special, undocumented; Chris@10: "-no-locations-are-special", unset_bool locations_are_special, undocumented; Chris@10: Chris@10: "-randomized-cse", set_bool randomized_cse, undocumented; Chris@10: "-no-randomized-cse", unset_bool randomized_cse, undocumented; Chris@10: Chris@10: "-network-transposition", set_bool network_transposition, undocumented; Chris@10: "-no-network-transposition", unset_bool network_transposition, undocumented; Chris@10: Chris@10: "-reorder-insns", set_bool reorder_insns, undocumented; Chris@10: "-no-reorder-insns", unset_bool reorder_insns, undocumented; Chris@10: "-reorder-loads", set_bool reorder_loads, undocumented; Chris@10: "-no-reorder-loads", unset_bool reorder_loads, undocumented; Chris@10: "-reorder-stores", set_bool reorder_stores, undocumented; Chris@10: "-no-reorder-stores", unset_bool reorder_stores, undocumented; Chris@10: Chris@10: "-newsplit", set_bool newsplit, undocumented; Chris@10: Chris@10: "-vneg", set_bool vneg, undocumented; Chris@10: "-fma", set_bool enable_fma, undocumented; Chris@10: "-no-fma", unset_bool enable_fma, undocumented; Chris@10: Chris@10: "-variables", set_int number_of_variables, undocumented; Chris@10: Chris@10: "-strength-reduce-mul", set_bool strength_reduce_mul, undocumented; Chris@10: "-no-strength-reduce-mul", unset_bool strength_reduce_mul, undocumented; Chris@10: Chris@10: "-generate-bytw", set_bool generate_bytw, undocumented; Chris@10: "-no-generate-bytw", unset_bool generate_bytw, undocumented; Chris@10: ] Chris@10: Chris@10: