diff options
Diffstat (limited to 'gcc/config/rs6000/rs6000.c')
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 60 |
1 files changed, 47 insertions, 13 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index e319b26755c..bfc362f1682 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -4190,6 +4190,10 @@ rs6000_option_override_internal (bool global_init_p) { if (rs6000_isa_flags_explicit & OPTION_MASK_P8_FUSION) { + /* We prefer to not mention undocumented options in + error messages. However, if users have managed to select + power9-fusion without selecting power8-fusion, they + already know about undocumented flags. */ error ("-mpower9-fusion requires -mpower8-fusion"); rs6000_isa_flags &= ~OPTION_MASK_P9_FUSION; } @@ -4237,6 +4241,10 @@ rs6000_option_override_internal (bool global_init_p) /* ISA 3.0 vector instructions include ISA 2.07. */ if (TARGET_P9_VECTOR && !TARGET_P8_VECTOR) { + /* We prefer to not mention undocumented options in + error messages. However, if users have managed to select + power9-vector without selecting power8-vector, they + already know about undocumented flags. */ if (rs6000_isa_flags_explicit & OPTION_MASK_P8_VECTOR) error ("-mpower9-vector requires -mpower8-vector"); rs6000_isa_flags &= ~OPTION_MASK_P9_VECTOR; @@ -4264,6 +4272,10 @@ rs6000_option_override_internal (bool global_init_p) /* ISA 3.0 D-form instructions require p9-vector and upper-regs. */ if ((TARGET_P9_DFORM_SCALAR || TARGET_P9_DFORM_VECTOR) && !TARGET_P9_VECTOR) { + /* We prefer to not mention undocumented options in + error messages. However, if users have managed to select + power9-dform without selecting power9-vector, they + already know about undocumented flags. */ if (rs6000_isa_flags_explicit & OPTION_MASK_P9_VECTOR) error ("-mpower9-dform requires -mpower9-vector"); rs6000_isa_flags &= ~(OPTION_MASK_P9_DFORM_SCALAR @@ -4272,6 +4284,10 @@ rs6000_option_override_internal (bool global_init_p) if (TARGET_P9_DFORM_SCALAR && !TARGET_UPPER_REGS_DF) { + /* We prefer to not mention undocumented options in + error messages. However, if users have managed to select + power9-dform without selecting upper-regs-df, they + already know about undocumented flags. */ if (rs6000_isa_flags_explicit & OPTION_MASK_UPPER_REGS_DF) error ("-mpower9-dform requires -mupper-regs-df"); rs6000_isa_flags &= ~OPTION_MASK_P9_DFORM_SCALAR; @@ -6667,25 +6683,43 @@ rs6000_expand_vector_init (rtx target, rtx vals) /* Double word values on VSX can use xxpermdi or lxvdsx. */ if (VECTOR_MEM_VSX_P (mode) && (mode == V2DFmode || mode == V2DImode)) { - rtx op0 = XVECEXP (vals, 0, 0); - rtx op1 = XVECEXP (vals, 0, 1); + rtx op[2]; + size_t i; + size_t num_elements = (all_same) ? 1 : 2; + for (i = 0; i < num_elements; i++) + { + op[i] = XVECEXP (vals, 0, i); + /* Just in case there is a SUBREG with a smaller mode, do a + conversion. */ + if (GET_MODE (op[i]) != inner_mode) + { + rtx tmp = gen_reg_rtx (inner_mode); + convert_move (tmp, op[i], 0); + op[i] = tmp; + } + /* Allow load with splat double word. */ + else if (MEM_P (op[i])) + { + if (!all_same) + op[i] = force_reg (inner_mode, op[i]); + } + else if (!REG_P (op[i])) + op[i] = force_reg (inner_mode, op[i]); + } + if (all_same) { - if (!MEM_P (op0) && !REG_P (op0)) - op0 = force_reg (inner_mode, op0); if (mode == V2DFmode) - emit_insn (gen_vsx_splat_v2df (target, op0)); + emit_insn (gen_vsx_splat_v2df (target, op[0])); else - emit_insn (gen_vsx_splat_v2di (target, op0)); + emit_insn (gen_vsx_splat_v2di (target, op[0])); } else { - op0 = force_reg (inner_mode, op0); - op1 = force_reg (inner_mode, op1); if (mode == V2DFmode) - emit_insn (gen_vsx_concat_v2df (target, op0, op1)); + emit_insn (gen_vsx_concat_v2df (target, op[0], op[1])); else - emit_insn (gen_vsx_concat_v2di (target, op0, op1)); + emit_insn (gen_vsx_concat_v2di (target, op[0], op[1])); } return; } @@ -15394,13 +15428,13 @@ rs6000_invalid_builtin (enum rs6000_builtins fncode) else if ((fnmask & RS6000_BTM_P8_VECTOR) != 0) error ("Builtin function %s requires the -mpower8-vector option", name); else if ((fnmask & RS6000_BTM_P9_VECTOR) != 0) - error ("Builtin function %s requires the -mpower9-vector option", name); + error ("Builtin function %s requires the -mcpu=power9 option", name); else if ((fnmask & (RS6000_BTM_P9_MISC | RS6000_BTM_64BIT)) == (RS6000_BTM_P9_MISC | RS6000_BTM_64BIT)) - error ("Builtin function %s requires the -mpower9-misc and" + error ("Builtin function %s requires the -mcpu=power9 and" " -m64 options", name); else if ((fnmask & RS6000_BTM_P9_MISC) == RS6000_BTM_P9_MISC) - error ("Builtin function %s requires the -mpower9-misc option", name); + error ("Builtin function %s requires the -mcpu=power9 option", name); else if ((fnmask & (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128)) == (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128)) error ("Builtin function %s requires the -mhard-float and" |