Hi Kugan, Thanks for this, couple of comments inline:

On 26 April 2014 11:57, Kugan <kugan.vivekanandara...@linaro.org> wrote:

> gcc/
> +2014-04-27  Kugan Vivekanandarajah  <kug...@linaro.org>
> +
> +       * config/aarch64/aarch64.c (TARGET_ATOMIC_ASSIGN_EXPAND_FENV): New
> +       define.
> +       * config/aarch64/aarch64-builtins.c (arm_builtins) : Add

aarch64_builtins ?

> +       AARCH64_BUILTIN_LDFPSCR and AARCH64_BUILTIN_STFPSCR.

AArch32 has the traditional combined FPSCR, but AArch64 splits this
register into FPSR and FPCR therefore I think AARCH64_BUILTIN_GET_FPCR
and AARCH64_BUILTIN_SET_FPCR are more appropriate names.  Likewise
subsequent references to FPSCR in this patch should change to FPCR.

> +       (aarch64_init_builtins) : Initialize builtins
> +       __builtins_aarch64_stfpscr and __builtins_aarch64_ldfpscr.
> +       (aarch64_expand_builtin) : Expand builtins __builtins_aarch64_stfpscr
> +       and __builtins_aarch64_ldfpscr.
> +       (aarch64_atomic_assign_expand_fenv): New function.
> +       * config/aarch64/aarch64.md (stfpscr): New pattern.
> +       (ldfpscr) : Likewise.
> +       (unspecv): Add UNSPECV_LDFPSCR and UNSPECV_STFPSCR.
> +

+  aarch64_builtin_decls[AARCH64_BUILTIN_LDFPSCR]
+    = add_builtin_function ("__builtin_aarch64_ldfscr", ftype_ldfpscr,

I'd prefer __builtin_aarch64_get_fpcr and __builtin_aarch64_set_fpcr.

We should document them in doc/extend.texi

+  const unsigned HOST_WIDE_INT FE_ALL_EXCEPT = (FE_INVALID | FE_DIVBYZERO
+ | FE_OVERFLOW | FE_UNDERFLOW
+ | FE_INEXACT);

Indentation is funny here..

+  /* Genareate the equivalence of :

Spelling.

+  tree fenv_var = create_tmp_var (unsigned_type_node, NULL);
+  tree ldfpscr = aarch64_builtin_decls[AARCH64_BUILTIN_LDFPSCR];
+  tree stfpscr = aarch64_builtin_decls[AARCH64_BUILTIN_STFPSCR];

Move the declarations to the top of the function please.

+void aarch64_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update);
+

Drop the argument names and relocate to aarch64-protos.h please.

+    UNSPECV_LDFPSCR ; load floating point status and control register.

It isn't a status register, how about:

UNSPECV_GET_FPCR ; Represent fetch of FPCR content.

Cheers
/Marcus

Reply via email to