aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-09-07 16:52:27 -0400
committerJack Lloyd <[email protected]>2019-09-07 16:52:27 -0400
commitc437e43066ae73741a3eb57f159d74250b311a9c (patch)
treea70b6d12fec97cc27bddd83e72c85cdab8099d47
parenta2845235b3721526da2b0a949fe6053e1320eec3 (diff)
Disable vperm AES on big-endian systems
All the constants need to be tweaked and possibly other changes are required.
-rwxr-xr-xconfigure.py40
-rw-r--r--src/configs/pylint.rc2
-rw-r--r--src/lib/block/aes/aes_vperm/info.txt2
3 files changed, 27 insertions, 17 deletions
diff --git a/configure.py b/configure.py
index 21459edc8..94b7b9460 100755
--- a/configure.py
+++ b/configure.py
@@ -799,7 +799,8 @@ class ModuleInfo(InfoObject):
'os_features', 'arch', 'isa', 'cc', 'comment', 'warning'],
['defines', 'libs', 'frameworks'],
{
- 'load_on': 'auto'
+ 'load_on': 'auto',
+ 'endian': 'any',
})
def check_header_duplicates(header_list_public, header_list_internal):
@@ -852,6 +853,7 @@ class ModuleInfo(InfoObject):
self.os_features = lex.os_features
self.requires = lex.requires
self.warning = combine_lines(lex.warning)
+ self.endian = lex.endian
# Modify members
self.source = [normalize_source_path(os.path.join(self.lives_in, s)) for s in self.source]
@@ -944,6 +946,10 @@ class ModuleInfo(InfoObject):
arch_name = archinfo.basename
cpu_name = options.cpu
+ if self.endian != 'any':
+ if self.endian != options.with_endian:
+ return False
+
for isa in self.isa:
if isa.find(':') > 0:
(arch, isa) = isa.split(':')
@@ -1935,19 +1941,6 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch,
return osinfo.ar_command
- def choose_endian(arch_info, options):
- if options.with_endian is not None:
- return options.with_endian
-
- if options.cpu.endswith('eb') or options.cpu.endswith('be'):
- return 'big'
- elif options.cpu.endswith('el') or options.cpu.endswith('le'):
- return 'little'
-
- if arch_info.endian:
- logging.info('Defaulting to assuming %s endian', arch_info.endian)
- return arch_info.endian
-
build_dir = options.with_build_dir or os.path.curdir
program_suffix = options.program_suffix or osinfo.program_suffix
@@ -2050,7 +2043,7 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch,
'os': options.os,
'arch': options.arch,
'cpu_family': arch.family,
- 'endian': choose_endian(arch, options),
+ 'endian': options.with_endian,
'cpu_is_64bit': arch.wordsize == 64,
'bakefile_arch': 'x86' if options.arch == 'x86_32' else 'x86_64',
@@ -3300,7 +3293,7 @@ def main(argv):
Main driver
"""
- # pylint: disable=too-many-locals
+ # pylint: disable=too-many-locals,too-many-statements
options = process_command_line(argv[1:])
@@ -3369,6 +3362,21 @@ def main(argv):
logging.info('Target is %s:%s-%s-%s' % (
options.compiler, cc_min_version, options.os, options.arch))
+ def choose_endian(arch_info, options):
+ if options.with_endian is not None:
+ return options.with_endian
+
+ if options.cpu.endswith('eb') or options.cpu.endswith('be'):
+ return 'big'
+ elif options.cpu.endswith('el') or options.cpu.endswith('le'):
+ return 'little'
+
+ if arch_info.endian:
+ logging.info('Assuming target %s is %s endian', arch_info.basename, arch_info.endian)
+ return arch_info.endian
+
+ options.with_endian = choose_endian(arch, options)
+
chooser = ModulesChooser(info_modules, module_policy, arch, osinfo, cc, cc_min_version, options)
loaded_module_names = chooser.choose()
using_mods = [info_modules[modname] for modname in loaded_module_names]
diff --git a/src/configs/pylint.rc b/src/configs/pylint.rc
index aea9463e6..ae9d2e24c 100644
--- a/src/configs/pylint.rc
+++ b/src/configs/pylint.rc
@@ -360,7 +360,7 @@ max-statements=50
max-parents=7
# Maximum number of attributes for a class (see R0902).
-max-attributes=15
+max-attributes=32
# Minimum number of public methods for a class (see R0903).
min-public-methods=0
diff --git a/src/lib/block/aes/aes_vperm/info.txt b/src/lib/block/aes/aes_vperm/info.txt
index b92cc21b3..0b7eabaac 100644
--- a/src/lib/block/aes/aes_vperm/info.txt
+++ b/src/lib/block/aes/aes_vperm/info.txt
@@ -2,6 +2,8 @@
AES_VPERM -> 20190901
</defines>
+endian little
+
<isa>
x86_32:sse2
x86_64:sse2