From: lkcl Date: Fri, 4 Jun 2021 10:34:55 +0000 (+0100) Subject: (no commit message) X-Git-Tag: DRAFT_SVP64_0_1~813 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4e39b0203556c53e5bed2bc5de014cfa535516d1;p=libreriscv.git --- diff --git a/openpower/sv/int_fp_mv.mdwn b/openpower/sv/int_fp_mv.mdwn index 571f8cc12..d6bd572d4 100644 --- a/openpower/sv/int_fp_mv.mdwn +++ b/openpower/sv/int_fp_mv.mdwn @@ -47,16 +47,12 @@ The assembly listings in the [[int_fp_mv/appendix]] show how costly some of these language-specific conversions are: Javascript is 35 scalar instructions, including four branches. -# A bit more research into integer - fp conversion - -here is a paragraph which explains that there are different semantics -for conversion, i don't know what the paragraph should say, but it needs -to be here, to give some background. it also acts as a lead-in to the -sub-sections, introducing them and explaining why they are here, as -justifications and background research as to why the ISA should support -the feature being proposed. +## FP -> Integer conversions -*nothing* can be left to chance or guesswork. +Different programming languages turn out to have completely different +semantics for FP to Integer conversion. This section gives an overview +of the different variants, listing the languages and hardware that +implements each variant. ## standard Integer -> FP conversion @@ -64,17 +60,15 @@ This conversion is outlined in the IEEE754 specification. It is used by nearly all programming languages and CPUs. In the case of OpenPOWER, the rounding mode is read from FPSCR -## FP -> Integer conversions - ### standard OpenPower FP -> Integer conversion -TODO, explain this further, make this a complete sentence: -"saturation with NaN converted to minimum valid integer" +This conversion, instead of exact IEEE754 Compliance, performs +"saturation with NaN converted to minimum valid integer". This +is also exactly the same as the x86 ISA conversion senantics. +OpenPOWER however has instructions for both: - - Matches x86's conversion semantics - - Has instructions for both: - * rounding mode read from FPSCR - * rounding mode is always truncate +* rounding mode read from FPSCR +* rounding mode always set to truncate ### Rust FP -> Integer conversion