Skip to content
Snippets Groups Projects

SVE vectorization

Merged Michael Kuron requested to merge sve into master
Viewing commit 2f299689
Show latest version
3 files
+ 38
16
Preferences
Compare changes
Files
3
@@ -65,12 +65,14 @@ def get_vector_instruction_set_arm(data_type='double', instruction_set='neon'):
result = dict()
result['bytes'] = bitwidth // 8
predicate = f'{prefix}whilelt_b{bits[data_type]}(0, {width})'
int_predicate = f'{prefix}whilelt_b{bits["int"]}(0, {intwidth})'
for intrinsic_id, function_shortcut in base_names.items():
function_shortcut = function_shortcut.strip()
name = function_shortcut[:function_shortcut.index('[')]
arg_string = get_argument_string(function_shortcut, first=f'{prefix}ptrue_b{bits[data_type]}()'
if prefix == 'sv' else '')
arg_string = get_argument_string(function_shortcut, first=predicate if prefix == 'sv' else '')
if prefix == 'sv' and not name.startswith('ld') and not name.startswith('st') and not name.startswith(cmp):
undef = '_x'
else:
@@ -86,20 +88,19 @@ def get_vector_instruction_set_arm(data_type='double', instruction_set='neon'):
result['makeVecConstInt'] = f'svdup_s{bits["int"]}' + '({0})'
result['makeVecIndex'] = f'svindex_s{bits["int"]}' + '({0}, {1})'
result['+int'] = f"svadd_s{bits['int']}_x(svptrue_b{bits['int']}(), " + "{0}, {1})"
result['+int'] = f"svadd_s{bits['int']}_x({int_predicate}, " + "{0}, {1})"
attr = f' __attribute__((arm_sve_vector_bits({bitwidth})))'
result[data_type] = f'svfloat{bits[data_type]}_t{attr}'
result['int'] = f'svint{bits["int"]}_t{attr}'
result['bool'] = f'svbool_t{attr}'
result[data_type] = f'svfloat{bits[data_type]}_st'
result['int'] = f'svint{bits["int"]}_st'
result['bool'] = f'svbool_st'
result['headers'] = ['<arm_sve.h>', '"arm_neon_helpers.h"']
result['&'] = f'svand_b_z(svptrue_b{bits[data_type]}(),' + ' {0}, {1})'
result['|'] = f'svorr_b_z(svptrue_b{bits[data_type]}(),' + ' {0}, {1})'
result['&'] = f'svand_b_z({predicate},' + ' {0}, {1})'
result['|'] = f'svorr_b_z({predicate},' + ' {0}, {1})'
result['blendv'] = f'svsel_f{bits[data_type]}' + '({2}, {1}, {0})'
result['any'] = f'svptest_any(svptrue_b{bits[data_type]}(), {{0}}) > 0'
result['all'] = f'svcntp_b{bits[data_type]}(svptrue_b{bits[data_type]}(), {{0}}) == {width}'
result['any'] = f'svptest_any({predicate}, {{0}})'
result['all'] = f'svcntp_b{bits[data_type]}({predicate}, {{0}}) == {width}'
result['compile_flags'] = [f'-msve-vector-bits={bitwidth}']
else: