On Wed, Sep 19, 2012 at 7:37 AM, Tulio Magno Quites Machado Filho
<tul...@linux.vnet.ibm.com> wrote:
> Changes since v3:
> - specified the clobbered CC field;
> - removed the insn rs6000_get_timebase_ppc64 as it was identical to
>   rs6000_mftb_di;
> - removed UNSPECV_GETTB as it was identical to UNSPECV_MFTB;
> - fixed indentation.
>
> -- >8 --
>
> Add __builtin_ppc_get_timebase and __builtin_ppc_mftb to read the Time
> Base Register on PowerPC.
> They are required by applications that measure time at high frequencies
> with high precision that can't afford a syscall.
> __builtin_ppc_get_timebase returns the 64 bits of the Time Base Register
> while __builtin_ppc_mftb generates only 1 instruction and returns the
> least significant word on 32-bit environments and the whole Time Base value
> on 64-bit.
>
> [gcc]
> 2012-09-17 Tulio Magno Quites Machado Filho <tul...@linux.vnet.ibm.com>
>
>         * config/rs6000/rs6000-builtin.def: Add __builtin_ppc_get_timebase
>         and __builtin_ppc_mftb.
>         * config/rs6000/rs6000.c (rs6000_expand_zeroop_builtin): New
>         function to expand an expression that calls a built-in without
>         arguments.
>         (rs6000_expand_builtin): Add __builtin_ppc_get_timebase and
>         __builtin_ppc_mftb.
>         (rs6000_init_builtins): Likewise.
>         * config/rs6000/rs6000.md: Likewise.
>         * doc/extend.texi (PowerPC Built-in Functions): New section.
>         (PowerPC AltiVec/VSX Built-in Functions):
>         Move some built-ins unrelated to Altivec/VSX to the new section.
>
> [gcc/testsuite]
> 2012-09-17 Tulio Magno Quites Machado Filho <tul...@linux.vnet.ibm.com>
>
>         * gcc.target/powerpc/ppc-get-timebase.c: New file.
>         * gcc.target/powerpc/ppc-mftb.c: New file.

Tulio,

The revised patch looks very good now.

Please change the condition register mode to "CC" -- the value
technically is unsigned, but the comparison instruction is the signed
version and the condition does not care about signedness.  CCUNS is
for bookkeeping within GCC.

Also, please remove all of the spaces between assembly operands, e.g.,
"%2, %0, %1" should be "%2,%0,%1".

The patch is okay with those changes.

Obrigado,
David

Reply via email to