On 11/10/2015 03:51 AM, Liang Li wrote:
+__asm__(".type can_use_buffer_find_nonzero_offset, \%gnu_indirect_function"); +__asm__(".type buffer_find_nonzero_offset, \%gnu_indirect_function"); + + +void *can_use_buffer_find_nonzero_offset_ifunc(void) \ + __asm__("can_use_buffer_find_nonzero_offset"); + +void *buffer_find_nonzero_offset_ifunc(void) \ + __asm__("buffer_find_nonzero_offset");
Not keen on this. You can use the ifunc attribute instead of inline asm, and the target attribute to enable per-function use of avx2. And if neither are supported, due to compiler limitations, I don't think you should attempt to work around that.
r~