This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH], Add PowerPC ISA 3.0 vec_vinsert4b and vec_vextract4b built-in functions


On Dez 13 2016, Michael Meissner <meissner@linux.vnet.ibm.com> wrote:

> @@ -15766,6 +15766,40 @@ altivec_expand_builtin (tree exp, rtx ta
>      case VSX_BUILTIN_VEC_EXT_V1TI:
>        return altivec_expand_vec_ext_builtin (exp, target);
>  
> +    case P9V_BUILTIN_VEXTRACT4B:
> +    case P9V_BUILTIN_VEC_VEXTRACT4B:
> +      arg1 = CALL_EXPR_ARG (exp, 1);
> +      STRIP_NOPS (arg1);
> +
> +      /* Generate a normal call if it is invalid.  */
> +      /* If we got invalid arguments bail out before generating bad rtl.  */
> +      if (arg1 == error_mark_node)
> +	return expand_call (exp, target, false);
> +
> +      if (TREE_CODE (arg1) != INTEGER_CST || TREE_INT_CST_LOW (arg1) > 11)
> +	{
> +	  error ("second argument to vec_vextract4b must 0..11");

                                                        be
> +	  return expand_call (exp, target, false);
> +	}
> +      break;
> +
> +    case P9V_BUILTIN_VINSERT4B:
> +    case P9V_BUILTIN_VINSERT4B_DI:
> +    case P9V_BUILTIN_VEC_VINSERT4B:
> +      arg2 = CALL_EXPR_ARG (exp, 2);
> +      STRIP_NOPS (arg2);
> +
> +      /* If we got invalid arguments bail out before generating bad rtl.  */
> +      if (arg2 == error_mark_node)
> +	return expand_call (exp, target, false);
> +
> +      if (TREE_CODE (arg2) != INTEGER_CST || TREE_INT_CST_LOW (arg2) > 11)
> +	{
> +	  error ("third argument to vec_vinsert4b must 0..11");

                                                      be
> +	  return expand_call (exp, target, false);
> +	}
> +      break;
> +
>      default:
>        break;
>        /* Fall through.  */

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]