target/arm: Implement FCVT (scalar, integer) for fp16

Backports commit 564a0632504fad840491aa9a59453f4e64a316c4 from qemu
This commit is contained in:
Richard Henderson 2018-05-15 22:02:17 -04:00 committed by Lioncash
parent 75643ab1cf
commit 8436080518
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
17 changed files with 178 additions and 18 deletions

View file

@ -1696,6 +1696,7 @@
#define helper_vfp_sqrtd helper_vfp_sqrtd_aarch64
#define helper_vfp_sqrts helper_vfp_sqrts_aarch64
#define helper_vfp_sqtod helper_vfp_sqtod_aarch64
#define helper_vfp_sqtoh helper_vfp_sqtoh_aarch64
#define helper_vfp_sqtos helper_vfp_sqtos_aarch64
#define helper_vfp_subd helper_vfp_subd_aarch64
#define helper_vfp_subs helper_vfp_subs_aarch64
@ -1716,6 +1717,7 @@
#define helper_vfp_tosls helper_vfp_tosls_aarch64
#define helper_vfp_tosls_round_to_zero helper_vfp_tosls_round_to_zero_aarch64
#define helper_vfp_tosqd helper_vfp_tosqd_aarch64
#define helper_vfp_tosqh helper_vfp_tosqh_aarch64
#define helper_vfp_tosqs helper_vfp_tosqs_aarch64
#define helper_vfp_touhd helper_vfp_touhd_aarch64
#define helper_vfp_touhd_round_to_zero helper_vfp_touhd_round_to_zero_aarch64
@ -1734,6 +1736,7 @@
#define helper_vfp_touls helper_vfp_touls_aarch64
#define helper_vfp_touls_round_to_zero helper_vfp_touls_round_to_zero_aarch64
#define helper_vfp_touqd helper_vfp_touqd_aarch64
#define helper_vfp_touqh helper_vfp_touqh_aarch64
#define helper_vfp_touqs helper_vfp_touqs_aarch64
#define helper_vfp_uhtod helper_vfp_uhtod_aarch64
#define helper_vfp_uhtos helper_vfp_uhtos_aarch64
@ -1744,6 +1747,7 @@
#define helper_vfp_ultoh helper_vfp_ultoh_aarch64
#define helper_vfp_ultos helper_vfp_ultos_aarch64
#define helper_vfp_uqtod helper_vfp_uqtod_aarch64
#define helper_vfp_uqtoh helper_vfp_uqtoh_aarch64
#define helper_vfp_uqtos helper_vfp_uqtos_aarch64
#define helper_wfe helper_wfe_aarch64
#define helper_wfi helper_wfi_aarch64

View file

@ -1696,6 +1696,7 @@
#define helper_vfp_sqrtd helper_vfp_sqrtd_aarch64eb
#define helper_vfp_sqrts helper_vfp_sqrts_aarch64eb
#define helper_vfp_sqtod helper_vfp_sqtod_aarch64eb
#define helper_vfp_sqtoh helper_vfp_sqtoh_aarch64eb
#define helper_vfp_sqtos helper_vfp_sqtos_aarch64eb
#define helper_vfp_subd helper_vfp_subd_aarch64eb
#define helper_vfp_subs helper_vfp_subs_aarch64eb
@ -1716,6 +1717,7 @@
#define helper_vfp_tosls helper_vfp_tosls_aarch64eb
#define helper_vfp_tosls_round_to_zero helper_vfp_tosls_round_to_zero_aarch64eb
#define helper_vfp_tosqd helper_vfp_tosqd_aarch64eb
#define helper_vfp_tosqh helper_vfp_tosqh_aarch64eb
#define helper_vfp_tosqs helper_vfp_tosqs_aarch64eb
#define helper_vfp_touhd helper_vfp_touhd_aarch64eb
#define helper_vfp_touhd_round_to_zero helper_vfp_touhd_round_to_zero_aarch64eb
@ -1734,6 +1736,7 @@
#define helper_vfp_touls helper_vfp_touls_aarch64eb
#define helper_vfp_touls_round_to_zero helper_vfp_touls_round_to_zero_aarch64eb
#define helper_vfp_touqd helper_vfp_touqd_aarch64eb
#define helper_vfp_touqh helper_vfp_touqh_aarch64eb
#define helper_vfp_touqs helper_vfp_touqs_aarch64eb
#define helper_vfp_uhtod helper_vfp_uhtod_aarch64eb
#define helper_vfp_uhtos helper_vfp_uhtos_aarch64eb
@ -1744,6 +1747,7 @@
#define helper_vfp_ultoh helper_vfp_ultoh_aarch64eb
#define helper_vfp_ultos helper_vfp_ultos_aarch64eb
#define helper_vfp_uqtod helper_vfp_uqtod_aarch64eb
#define helper_vfp_uqtoh helper_vfp_uqtoh_aarch64eb
#define helper_vfp_uqtos helper_vfp_uqtos_aarch64eb
#define helper_wfe helper_wfe_aarch64eb
#define helper_wfi helper_wfi_aarch64eb

View file

