Commit Graph

4 Commits

Author SHA1 Message Date
Kang Zhang e5ac385fb1 [PowerPC] Add the support for __builtin_setrnd() in clang
Summary:
PowerPC64/PowerPC64le supports the builtin function __builtin_setrnd to set the floating point rounding mode. This function will use the least significant two bits of integer argument to set the floating point rounding mode.
double __builtin_setrnd(int mode);
The effective values for mode are:
0 - round to nearest
1 - round to zero
2 - round to +infinity
3 - round to -infinity
Note that the mode argument will modulo 4, so if the int argument is greater than 3, it will only use the least significant two bits of the mode. Namely, builtin_setrnd(102)) is equal to builtin_setrnd(2).

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D59403

llvm-svn: 357242
2019-03-29 09:11:52 +00:00
Hal Finkel 65e1e4dbe0 [PowerPC] Support __builtin_ppc_get_timebase
GCC 4.8+ has a PowerPC-specific intrinsic, __builtin_ppc_get_timebase, to do
what Clang's __builtin_readcyclecounter does. For compatibility with code that
uses GCC's spelling (including glibc), support it as well.

Partially fixes PR23681.

llvm-svn: 246510
2015-08-31 23:55:19 +00:00
NAKAMURA Takumi 7cbe30fc43 clang/test: REQUIRES: s/ppc{32|64}-registered-target/powerpc-registered-target/
llvm-svn: 196349
2013-12-04 03:41:15 +00:00
Adhemerval Zanella 5d874aeea9 PowerPC: fix __builtin_eh_return_data_regno return
llvm-svn: 173188
2013-01-22 20:02:45 +00:00