浮点数据转换指令包括不同的浮点精度数之间的转换,还包括整型和浮点数之间的转化。
在了解数据转换指令前,必须学习 IEEE 754 定义的五种舍入规则。前两条规则舍入到最接近的值,其他的称为定向舍入:
舍入到最接近的值
-
Round to nearest, ties to even – rounds to the nearest value; if the number falls midway, it is rounded to the nearest value with an even least significant digit.(四舍五入到最接近的值;如果数字落在中间,则会四舍五入到最接近的具有偶数最低有效数字的值)
-
Round to nearest, ties away from zero (or ties to away) – rounds to the nearest value; if the number falls midway, it is rounded to the nearest value above (for positive numbers) or below (for negative numbers).(舍入到最接近的值;如果数字落在中间,则四舍五入到上方(对于正数)或下方(对于负数)最接近的值)
定向舍入文章来源:https://www.toymoban.com/news/detail-782496.html
-
Round toward 0 – directed rounding towards zero (also known as truncation).(向零定向舍入(也称为截断))文章来源地址https://www.toymoban.com/news/detail-782496.html
到了这里,关于【ARMv8 SIMD和浮点指令编程】浮点数据转换指令——数据类型互转必备的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!