diff options
author | lloyd <[email protected]> | 2009-12-23 03:37:41 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-12-23 03:37:41 +0000 |
commit | 3a652cd28ec554267be414d69ed14b46956f84d7 (patch) | |
tree | 2e6cfd957322bb1411fb5b97b0f8aa44d86310d6 /configure.py | |
parent | ec338fcb62f4f971b7afc606422bdc29a12cd960 (diff) |
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.
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 50 |
1 files changed, 37 insertions, 13 deletions
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 |