int cost = 0;
int size = GET_MODE_SIZE (mode);
- if (TARGET_POWERPC64)
- {
- if (size == 16)
- {
- /* Handle moving 128-bit values from GPRs to VSX point registers on
- ISA 2.07 (power8, power9) when running in 64-bit mode using
- XXPERMDI to glue the two 64-bit values back together. */
- if (to_type == VSX_REG_TYPE && from_type == GPR_REG_TYPE)
- {
- cost = 3; /* 2 mtvsrd's, 1 xxpermdi. */
- icode = reg_addr[mode].reload_vsx_gpr;
- }
-
- /* Handle moving 128-bit values from VSX point registers to GPRs on
- ISA 2.07 when running in 64-bit mode using XXPERMDI to get access to the
- bottom 64-bit value. */
- else if (to_type == GPR_REG_TYPE && from_type == VSX_REG_TYPE)
- {
- cost = 3; /* 2 mfvsrd's, 1 xxpermdi. */
- icode = reg_addr[mode].reload_gpr_vsx;
- }
- }
-
- else if (mode == SFmode)
- {
- if (to_type == GPR_REG_TYPE && from_type == VSX_REG_TYPE)
- {
- cost = 3; /* xscvdpspn, mfvsrd, and. */
- icode = reg_addr[mode].reload_gpr_vsx;
- }
-
- else if (to_type == VSX_REG_TYPE && from_type == GPR_REG_TYPE)
- {
- cost = 2; /* mtvsrz, xscvspdpn. */
- icode = reg_addr[mode].reload_vsx_gpr;
- }
- }
- }
-
if (TARGET_POWERPC64 && size == 16)
{
/* Handle moving 128-bit values from GPRs to VSX point registers on
- ISA 2.07 when running in 64-bit mode using XXPERMDI to glue the two
- 64-bit values back together. */
+ ISA 2.07 (power8, power9) when running in 64-bit mode using
+ XXPERMDI to glue the two 64-bit values back together. */
if (to_type == VSX_REG_TYPE && from_type == GPR_REG_TYPE)
{
cost = 3; /* 2 mtvsrd's, 1 xxpermdi. */
}
}
+ else if (TARGET_POWERPC64 && mode == SFmode)
+ {
+ if (to_type == GPR_REG_TYPE && from_type == VSX_REG_TYPE)
+ {
+ cost = 3; /* xscvdpspn, mfvsrd, and. */
+ icode = reg_addr[mode].reload_gpr_vsx;
+ }
+
+ else if (to_type == VSX_REG_TYPE && from_type == GPR_REG_TYPE)
+ {
+ cost = 2; /* mtvsrz, xscvspdpn. */
+ icode = reg_addr[mode].reload_vsx_gpr;
+ }
+ }
+
else if (!TARGET_POWERPC64 && size == 8)
{
/* Handle moving 64-bit values from GPRs to floating point registers on