Re: [PATCHv3] rs6000: Add 2 built-ins to read the Time Base Register on PowerPC

2012-09-18 Thread Segher Boessenkool
Hi Tulio, Thanks for all the cleanups! Two quite minor things... +(define_insn rs6000_get_timebase_ppc64 + [(set (match_operand:DI 0 gpc_reg_operand =r) +(unspec_volatile:DI [(const_int 0)] UNSPECV_GETTB))] + TARGET_POWERPC64 +{ + if (TARGET_MFCRF) +return mfspr %0, 268; +

[PATCHv3] rs6000: Add 2 built-ins to read the Time Base Register on PowerPC

2012-09-17 Thread Tulio Magno Quites Machado Filho
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

Re: [PATCHv3] rs6000: Add 2 built-ins to read the Time Base Register on PowerPC

2012-09-17 Thread David Edelsohn
On Mon, Sep 17, 2012 at 8:53 AM, Tulio Magno Quites Machado Filho tul...@linux.vnet.ibm.com wrote: 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