util: Add a helper for faster remainders
This should be at least as fast as using fast_idiv_by_const, and has the advantage that the precomputation is simple enough to be evaluated at Mesa-compile time for hash tables and sets which have a fixed table of possible divisors. Acked-by: Eric Anholt <eric@anholt.net> Acked-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
@@ -834,6 +834,10 @@ if cc.compiles('int foo(void) __attribute__((__noreturn__));',
|
||||
name : '__attribute__((__noreturn__))')
|
||||
pre_args += '-DHAVE_FUNC_ATTRIBUTE_NORETURN'
|
||||
endif
|
||||
if cc.compiles('__uint128_t foo(void) { return 0; }',
|
||||
name : '__uint128_t')
|
||||
pre_args += '-DHAVE_UINT128'
|
||||
endif
|
||||
|
||||
# TODO: this is very incomplete
|
||||
if ['linux', 'cygwin', 'gnu'].contains(host_machine.system())
|
||||
|
Reference in New Issue
Block a user