You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 22, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 22, 2021. It is now read-only.
On MIPS architecture (with MSA extension) there is FRINT.df instruction (df is element size 32,64b) with four rounding modes which can be set in MSACSR register (round to nearest, round towards zero (trunc), round towards positive/+inf (ceil), round towards negative/-inf(floor)).
ARM has vector convert float to integer, round towards zero (truncate). That's the most natural operation to implement since it matches C behavior.
I believe there are instructions that use the rounding mode in the FP control register (FPSCR) but setting this register causes FP execution to stall until all instructions in progress complete. Therefore it can be slow. I believe most ISAs work like this.
I'd be concerned that exposing other rounding modes would be slow. There are clever tricks to simulate the other rounding modes efficiently.
Activity
simicicd commentedon Apr 21, 2017
On MIPS architecture (with MSA extension) there is FRINT.df instruction (df is element size 32,64b) with four rounding modes which can be set in MSACSR register (round to nearest, round towards zero (trunc), round towards positive/+inf (ceil), round towards negative/-inf(floor)).
billbudge commentedon Apr 21, 2017
ARM has vector convert float to integer, round towards zero (truncate). That's the most natural operation to implement since it matches C behavior.
I believe there are instructions that use the rounding mode in the FP control register (FPSCR) but setting this register causes FP execution to stall until all instructions in progress complete. Therefore it can be slow. I believe most ISAs work like this.
I'd be concerned that exposing other rounding modes would be slow. There are clever tricks to simulate the other rounding modes efficiently.
ngzhian commentedon Feb 18, 2021
We have these now in #232.