From 3a652cd28ec554267be414d69ed14b46956f84d7 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 23 Dec 2009 03:37:41 +0000 Subject: Change --with-isa to --enable-isa and --with-{sse2,ssse3,altivec,aes_ni} to --enable-{sse2,ssse3,altivec,aes_ni}. Add cooresponding --disable options, which completely remove support for said ISA even if the CPU we are configuring for is supposed to have it. --- configure.py | 50 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 13 deletions(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index 5e1e73e2e..fa4be8bd1 100755 --- a/configure.py +++ b/configure.py @@ -152,18 +152,32 @@ def process_command_line(args): dest='unaligned_mem', action='store_false', help=SUPPRESS_HELP) - target_group.add_option('--with-isa-extension', metavar='ISALIST', - dest='with_isa_extns', + target_group.add_option('--enable-isa', metavar='ISALIST', + dest='enable_isa_extns', action='append', default=[], help='enable ISA extensions') + target_group.add_option('--disable-isa', metavar='ISALIST', + dest='disable_isa_extns', + action='append', default=[], + help=SUPPRESS_HELP) + for isa_extn in ['sse2', 'ssse3', 'altivec', 'aes_ni']: - target_group.add_option('--with-%s' % (isa_extn), + target_group.add_option('--enable-%s' % (isa_extn), + action='callback', + help=SUPPRESS_HELP, + callback=optparse_append_const, + callback_kwargs = { + 'dest': 'enable_isa_extns', + 'arg': isa_extn } + ) + + target_group.add_option('--disable-%s' % (isa_extn), action='callback', help=SUPPRESS_HELP, callback=optparse_append_const, callback_kwargs = { - 'dest': 'with_isa_extns', + 'dest': 'disable_isa_extns', 'arg': isa_extn } ) @@ -298,7 +312,8 @@ def process_command_line(args): options.enabled_modules = parse_multiple_enable(options.enabled_modules) options.disabled_modules = parse_multiple_enable(options.disabled_modules) - options.with_isa_extns = parse_multiple_enable(options.with_isa_extns) + options.enable_isa_extns = parse_multiple_enable(options.enable_isa_extns) + options.disable_isa_extns = parse_multiple_enable(options.disable_isa_extns) return options @@ -463,9 +478,14 @@ class ModuleInfo(object): return False if self.need_isa != None: - cpu_isa = archinfo.isa_extensions_in(cpu_name) - if self.need_isa not in cpu_isa: - return self.need_isa in options.with_isa_extns + if self.need_isa in options.disable_isa_extns: + return False # explicitly disabled + + if self.need_isa in options.enable_isa_extns: + return True # explicitly enabled + + # Default to whatever the CPU is supposed to support + return self.need_isa in archinfo.isa_extensions_in(cpu_name) return True @@ -554,12 +574,16 @@ class ArchInfo(object): if self.basename != options.cpu: macros.append('TARGET_CPU_IS_%s' % (form_cpu_macro(options.cpu))) - isa_extensions = sorted(set( - flatten([self.isa_extensions_in(options.cpu), - options.with_isa_extns]))) + enabled_isas = set(flatten( + [self.isa_extensions_in(options.cpu), + options.enable_isa_extns])) + + disabled_isas = set(options.disable_isa_extns) + + isa_extensions = sorted(enabled_isas - disabled_isas) - for simd in isa_extensions: - macros.append('TARGET_CPU_HAS_%s' % (simd.upper())) + for isa in isa_extensions: + macros.append('TARGET_CPU_HAS_%s' % (isa.upper())) endian = options.with_endian or self.endian -- cgit v1.2.3