@ -1696,6 +1696,7 @@
#define helper_vfp_sqrtd helper_vfp_sqrtd_arm
#define helper_vfp_sqrts helper_vfp_sqrts_arm
#define helper_vfp_sqtod helper_vfp_sqtod_arm
#define helper_vfp_sqtoh helper_vfp_sqtoh_arm
#define helper_vfp_sqtos helper_vfp_sqtos_arm
#define helper_vfp_subd helper_vfp_subd_arm
#define helper_vfp_subs helper_vfp_subs_arm
@ -1716,6 +1717,7 @@
#define helper_vfp_tosls helper_vfp_tosls_arm
#define helper_vfp_tosls_round_to_zero helper_vfp_tosls_round_to_zero_arm
#define helper_vfp_tosqd helper_vfp_tosqd_arm
#define helper_vfp_tosqh helper_vfp_tosqh_arm
#define helper_vfp_tosqs helper_vfp_tosqs_arm
#define helper_vfp_touhd helper_vfp_touhd_arm
#define helper_vfp_touhd_round_to_zero helper_vfp_touhd_round_to_zero_arm
@ -1734,6 +1736,7 @@
#define helper_vfp_touls helper_vfp_touls_arm
#define helper_vfp_touls_round_to_zero helper_vfp_touls_round_to_zero_arm
#define helper_vfp_touqd helper_vfp_touqd_arm
#define helper_vfp_touqh helper_vfp_touqh_arm
#define helper_vfp_touqs helper_vfp_touqs_arm
#define helper_vfp_uhtod helper_vfp_uhtod_arm
#define helper_vfp_uhtos helper_vfp_uhtos_arm
@ -1744,6 +1747,7 @@
#define helper_vfp_ultoh helper_vfp_ultoh_arm
#define helper_vfp_ultos helper_vfp_ultos_arm
#define helper_vfp_uqtod helper_vfp_uqtod_arm
#define helper_vfp_uqtoh helper_vfp_uqtoh_arm
#define helper_vfp_uqtos helper_vfp_uqtos_arm
#define helper_wfe helper_wfe_arm
#define helper_wfi helper_wfi_arm

View file

@ -1696,6 +1696,7 @@
#define helper_vfp_sqrtd helper_vfp_sqrtd_armeb
#define helper_vfp_sqrts helper_vfp_sqrts_armeb
#define helper_vfp_sqtod helper_vfp_sqtod_armeb
#define helper_vfp_sqtoh helper_vfp_sqtoh_armeb
#define helper_vfp_sqtos helper_vfp_sqtos_armeb
#define helper_vfp_subd helper_vfp_subd_armeb
#define helper_vfp_subs helper_vfp_subs_armeb
@ -1716,6 +1717,7 @@
#define helper_vfp_tosls helper_vfp_tosls_armeb
#define helper_vfp_tosls_round_to_zero helper_vfp_tosls_round_to_zero_armeb
#define helper_vfp_tosqd helper_vfp_tosqd_armeb
#define helper_vfp_tosqh helper_vfp_tosqh_armeb
#define helper_vfp_tosqs helper_vfp_tosqs_armeb
#define helper_vfp_touhd helper_vfp_touhd_armeb
#define helper_vfp_touhd_round_to_zero helper_vfp_touhd_round_to_zero_armeb
@ -1734,6 +1736,7 @@
#define helper_vfp_touls helper_vfp_touls_armeb
#define helper_vfp_touls_round_to_zero helper_vfp_touls_round_to_zero_armeb
#define helper_vfp_touqd helper_vfp_touqd_armeb
#define helper_vfp_touqh helper_vfp_touqh_armeb
#define helper_vfp_touqs helper_vfp_touqs_armeb
#define helper_vfp_uhtod helper_vfp_uhtod_armeb
#define helper_vfp_uhtos helper_vfp_uhtos_armeb
@ -1744,6 +1747,7 @@
#define helper_vfp_ultoh helper_vfp_ultoh_armeb
#define helper_vfp_ultos helper_vfp_ultos_armeb
#define helper_vfp_uqtod helper_vfp_uqtod_armeb
#define helper_vfp_uqtoh helper_vfp_uqtoh_armeb
#define helper_vfp_uqtos helper_vfp_uqtos_armeb
#define helper_wfe helper_wfe_armeb
#define helper_wfi helper_wfi_armeb

View file

