Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-20 Thread Georg-Johann Lay
Richard Henderson schrieb: > On 06/20/2011 07:20 AM, Georg-Johann Lay wrote: >> A libcall could be added in TARGET_INIT_LIBCALLS, so a new hook is not >> needed. All that's needed is that optabs tests for presence of such >> an entry and prefers it over inline expansion (and prefers insn over >> l

Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-20 Thread Richard Henderson
On 06/20/2011 07:20 AM, Georg-Johann Lay wrote: > A libcall could be added in TARGET_INIT_LIBCALLS, so a new hook is not > needed. All that's needed is that optabs tests for presence of such > an entry and prefers it over inline expansion (and prefers insn over > libcall). It appears that + and -

Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-20 Thread Georg-Johann Lay
Joseph S. Myers schrieb: > On Fri, 17 Jun 2011, Georg-Johann Lay wrote: > >> So here is my question: Would it be big deal to teach optabs to >> expand plus:di, minus:di as libcall? Maybe even compare is >> feasible? Like so: > > I don't know what the best approach would be, but for just about >

Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-20 Thread Joseph S. Myers
On Fri, 17 Jun 2011, Georg-Johann Lay wrote: > So here is my question: Would it be big deal to teach optabs to expand > plus:di, minus:di as libcall? Maybe even compare is feasible? Like so: I don't know what the best approach would be, but for just about any operation supported by GCC it makes

Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-17 Thread Georg-Johann Lay
Georg-Johann Lay schrieb: > To come back to the original topic, here is a tentative patch for > better popcount and parity: > > * config/avr/t-avr (LIB1ASMFUNCS): Rename _loop_ffsqi2 to > _ffsqi2_nz. > * confif/avr/libgcc.S: Ditto. Rename __loop_ffsqi2 to __ffsqi2_nz. > (_

Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-17 Thread Georg-Johann Lay
Joseph S. Myers schrieb: > On Fri, 17 Jun 2011, Georg-Johann Lay wrote: > >> I don't see what's bat with the patch, it's straight forward. > > C is a high-level language, defined in terms of high-level > semantics rather than machine instructions. C code should be > written where possible using

Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-17 Thread Joseph S. Myers
On Fri, 17 Jun 2011, Georg-Johann Lay wrote: > I don't see what's bat with the patch, it's straight forward. C is a high-level language, defined in terms of high-level semantics rather than machine instructions. C code should be written where possible using machine-independent functionality, f

Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-17 Thread Georg-Johann Lay
Joseph S. Myers schrieb: > On Thu, 16 Jun 2011, Georg-Johann Lay wrote: > >> The recent implementation of some asm function in libgcc added >> __popcountqi2 and __parityqi2. This patch makes these functions >> available as __builtin_avr_popcount8 resp. __builtin_avr_parity8. >> >> Moreover, just o

Re: [Patch, AVR]: QI builtins for parity, popcount, 1<< n

2011-06-16 Thread Joseph S. Myers
On Thu, 16 Jun 2011, Georg-Johann Lay wrote: > The recent implementation of some asm function in libgcc added > __popcountqi2 and __parityqi2. This patch makes these functions > available as __builtin_avr_popcount8 resp. __builtin_avr_parity8. > > Moreover, just out of a mood, I wrote a builtin f