Re: RISC-V: Use convert instructions instead of calling library functions

2024-03-20 Thread Palmer Dabbelt
On Wed, 20 Mar 2024 11:54:34 PDT (-0700), Jeff Law wrote: On 3/19/24 10:23 AM, Palmer Dabbelt wrote: On Mon, 18 Mar 2024 20:50:14 PDT (-0700), jeffreya...@gmail.com wrote: On 3/18/24 3:09 AM, Jivan Hakobyan wrote: As RV has round instructions it is reasonable to use them instead of calling

Re: RISC-V: Use convert instructions instead of calling library functions

2024-03-20 Thread Jeff Law
On 3/19/24 10:23 AM, Palmer Dabbelt wrote: On Mon, 18 Mar 2024 20:50:14 PDT (-0700), jeffreya...@gmail.com wrote: On 3/18/24 3:09 AM, Jivan Hakobyan wrote: As RV has round instructions it is reasonable to use them instead of calling the library functions. With my patch for the following C

Re: RISC-V: Use convert instructions instead of calling library functions

2024-03-19 Thread Palmer Dabbelt
On Tue, 19 Mar 2024 12:58:41 PDT (-0700), Andrew Waterman wrote: On Tue, Mar 19, 2024 at 9:23 AM Palmer Dabbelt wrote: On Mon, 18 Mar 2024 20:50:14 PDT (-0700), jeffreya...@gmail.com wrote: > > > On 3/18/24 3:09 AM, Jivan Hakobyan wrote: >> As RV has round instructions it is reasonable to use

Re: RISC-V: Use convert instructions instead of calling library functions

2024-03-19 Thread Andrew Waterman
On Tue, Mar 19, 2024 at 9:23 AM Palmer Dabbelt wrote: > On Mon, 18 Mar 2024 20:50:14 PDT (-0700), jeffreya...@gmail.com wrote: > > > > > > On 3/18/24 3:09 AM, Jivan Hakobyan wrote: > >> As RV has round instructions it is reasonable to use them instead of > >> calling the library functions. > >> >

Re: RISC-V: Use convert instructions instead of calling library functions

2024-03-19 Thread Palmer Dabbelt
On Mon, 18 Mar 2024 20:50:14 PDT (-0700), jeffreya...@gmail.com wrote: On 3/18/24 3:09 AM, Jivan Hakobyan wrote: As RV has round instructions it is reasonable to use them instead of calling the library functions. With my patch for the following C code: double foo(double a) {     return ceil(

Re: RISC-V: Use convert instructions instead of calling library functions

2024-03-18 Thread Jeff Law
On 3/18/24 3:09 AM, Jivan Hakobyan wrote: As RV has round instructions it is reasonable to use them instead of calling the library functions. With my patch for the following C code: double foo(double a) {     return ceil(a); } GCC generates the following ASM code (before it was tail call)