On Wed, May 11, 2016 at 04:05:46PM -0600, Kelvin Nilsen wrote: > I have bootstrapped and tested this patch against the trunk and against > the gcc-6-branch on both powerpc64le-unknown-linux-gnu and > powerpc64-unknown-linux-gnu with no regressions. Is this ok for trunk > and for backporting to GCC 6 after a few days of burn-in time on the > trunk?
> 2016-05-11 Kelvin Nilsen <kel...@gcc.gnu.org> > > * gcc.target/powerpc/darn-0.c: New test. > * gcc.target/powerpc/darn-1.c: New test. > * gcc.target/powerpc/darn-2.c: New test. > 2016-05-11 Kelvin Nilsen <kel...@gcc.gnu.org> > > * config/rs6000/altivec.md (UNSPEC_DARN): New unspec constant. > (UNSPEC_DARN_32): New unspec constant. > (UNSPEC_DARN_RAW): New unspec constant. > (darn_32): New instruction. > (darn_raw): New instruction. > (darn): New instruction. > * config/rs6000/rs6000-builtin.def (RS6000_BUILTIN_0): Add > support and documentation for this macro. > (BU_P9_MISC_1): New macro definition. > (BU_P9_64BIT_MISC_0): New macro definition. > (BU_P9_MISC_0): New macro definition. > (darn_32): New builtin definition. > (darn_raw): New builtin definition. > (darn): New builtin definition. > * config/rs6000/rs6000.c: Add #define RS6000_BUILTIN_0 and #undef > RS6000_BUILTIN_0 directives to surround each occurrence of > #include "rs6000-builtin.def". > (rs6000_builtin_mask_calculate): Add in the RS6000_BTM_MODULO and > RS6000_BTM_64BIT flags to the returned mask, depending on > configuration. > (def_builtin): Correct an error in the assignments made to the > debugging variable attr_string. > (rs6000_expand_builtin): Add support for no-operand built-in > functions. > (builtin_function_type): Remove fatal_error assertion that is no > longer valid. > (rs6000_common_init_builtins): Add support for no-operand built-in > functions. > * config/rs6000/rs6000.h (RS6000_BTM_MODULO): New macro > definition. > (RS6000_BTM_PURE): Enhance comment to clarify intent of this flag > definition. > (RS6000_BTM_64BIT): New macro definition. > * doc/extend.texi: Document __builtin_darn (void), > __builtin_darn_raw (void), and __builtin_darn_32 (void) built-in > functions. > +(define_insn "darn_32" > + [(set (match_operand:SI 0 "register_operand" "=r") > + (unspec:SI [(const_int 0)] UNSPEC_DARN_32))] > + "TARGET_MODULO" > + { > + return "darn %0,0"; > + } > + [(set_attr "type" "integer")]) Don't indent the {}; but in simple cases like this, you don't need a C block, just the string: +(define_insn "darn_32" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(const_int 0)] UNSPEC_DARN_32))] + "TARGET_MODULO" + "darn %0,0" + [(set_attr "type" "integer")]) > + if (rs6000_overloaded_builtin_p (d->code)) > + { > + if (! (type = opaque_ftype_opaque)) > + { > + opaque_ftype_opaque > + = build_function_type_list (opaque_V4SI_type_node, NULL_TREE); > + type = opaque_ftype_opaque; > + } No space after !; no space at end of line. It's easier to read if you put the assignment as a separate statement before the if. Or write is as + if (!opaque_ftype_opaque) + opaque_ftype_opaque + = build_function_type_list (opaque_V4SI_type_node, NULL_TREE); + type = opaque_ftype_opaque; Okay with those changes, thanks! Segher