Lines Matching refs:f

44     return f'0x{poly:0{2*num_bits//8}x}'
52 … print(f'\t\t{fmt_poly(variant, mults[i]["val"], 64)},\t/* {terms[i]}: {mults[i]["desc"]} */')
56 terms = [f'x^{i}' for i in reversed(range(poly.bit_length()))
71 s = f'{"least" if variant.lsb else "most"}-significant-bit-first CRC-{variant.bits}'
72 print(f' * {what} generated for {s} using')
82 self.name = f'crc{bits}_{bit_order}_0x{generator_poly:0{(2*bits+7)//8}x}'
92 print_header(v, f'Slice-by-{n} CRC table')
93 print(f'static const u{v.bits} __maybe_unused {v.name}_table[{256*n}] = {{')
101 print(f'\t{s}')
105 print(f'\t{s}')
109 print(f'\t.{name} = {fmt_poly(v, val, bits_per_long)}, /* {desc} */')
116 reduce(1 << pow_of_x, G), f'x^{pow_of_x} mod G')
119 reduce(1 << pow_of_x, G), f'x^{pow_of_x} mod G')
123 div(1 << pow_of_x, G), f'floor(x^{pow_of_x} / G)')
126 desc = f'G - x^{n}'
129 desc = f'({desc}) * x^{bits_per_long - n}'
145 print(f'static const struct crc_clmul_consts {v.name}_consts __maybe_unused = {{')
151 print(f'static const struct crc_clmul_consts {v.name}_consts __maybe_unused = {{')
172 print(f'\tu64 fold_across_{i}_bits_consts[2];')
175 print(f'}} {v.name}_consts ____cacheline_aligned __maybe_unused = {{')
183 print(f'\t.fold_across_{i}_bits_consts = {{')
213 'desc': f'(x^{pow_of_x} mod G) * x^{64-n}' })
220 print('\t\t' + ''.join(f'{i:2}, ' for i in range(16)).rstrip())
229 desc = f'floor(x^{63+n} / G)'
232 desc = f'({desc} * x) - x^64'
236 desc = f'G - x^{n}'
240 desc = f'({desc} - x^0) / x'
244 desc = f'({desc}) * x^{pow_of_x}'
266 …sys.stderr.write(f'Usage: {sys.argv[0]} CONSTS_TYPE[,CONSTS_TYPE]... CRC_VARIANT[,CRC_VARIANT]...\…
277 print(f' *\t{sys.argv[0]} {" ".join(sys.argv[1:])}')
291 raise ValueError(f'Unknown consts_type: {consts_type}')