This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 3/3] Add ffsl(), ffsll(), fls(), flsl(), flsll()


Btw, it's my working tree if you are interested

https://github.com/kito-cheng/riscv-newlib/tree/riscv-newlib-submission-v1

On Thu, Jul 27, 2017 at 2:37 PM, Kito Cheng <kito.cheng@gmail.com> wrote:
>> Do you have plans to add RISC-V support to upstream Newlib?
> Yes, I plan submit patches in next few weeks and I am doing testing
> now, we have already porting to newlib 2.5[1].
>
>> We should first investigate why GCC performs this optimization. The file is compiled with -fno-builtin, so it some other optimization. Maybe we need something like __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns"))) as in string/local.h.
>
> -fno-builtin just mean do not emit any builtin function in front-end,
> but we've explicit call builtin function here, so -fno-builtin doesn't
> any help for this case.
>
> However I think I could add a local ffs.c in libc/machine/riscv to
> avoid this issue since I've saw it's really improve the code gen for
> some target which have ffs or ctz instructions,
> but the potential problem is maybe some target will hit this issue too.
>
> [1] https://github.com/riscv/riscv-newlib


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]