@ -1702,6 +1702,7 @@ symbols = (
'helper_vfp_sqrtd',
'helper_vfp_sqrts',
'helper_vfp_sqtod',
'helper_vfp_sqtoh',
'helper_vfp_sqtos',
'helper_vfp_subd',
'helper_vfp_subs',
@ -1722,6 +1723,7 @@ symbols = (
'helper_vfp_tosls',
'helper_vfp_tosls_round_to_zero',
'helper_vfp_tosqd',
'helper_vfp_tosqh',
'helper_vfp_tosqs',
'helper_vfp_touhd',
'helper_vfp_touhd_round_to_zero',
@ -1740,6 +1742,7 @@ symbols = (
'helper_vfp_touls',
'helper_vfp_touls_round_to_zero',
'helper_vfp_touqd',
'helper_vfp_touqh',
'helper_vfp_touqs',
'helper_vfp_uhtod',
'helper_vfp_uhtos',
@ -1750,6 +1753,7 @@ symbols = (
'helper_vfp_ultoh',
'helper_vfp_ultos',
'helper_vfp_uqtod',
'helper_vfp_uqtoh',
'helper_vfp_uqtos',
'helper_wfe',
'helper_wfi',

View file

@ -1696,6 +1696,7 @@
#define helper_vfp_sqrtd helper_vfp_sqrtd_m68k
#define helper_vfp_sqrts helper_vfp_sqrts_m68k
#define helper_vfp_sqtod helper_vfp_sqtod_m68k
#define helper_vfp_sqtoh helper_vfp_sqtoh_m68k
#define helper_vfp_sqtos helper_vfp_sqtos_m68k
#define helper_vfp_subd helper_vfp_subd_m68k
#define helper_vfp_subs helper_vfp_subs_m68k
@ -1716,6 +1717,7 @@
#define helper_vfp_tosls helper_vfp_tosls_m68k
#define helper_vfp_tosls_round_to_zero helper_vfp_tosls_round_to_zero_m68k
#define helper_vfp_tosqd helper_vfp_tosqd_m68k
#define helper_vfp_tosqh helper_vfp_tosqh_m68k
#define helper_vfp_tosqs helper_vfp_tosqs_m68k
#define helper_vfp_touhd helper_vfp_touhd_m68k
#define helper_vfp_touhd_round_to_zero helper_vfp_touhd_round_to_zero_m68k
@ -1734,6 +1736,7 @@
#define helper_vfp_touls helper_vfp_touls_m68k
#define helper_vfp_touls_round_to_zero helper_vfp_touls_round_to_zero_m68k
#define helper_vfp_touqd helper_vfp_touqd_m68k
#define helper_vfp_touqh helper_vfp_touqh_m68k
#define helper_vfp_touqs helper_vfp_touqs_m68k
#define helper_vfp_uhtod helper_vfp_uhtod_m68k
#define helper_vfp_uhtos helper_vfp_uhtos_m68k
@ -1744,6 +1747,7 @@
#define helper_vfp_ultoh helper_vfp_ultoh_m68k
#define helper_vfp_ultos helper_vfp_ultos_m68k
#define helper_vfp_uqtod helper_vfp_uqtod_m68k
#define helper_vfp_uqtoh helper_vfp_uqtoh_m68k
#define helper_vfp_uqtos helper_vfp_uqtos_m68k
#define helper_wfe helper_wfe_m68k
#define helper_wfi helper_wfi_m68k

View file

@ -1696,6 +1696,7 @@
#define helper_vfp_sqrtd helper_vfp_sqrtd_mips
#define helper_vfp_sqrts helper_vfp_sqrts_mips
#define helper_vfp_sqtod helper_vfp_sqtod_mips
#define helper_vfp_sqtoh helper_vfp_sqtoh_mips
#define helper_vfp_sqtos helper_vfp_sqtos_mips
#define helper_vfp_subd helper_vfp_subd_mips
#define helper_vfp_subs helper_vfp_subs_mips
@ -1716,6 +1717,7 @@
#define helper_vfp_tosls helper_vfp_tosls_mips
#define helper_vfp_tosls_round_to_zero helper_vfp_tosls_round_to_zero_mips
#define helper_vfp_tosqd helper_vfp_tosqd_mips
#define helper_vfp_tosqh helper_vfp_tosqh_mips
#define helper_vfp_tosqs helper_vfp_tosqs_mips
#define helper_vfp_touhd helper_vfp_touhd_mips
#define helper_vfp_touhd_round_to_zero helper_vfp_touhd_round_to_zero_mips
@ -1734,6 +1736,7 @@
#define helper_vfp_touls helper_vfp_touls_mips
#define helper_vfp_touls_round_to_zero helper_vfp_touls_round_to_zero_mips
#define helper_vfp_touqd helper_vfp_touqd_mips
#define helper_vfp_touqh helper_vfp_touqh_mips
#define helper_vfp_touqs helper_vfp_touqs_mips
#define helper_vfp_uhtod helper_vfp_uhtod_mips
#define helper_vfp_uhtos helper_vfp_uhtos_mips
@ -1744,6 +1747,7 @@
#define helper_vfp_ultoh helper_vfp_ultoh_mips
#define helper_vfp_ultos helper_vfp_ultos_mips
#define helper_vfp_uqtod helper_vfp_uqtod_mips
#define helper_vfp_uqtoh helper_vfp_uqtoh_mips
#define helper_vfp_uqtos helper_vfp_uqtos_mips
#define helper_wfe helper_wfe_mips
#define helper_wfi helper_wfi_mips

View file

@ -1696,6 +1696,7 @@
#define helper_vfp_sqrtd helper_vfp_sqrtd_mips64
#define helper_vfp_sqrts helper_vfp_sqrts_mips64
#define helper_vfp_sqtod helper_vfp_sqtod_mips64
#define helper_vfp_sqtoh helper_vfp_sqtoh_mips64
#define helper_vfp_sqtos helper_vfp_sqtos_mips64
#define helper_vfp_subd helper_vfp_subd_mips64
#define helper_vfp_subs helper_vfp_subs_mips64
@ -1716,6 +1717,7 @@
#define helper_vfp_tosls helper_vfp_tosls_mips64
#define helper_vfp_tosls_round_to_zero helper_vfp_tosls_round_to_zero_mips64
#define helper_vfp_tosqd helper_vfp_tosqd_mips64
#define helper_vfp_tosqh helper_vfp_tosqh_mips64
#define helper_vfp_tosqs helper_vfp_tosqs_mips64
#define helper_vfp_touhd helper_vfp_touhd_mips64
#define helper_vfp_touhd_round_to_zero helper_vfp_touhd_round_to_zero_mips64
@ -1734,6 +1736,7 @@
#define helper_vfp_touls helper_vfp_touls_mips64
#define helper_vfp_touls_round_to_zero helper_vfp_touls_round_to_zero_mips64
#define helper_vfp_touqd helper_vfp_touqd_mips64
#define helper_vfp_touqh helper_vfp_touqh_mips64
#define helper_vfp_touqs helper_vfp_touqs_mips64
#define helper_vfp_uhtod helper_vfp_uhtod_mips64
#define helper_vfp_uhtos helper_vfp_uhtos_mips64
@ -1744,6 +1747,7 @@
#define helper_vfp_ultoh helper_vfp_ultoh_mips64
#define helper_vfp_ultos helper_vfp_ultos_mips64
#define helper_vfp_uqtod helper_vfp_uqtod_mips64
#define helper_vfp_uqtoh helper_vfp_uqtoh_mips64
#define helper_vfp_uqtos helper_vfp_uqtos_mips64
#define helper_wfe helper_wfe_mips64
#define helper_wfi helper_wfi_mips64

View file

@ -1696,6 +1696,7 @@
#define helper_vfp_sqrtd helper_vfp_sqrtd_mips64el
#define helper_vfp_sqrts helper_vfp_sqrts_mips64el
#define helper_vfp_sqtod helper_vfp_sqtod_mips64el
#define helper_vfp_sqtoh helper_vfp_sqtoh_mips64el
#define helper_vfp_sqtos helper_vfp_sqtos_mips64el
#define helper_vfp_subd helper_vfp_subd_mips64el
#define helper_vfp_subs helper_vfp_subs_mips64el
@ -1716,6 +1717,7 @@
#define helper_vfp_tosls helper_vfp_tosls_mips64el
#define helper_vfp_tosls_round_to_zero helper_vfp_tosls_round_to_zero_mips64el
#define helper_vfp_tosqd helper_vfp_tosqd_mips64el
#define helper_vfp_tosqh helper_vfp_tosqh_mips64el
#define helper_vfp_tosqs helper_vfp_tosqs_mips64el
#define helper_vfp_touhd helper_vfp_touhd_mips64el
#define helper_vfp_touhd_round_to_zero helper_vfp_touhd_round_to_zero_mips64el
@ -1734,6 +1736,7 @@
#define helper_vfp_touls helper_vfp_touls_mips64el
#define helper_vfp_touls_round_to_zero helper_vfp_touls_round_to_zero_mips64el
#define helper_vfp_touqd helper_vfp_touqd_mips64el
#define helper_vfp_touqh helper_vfp_touqh_mips64el
#define helper_vfp_touqs helper_vfp_touqs_mips64el
#define helper_vfp_uhtod helper_vfp_uhtod_mips64el
#define helper_vfp_uhtos helper_vfp_uhtos_mips64el
@ -1744,6 +1747,7 @@
#define helper_vfp_ultoh helper_vfp_ultoh_mips64el
#define helper_vfp_ultos helper_vfp_ultos_mips64el
#define helper_vfp_uqtod helper_vfp_uqtod_mips64el
#define helper_vfp_uqtoh helper_vfp_uqtoh_mips64el
#define helper_vfp_uqtos helper_vfp_uqtos_mips64el
#define helper_wfe helper_wfe_mips64el
#define helper_wfi helper_wfi_mips64el

View file

@ -1696,6 +1696,7 @@
#define helper_vfp_sqrtd helper_vfp_sqrtd_mipsel
#define helper_vfp_sqrts helper_vfp_sqrts_mipsel
#define helper_vfp_sqtod helper_vfp_sqtod_mipsel
#define helper_vfp_sqtoh helper_vfp_sqtoh_mipsel
#define helper_vfp_sqtos helper_vfp_sqtos_mipsel
#define helper_vfp_subd helper_vfp_subd_mipsel
#define helper_vfp_subs helper_vfp_subs_mipsel
@ -1716,6 +1717,7 @@
#define helper_vfp_tosls helper_vfp_tosls_mipsel
#define helper_vfp_tosls_round_to_zero helper_vfp_tosls_round_to_zero_mipsel
#define helper_vfp_tosqd helper_vfp_tosqd_mipsel
#define helper_vfp_tosqh helper_vfp_tosqh_mipsel
#define helper_vfp_tosqs helper_vfp_tosqs_mipsel
#define helper_vfp_touhd helper_vfp_touhd_mipsel
#define helper_vfp_touhd_round_to_zero helper_vfp_touhd_round_to_zero_mipsel
@ -1734,6 +1736,7 @@
#define helper_vfp_touls helper_vfp_touls_mipsel
#define helper_vfp_touls_round_to_zero helper_vfp_touls_round_to_zero_mipsel
#define helper_vfp_touqd helper_vfp_touqd_mipsel
#define helper_vfp_touqh helper_vfp_touqh_mipsel
#define helper_vfp_touqs helper_vfp_touqs_mipsel
#define helper_vfp_uhtod helper_vfp_uhtod_mipsel
#define helper_vfp_uhtos helper_vfp_uhtos_mipsel
@ -1744,6 +1747,7 @@
#define helper_vfp_ultoh helper_vfp_ultoh_mipsel
#define helper_vfp_ultos helper_vfp_ultos_mipsel
#define helper_vfp_uqtod helper_vfp_uqtod_mipsel
#define helper_vfp_uqtoh helper_vfp_uqtoh_mipsel
#define helper_vfp_uqtos helper_vfp_uqtos_mipsel
#define helper_wfe helper_wfe_mipsel
#define helper_wfi helper_wfi_mipsel

View file

@ -1696,6 +1696,7 @@
#define helper_vfp_sqrtd helper_vfp_sqrtd_powerpc
#define helper_vfp_sqrts helper_vfp_sqrts_powerpc
#define helper_vfp_sqtod helper_vfp_sqtod_powerpc
#define helper_vfp_sqtoh helper_vfp_sqtoh_powerpc
#define helper_vfp_sqtos helper_vfp_sqtos_powerpc
#define helper_vfp_subd helper_vfp_subd_powerpc
#define helper_vfp_subs helper_vfp_subs_powerpc
@ -1716,6 +1717,7 @@
#define helper_vfp_tosls helper_vfp_tosls_powerpc
#define helper_vfp_tosls_round_to_zero helper_vfp_tosls_round_to_zero_powerpc
#define helper_vfp_tosqd helper_vfp_tosqd_powerpc
#define helper_vfp_tosqh helper_vfp_tosqh_powerpc
#define helper_vfp_tosqs helper_vfp_tosqs_powerpc
#define helper_vfp_touhd helper_vfp_touhd_powerpc
#define helper_vfp_touhd_round_to_zero helper_vfp_touhd_round_to_zero_powerpc
@ -1734,6 +1736,7 @@
#define helper_vfp_touls helper_vfp_touls_powerpc
#define helper_vfp_touls_round_to_zero helper_vfp_touls_round_to_zero_powerpc
#define helper_vfp_touqd helper_vfp_touqd_powerpc
#define helper_vfp_touqh helper_vfp_touqh_powerpc
#define helper_vfp_touqs helper_vfp_touqs_powerpc
#define helper_vfp_uhtod helper_vfp_uhtod_powerpc
#define helper_vfp_uhtos helper_vfp_uhtos_powerpc
@ -1744,6 +1747,7 @@
#define helper_vfp_ultoh helper_vfp_ultoh_powerpc
#define helper_vfp_ultos helper_vfp_ultos_powerpc
#define helper_vfp_uqtod helper_vfp_uqtod_powerpc
#define helper_vfp_uqtoh helper_vfp_uqtoh_powerpc
#define helper_vfp_uqtos helper_vfp_uqtos_powerpc
#define helper_wfe helper_wfe_powerpc
#define helper_wfi helper_wfi_powerpc

View file

@ -1696,6 +1696,7 @@
#define helper_vfp_sqrtd helper_vfp_sqrtd_sparc
#define helper_vfp_sqrts helper_vfp_sqrts_sparc
#define helper_vfp_sqtod helper_vfp_sqtod_sparc
#define helper_vfp_sqtoh helper_vfp_sqtoh_sparc
#define helper_vfp_sqtos helper_vfp_sqtos_sparc
#define helper_vfp_subd helper_vfp_subd_sparc
#define helper_vfp_subs helper_vfp_subs_sparc
@ -1716,6 +1717,7 @@
#define helper_vfp_tosls helper_vfp_tosls_sparc
#define helper_vfp_tosls_round_to_zero helper_vfp_tosls_round_to_zero_sparc
#define helper_vfp_tosqd helper_vfp_tosqd_sparc
#define helper_vfp_tosqh helper_vfp_tosqh_sparc
#define helper_vfp_tosqs helper_vfp_tosqs_sparc
#define helper_vfp_touhd helper_vfp_touhd_sparc
#define helper_vfp_touhd_round_to_zero helper_vfp_touhd_round_to_zero_sparc
@ -1734,6 +1736,7 @@
#define helper_vfp_touls helper_vfp_touls_sparc
#define helper_vfp_touls_round_to_zero helper_vfp_touls_round_to_zero_sparc
#define helper_vfp_touqd helper_vfp_touqd_sparc
#define helper_vfp_touqh helper_vfp_touqh_sparc
#define helper_vfp_touqs helper_vfp_touqs_sparc
#define helper_vfp_uhtod helper_vfp_uhtod_sparc
#define helper_vfp_uhtos helper_vfp_uhtos_sparc
@ -1744,6 +1747,7 @@
#define helper_vfp_ultoh helper_vfp_ultoh_sparc
#define helper_vfp_ultos helper_vfp_ultos_sparc
#define helper_vfp_uqtod helper_vfp_uqtod_sparc
#define helper_vfp_uqtoh helper_vfp_uqtoh_sparc
#define helper_vfp_uqtos helper_vfp_uqtos_sparc
#define helper_wfe helper_wfe_sparc
#define helper_wfi helper_wfi_sparc

View file

@ -1696,6 +1696,7 @@
#define helper_vfp_sqrtd helper_vfp_sqrtd_sparc64
#define helper_vfp_sqrts helper_vfp_sqrts_sparc64
#define helper_vfp_sqtod helper_vfp_sqtod_sparc64
#define helper_vfp_sqtoh helper_vfp_sqtoh_sparc64
#define helper_vfp_sqtos helper_vfp_sqtos_sparc64
#define helper_vfp_subd helper_vfp_subd_sparc64
#define helper_vfp_subs helper_vfp_subs_sparc64
@ -1716,6 +1717,7 @@
#define helper_vfp_tosls helper_vfp_tosls_sparc64
#define helper_vfp_tosls_round_to_zero helper_vfp_tosls_round_to_zero_sparc64
#define helper_vfp_tosqd helper_vfp_tosqd_sparc64
#define helper_vfp_tosqh helper_vfp_tosqh_sparc64
#define helper_vfp_tosqs helper_vfp_tosqs_sparc64
#define helper_vfp_touhd helper_vfp_touhd_sparc64
#define helper_vfp_touhd_round_to_zero helper_vfp_touhd_round_to_zero_sparc64
@ -1734,6 +1736,7 @@
#define helper_vfp_touls helper_vfp_touls_sparc64
#define helper_vfp_touls_round_to_zero helper_vfp_touls_round_to_zero_sparc64
#define helper_vfp_touqd helper_vfp_touqd_sparc64
#define helper_vfp_touqh helper_vfp_touqh_sparc64
#define helper_vfp_touqs helper_vfp_touqs_sparc64
#define helper_vfp_uhtod helper_vfp_uhtod_sparc64
#define helper_vfp_uhtos helper_vfp_uhtos_sparc64
@ -1744,6 +1747,7 @@
#define helper_vfp_ultoh helper_vfp_ultoh_sparc64
#define helper_vfp_ultos helper_vfp_ultos_sparc64
#define helper_vfp_uqtod helper_vfp_uqtod_sparc64
#define helper_vfp_uqtoh helper_vfp_uqtoh_sparc64
#define helper_vfp_uqtos helper_vfp_uqtos_sparc64
#define helper_wfe helper_wfe_sparc64
#define helper_wfi helper_wfi_sparc64

View file

@ -10683,8 +10683,12 @@ VFP_CONV_FIX_A64(uq, s, 32, 64, uint64)
#undef VFP_CONV_FIX_A64
/* Conversion to/from f16 can overflow to infinity before/after scaling.
* Therefore we convert to f64 (which does not round), scale,
* and then convert f64 to f16 (which may round).
* Therefore we convert to f64, scale, and then convert f64 to f16; or
* vice versa for conversion to integer.
*
* For 16- and 32-bit integers, the conversion to f64 never rounds.
* For 64-bit integers, any integer that would cause rounding will also
* overflow to f16 infinity, so there is no double rounding problem.
*/
static float16 do_postscale_fp16(float64 f, int shift, float_status *fpst)
@ -10702,6 +10706,16 @@ float16 HELPER(vfp_ultoh)(uint32_t x, uint32_t shift, void *fpst)
return do_postscale_fp16(uint32_to_float64(x, fpst), shift, fpst);
}
float16 HELPER(vfp_sqtoh)(uint64_t x, uint32_t shift, void *fpst)
{
return do_postscale_fp16(int64_to_float64(x, fpst), shift, fpst);
}
float16 HELPER(vfp_uqtoh)(uint64_t x, uint32_t shift, void *fpst)
{
return do_postscale_fp16(uint64_to_float64(x, fpst), shift, fpst);
}
static float64 do_prescale_fp16(float16 f, int shift, float_status *fpst)
{
if (unlikely(float16_is_any_nan(f))) {
@ -10731,6 +10745,26 @@ uint32_t HELPER(vfp_touhh)(float16 x, uint32_t shift, void *fpst)
return float64_to_uint16(do_prescale_fp16(x, shift, fpst), fpst);
}
uint32_t HELPER(vfp_toslh)(float16 x, uint32_t shift, void *fpst)
{
return float64_to_int32(do_prescale_fp16(x, shift, fpst), fpst);
}
uint32_t HELPER(vfp_toulh)(float16 x, uint32_t shift, void *fpst)
{
return float64_to_uint32(do_prescale_fp16(x, shift, fpst), fpst);
}
uint64_t HELPER(vfp_tosqh)(float16 x, uint32_t shift, void *fpst)
{
return float64_to_int64(do_prescale_fp16(x, shift, fpst), fpst);
}
uint64_t HELPER(vfp_touqh)(float16 x, uint32_t shift, void *fpst)
{
return float64_to_uint64(do_prescale_fp16(x, shift, fpst), fpst);
}
/* Set the current fp rounding mode and return the old one.
* The argument is a softfloat float_round_ value.
*/

View file

@ -153,6 +153,10 @@ DEF_HELPER_3(vfp_touhd_round_to_zero, i64, f64, i32, ptr)
DEF_HELPER_3(vfp_tould_round_to_zero, i64, f64, i32, ptr)
DEF_HELPER_3(vfp_touhh, i32, f16, i32, ptr)
DEF_HELPER_3(vfp_toshh, i32, f16, i32, ptr)
DEF_HELPER_3(vfp_toulh, i32, f16, i32, ptr)
DEF_HELPER_3(vfp_toslh, i32, f16, i32, ptr)
DEF_HELPER_3(vfp_touqh, i64, f16, i32, ptr)
DEF_HELPER_3(vfp_tosqh, i64, f16, i32, ptr)
DEF_HELPER_3(vfp_toshs, i32, f32, i32, ptr)
DEF_HELPER_3(vfp_tosls, i32, f32, i32, ptr)
DEF_HELPER_3(vfp_tosqs, i64, f32, i32, ptr)
@ -179,6 +183,8 @@ DEF_HELPER_3(vfp_ultod, f64, i64, i32, ptr)
DEF_HELPER_3(vfp_uqtod, f64, i64, i32, ptr)
DEF_HELPER_3(vfp_sltoh, f16, i32, i32, ptr)
DEF_HELPER_3(vfp_ultoh, f16, i32, i32, ptr)
DEF_HELPER_3(vfp_sqtoh, f16, i64, i32, ptr)
DEF_HELPER_3(vfp_uqtoh, f16, i64, i32, ptr)
DEF_HELPER_FLAGS_2(set_rmode, TCG_CALL_NO_RWG, i32, i32, ptr)
DEF_HELPER_FLAGS_2(set_neon_rmode, TCG_CALL_NO_RWG, i32, i32, env)

View file

@ -5612,11 +5612,11 @@ static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode,
{
TCGContext *tcg_ctx = s->uc->tcg_ctx;
bool is_signed = !(opcode & 1);
bool is_double = type;
TCGv_ptr tcg_fpstatus;
TCGv_i32 tcg_shift;
TCGv_i32 tcg_shift, tcg_single;
TCGv_i64 tcg_double;
tcg_fpstatus = get_fpstatus_ptr(tcg_ctx, false);
tcg_fpstatus = get_fpstatus_ptr(tcg_ctx, type == 3);
tcg_shift = tcg_const_i32(tcg_ctx, 64 - scale);
@ -5634,8 +5634,9 @@ static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode,
tcg_int = tcg_extend;
}
if (is_double) {
TCGv_i64 tcg_double = tcg_temp_new_i64(tcg_ctx);
switch (type) {
case 1: /* float64 */
tcg_double = tcg_temp_new_i64(tcg_ctx);
if (is_signed) {
gen_helper_vfp_sqtod(tcg_ctx, tcg_double, tcg_int,
tcg_shift, tcg_fpstatus);
@ -5645,8 +5646,10 @@ static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode,
}
write_fp_dreg(s, rd, tcg_double);
tcg_temp_free_i64(tcg_ctx, tcg_double);
} else {
TCGv_i32 tcg_single = tcg_temp_new_i32(tcg_ctx);
break;
case 0: /* float32 */
tcg_single = tcg_temp_new_i32(tcg_ctx);
if (is_signed) {
gen_helper_vfp_sqtos(tcg_ctx, tcg_single, tcg_int,
tcg_shift, tcg_fpstatus);
@ -5656,6 +5659,23 @@ static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode,
}
write_fp_sreg(s, rd, tcg_single);
tcg_temp_free_i32(tcg_ctx, tcg_single);
break;
case 3: /* float16 */
tcg_single = tcg_temp_new_i32(tcg_ctx);
if (is_signed) {
gen_helper_vfp_sqtoh(tcg_ctx, tcg_single, tcg_int,
tcg_shift, tcg_fpstatus);
} else {
gen_helper_vfp_uqtoh(tcg_ctx, tcg_single, tcg_int,
tcg_shift, tcg_fpstatus);
}
write_fp_sreg(s, rd, tcg_single);
tcg_temp_free_i32(tcg_ctx, tcg_single);
break;
default:
g_assert_not_reached();
}
} else {
TCGv_i64 tcg_int = cpu_reg(s, rd);
@ -5672,8 +5692,9 @@ static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode,
gen_helper_set_rmode(tcg_ctx, tcg_rmode, tcg_rmode, tcg_fpstatus);
if (is_double) {
TCGv_i64 tcg_double = read_fp_dreg(s, rn);
switch (type) {
case 1: /* float64 */
tcg_double = read_fp_dreg(s, rn);
if (is_signed) {
if (!sf) {
gen_helper_vfp_tosld(tcg_ctx, tcg_int, tcg_double,
@ -5691,9 +5712,14 @@ static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode,
tcg_shift, tcg_fpstatus);
}
}
if (!sf) {
tcg_gen_ext32u_i64(tcg_ctx, tcg_int, tcg_int);
}
tcg_temp_free_i64(tcg_ctx, tcg_double);
} else {
TCGv_i32 tcg_single = read_fp_sreg(s, rn);
break;
case 0: /* float32 */
tcg_single = read_fp_sreg(s, rn);
if (sf) {
if (is_signed) {
gen_helper_vfp_tosqs(tcg_ctx, tcg_int, tcg_single,
@ -5715,14 +5741,39 @@ static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode,
tcg_temp_free_i32(tcg_ctx, tcg_dest);
}
tcg_temp_free_i32(tcg_ctx, tcg_single);
break;
case 3: /* float16 */
tcg_single = read_fp_sreg(s, rn);
if (sf) {
if (is_signed) {
gen_helper_vfp_tosqh(tcg_ctx, tcg_int, tcg_single,
tcg_shift, tcg_fpstatus);
} else {
gen_helper_vfp_touqh(tcg_ctx, tcg_int, tcg_single,
tcg_shift, tcg_fpstatus);
}
} else {
TCGv_i32 tcg_dest = tcg_temp_new_i32(tcg_ctx);
if (is_signed) {
gen_helper_vfp_toslh(tcg_ctx, tcg_dest, tcg_single,
tcg_shift, tcg_fpstatus);
} else {
gen_helper_vfp_toulh(tcg_ctx, tcg_dest, tcg_single,
tcg_shift, tcg_fpstatus);
}
tcg_gen_extu_i32_i64(tcg_ctx, tcg_int, tcg_dest);
tcg_temp_free_i32(tcg_ctx, tcg_dest);
}
tcg_temp_free_i32(tcg_ctx, tcg_single);
break;
default:
g_assert_not_reached();
}
gen_helper_set_rmode(tcg_ctx, tcg_rmode, tcg_rmode, tcg_fpstatus);
tcg_temp_free_i32(tcg_ctx, tcg_rmode);
if (!sf) {
tcg_gen_ext32u_i64(tcg_ctx, tcg_int, tcg_int);
}
}
tcg_temp_free_ptr(tcg_ctx, tcg_fpstatus);
@ -5893,7 +5944,20 @@ static void disas_fp_int_conv(DisasContext *s, uint32_t insn)
/* actual FP conversions */
bool itof = extract32(opcode, 1, 1);
if (type > 1 || (rmode != 0 && opcode > 1)) {
if (rmode != 0 && opcode > 1) {
unallocated_encoding(s);
return;
}
switch (type) {
case 0: /* float32 */
case 1: /* float64 */
break;
case 3: /* float16 */
if (arm_dc_feature(s, ARM_FEATURE_V8_FP16)) {
break;
}
/* fallthru */
default:
unallocated_encoding(s);
return;
}

View file

@ -1696,6 +1696,7 @@
#define helper_vfp_sqrtd helper_vfp_sqrtd_x86_64
#define helper_vfp_sqrts helper_vfp_sqrts_x86_64
#define helper_vfp_sqtod helper_vfp_sqtod_x86_64
#define helper_vfp_sqtoh helper_vfp_sqtoh_x86_64
#define helper_vfp_sqtos helper_vfp_sqtos_x86_64
#define helper_vfp_subd helper_vfp_subd_x86_64
#define helper_vfp_subs helper_vfp_subs_x86_64
@ -1716,6 +1717,7 @@
#define helper_vfp_tosls helper_vfp_tosls_x86_64
#define helper_vfp_tosls_round_to_zero helper_vfp_tosls_round_to_zero_x86_64
#define helper_vfp_tosqd helper_vfp_tosqd_x86_64
#define helper_vfp_tosqh helper_vfp_tosqh_x86_64
#define helper_vfp_tosqs helper_vfp_tosqs_x86_64
#define helper_vfp_touhd helper_vfp_touhd_x86_64
#define helper_vfp_touhd_round_to_zero helper_vfp_touhd_round_to_zero_x86_64
@ -1734,6 +1736,7 @@
#define helper_vfp_touls helper_vfp_touls_x86_64
#define helper_vfp_touls_round_to_zero helper_vfp_touls_round_to_zero_x86_64
#define helper_vfp_touqd helper_vfp_touqd_x86_64
#define helper_vfp_touqh helper_vfp_touqh_x86_64
#define helper_vfp_touqs helper_vfp_touqs_x86_64
#define helper_vfp_uhtod helper_vfp_uhtod_x86_64
#define helper_vfp_uhtos helper_vfp_uhtos_x86_64
@ -1744,6 +1747,7 @@
#define helper_vfp_ultoh helper_vfp_ultoh_x86_64
#define helper_vfp_ultos helper_vfp_ultos_x86_64
#define helper_vfp_uqtod helper_vfp_uqtod_x86_64
#define helper_vfp_uqtoh helper_vfp_uqtoh_x86_64
#define helper_vfp_uqtos helper_vfp_uqtos_x86_64
#define helper_wfe helper_wfe_x86_64
#define helper_wfi helper_wfi_x86_64