# Re: \[PATCH\] sched: Optimize \_\_calc\_delta.

- List: linux-toolchains
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-toolchains/2021/03/6286508/t

## Re: \[PATCH\] sched: Optimize \_\_calc\_delta.

- From: Peter Zijlstra \<peterz@infradead.org\>
- Date: 2021-03-03 14:33:16 
- Message: https://ratatoskr.run/linux-toolchains/2021/03/6286508.md

```text
On Tue, Mar 02, 2021 at 12:57:37PM -0800, Josh Don wrote:
> On gcc, the asm versions of `fls` are about the same speed as the
> builtin. On clang, the versions that use fls (fls,fls64) are more than
> twice as slow as the builtin. This is because the way the `fls` function
> is written, clang puts the value in memory:
> https://godbolt.org/z/EfMbYe. This can be fixed in a separate patch.

Is this because clang gets the asm constraints wrong? ISTR that
happening before, surely the right thing is to fix clang?
```

## Re: \[PATCH\] sched: Optimize \_\_calc\_delta.

- From: Josh Don \<hidden\>
- Date: 2021-03-04 00:12:14 
- Message: https://ratatoskr.run/linux-toolchains/2021/03/6287451.md

```text
On Wed, Mar 3, 2021 at 2:02 AM Peter Zijlstra [ref] wrote:
>
> On Tue, Mar 02, 2021 at 12:57:37PM -0800, Josh Don wrote:
> > On gcc, the asm versions of `fls` are about the same speed as the
> > builtin. On clang, the versions that use fls (fls,fls64) are more than
> > twice as slow as the builtin. This is because the way the `fls` function
> > is written, clang puts the value in memory:
> > https://godbolt.org/z/EfMbYe. This can be fixed in a separate patch.
>
> Is this because clang gets the asm constraints wrong? ISTR that
> happening before, surely the right thing is to fix clang?

https://bugs.llvm.org/show_bug.cgi?id=49406 filed
```
