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