test-tgmath2.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. /* Test compilation of tgmath macros.
  2. Copyright (C) 2007-2019 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. Contributed by Jakub Jelinek <jakub@redhat.com>, 2007.
  5. The GNU C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with the GNU C Library; if not, see
  15. <http://www.gnu.org/licenses/>. */
  16. #ifndef HAVE_MAIN
  17. #undef __NO_MATH_INLINES
  18. #define __NO_MATH_INLINES 1
  19. #include <float.h>
  20. #include <math.h>
  21. #include <complex.h>
  22. #include <stdio.h>
  23. #include <string.h>
  24. #include <tgmath.h>
  25. //#define DEBUG
  26. typedef complex float cfloat;
  27. typedef complex double cdouble;
  28. #if LDBL_MANT_DIG > DBL_MANT_DIG
  29. typedef long double ldouble;
  30. typedef complex long double cldouble;
  31. #else
  32. typedef double ldouble;
  33. typedef complex double cldouble;
  34. #endif
  35. float vfloat1, vfloat2, vfloat3;
  36. double vdouble1, vdouble2, vdouble3;
  37. ldouble vldouble1, vldouble2, vldouble3;
  38. cfloat vcfloat1, vcfloat2, vcfloat3;
  39. cdouble vcdouble1, vcdouble2, vcdouble3;
  40. cldouble vcldouble1, vcldouble2, vcldouble4;
  41. int vint1, vint2, vint3;
  42. long int vlong1, vlong2, vlong3;
  43. long long int vllong1, vllong2, vllong3;
  44. const float Vfloat1 = 1, Vfloat2 = 2, Vfloat3 = 3;
  45. const double Vdouble1 = 1, Vdouble2 = 2, Vdouble3 = 3;
  46. const ldouble Vldouble1 = 1, Vldouble2 = 2, Vldouble3 = 3;
  47. const cfloat Vcfloat1 = 1, Vcfloat2 = 2, Vcfloat3 = 3;
  48. const cdouble Vcdouble1 = 1, Vcdouble2 = 2, Vcdouble3 = 3;
  49. const cldouble Vcldouble1 = 1, Vcldouble2 = 2, Vcldouble4 = 3;
  50. const int Vint1 = 1, Vint2 = 2, Vint3 = 3;
  51. const long int Vlong1 = 1, Vlong2 = 2, Vlong3 = 3;
  52. const long long int Vllong1 = 1, Vllong2 = 2, Vllong3 = 3;
  53. enum
  54. {
  55. Tfloat = 0,
  56. Tcfloat,
  57. Tdouble,
  58. Tcdouble,
  59. #if LDBL_MANT_DIG > DBL_MANT_DIG
  60. Tldouble,
  61. Tcldouble,
  62. #else
  63. Tldouble = Tdouble,
  64. Tcldouble = Tcdouble,
  65. #endif
  66. Tlast
  67. };
  68. enum
  69. {
  70. C_cos = 0,
  71. C_fabs,
  72. C_cabs,
  73. C_conj,
  74. C_expm1,
  75. C_lrint,
  76. C_ldexp,
  77. C_atan2,
  78. C_remquo,
  79. C_pow,
  80. C_fma,
  81. C_last
  82. };
  83. int count;
  84. int counts[Tlast][C_last];
  85. #define FAIL(str) \
  86. do \
  87. { \
  88. printf ("%s failure on line %d\n", (str), __LINE__); \
  89. result = 1; \
  90. } \
  91. while (0)
  92. #define TEST_TYPE_ONLY(expr, rettype) \
  93. do \
  94. { \
  95. __typeof__ (expr) texpr = 0; \
  96. __typeof__ (rettype) ttype = 0, *ptype; \
  97. if (sizeof (expr) != sizeof (rettype)) \
  98. FAIL ("type"); \
  99. if (__alignof__ (expr) != __alignof__ (rettype)) \
  100. FAIL ("type"); \
  101. __asm ("" : "=r" (ptype) : "0" (&ttype), "r" (&texpr)); \
  102. if (&texpr == ptype) \
  103. FAIL ("type"); \
  104. } \
  105. while (0)
  106. #define TEST2(expr, type, rettype, fn) \
  107. do \
  108. { \
  109. __typeof__ (expr) texpr = 0; \
  110. TEST_TYPE_ONLY (expr, rettype); \
  111. if (count != 0) \
  112. FAIL ("internal error"); \
  113. if (counts[T##type][C_##fn] != 0) \
  114. FAIL ("internal error"); \
  115. texpr = expr; \
  116. __asm __volatile ("" : : "r" (&texpr)); \
  117. if (count != 1 || counts[T##type][C_##fn] != 1) \
  118. { \
  119. FAIL ("wrong function called"); \
  120. memset (counts, 0, sizeof (counts)); \
  121. } \
  122. count = 0; \
  123. counts[T##type][C_##fn] = 0; \
  124. } \
  125. while (0)
  126. #define TEST(expr, type, fn) TEST2(expr, type, type, fn)
  127. int
  128. test_cos (const int Vint4, const long long int Vllong4)
  129. {
  130. int result = 0;
  131. TEST (cos (vfloat1), float, cos);
  132. TEST (cos (vdouble1), double, cos);
  133. TEST (cos (vldouble1), ldouble, cos);
  134. TEST (cos (vint1), double, cos);
  135. TEST (cos (vllong1), double, cos);
  136. TEST (cos (vcfloat1), cfloat, cos);
  137. TEST (cos (vcdouble1), cdouble, cos);
  138. TEST (cos (vcldouble1), cldouble, cos);
  139. TEST (cos (Vfloat1), float, cos);
  140. TEST (cos (Vdouble1), double, cos);
  141. TEST (cos (Vldouble1), ldouble, cos);
  142. TEST (cos (Vint1), double, cos);
  143. TEST (cos (Vllong1), double, cos);
  144. TEST (cos (Vcfloat1), cfloat, cos);
  145. TEST (cos (Vcdouble1), cdouble, cos);
  146. TEST (cos (Vcldouble1), cldouble, cos);
  147. return result;
  148. }
  149. int
  150. test_fabs (const int Vint4, const long long int Vllong4)
  151. {
  152. int result = 0;
  153. TEST (fabs (vfloat1), float, fabs);
  154. TEST (fabs (vdouble1), double, fabs);
  155. TEST (fabs (vldouble1), ldouble, fabs);
  156. TEST (fabs (vint1), double, fabs);
  157. TEST (fabs (vllong1), double, fabs);
  158. TEST (fabs (vcfloat1), float, cabs);
  159. TEST (fabs (vcdouble1), double, cabs);
  160. TEST (fabs (vcldouble1), ldouble, cabs);
  161. TEST (fabs (Vfloat1), float, fabs);
  162. TEST (fabs (Vdouble1), double, fabs);
  163. TEST (fabs (Vldouble1), ldouble, fabs);
  164. #ifndef __OPTIMIZE__
  165. /* GCC is too smart to optimize these out. */
  166. TEST (fabs (Vint1), double, fabs);
  167. TEST (fabs (Vllong1), double, fabs);
  168. #else
  169. TEST_TYPE_ONLY (fabs (vllong1), double);
  170. TEST_TYPE_ONLY (fabs (vllong1), double);
  171. #endif
  172. TEST (fabs (Vint4), double, fabs);
  173. TEST (fabs (Vllong4), double, fabs);
  174. TEST (fabs (Vcfloat1), float, cabs);
  175. TEST (fabs (Vcdouble1), double, cabs);
  176. TEST (fabs (Vcldouble1), ldouble, cabs);
  177. return result;
  178. }
  179. int
  180. test_conj (const int Vint4, const long long int Vllong4)
  181. {
  182. int result = 0;
  183. TEST (conj (vfloat1), cfloat, conj);
  184. TEST (conj (vdouble1), cdouble, conj);
  185. TEST (conj (vldouble1), cldouble, conj);
  186. TEST (conj (vint1), cdouble, conj);
  187. TEST (conj (vllong1), cdouble, conj);
  188. TEST (conj (vcfloat1), cfloat, conj);
  189. TEST (conj (vcdouble1), cdouble, conj);
  190. TEST (conj (vcldouble1), cldouble, conj);
  191. TEST (conj (Vfloat1), cfloat, conj);
  192. TEST (conj (Vdouble1), cdouble, conj);
  193. TEST (conj (Vldouble1), cldouble, conj);
  194. TEST (conj (Vint1), cdouble, conj);
  195. TEST (conj (Vllong1), cdouble, conj);
  196. TEST (conj (Vcfloat1), cfloat, conj);
  197. TEST (conj (Vcdouble1), cdouble, conj);
  198. TEST (conj (Vcldouble1), cldouble, conj);
  199. return result;
  200. }
  201. int
  202. test_expm1 (const int Vint4, const long long int Vllong4)
  203. {
  204. int result = 0;
  205. TEST (expm1 (vfloat1), float, expm1);
  206. TEST (expm1 (vdouble1), double, expm1);
  207. TEST (expm1 (vldouble1), ldouble, expm1);
  208. TEST (expm1 (vint1), double, expm1);
  209. TEST (expm1 (vllong1), double, expm1);
  210. TEST (expm1 (Vfloat1), float, expm1);
  211. TEST (expm1 (Vdouble1), double, expm1);
  212. TEST (expm1 (Vldouble1), ldouble, expm1);
  213. TEST (expm1 (Vint1), double, expm1);
  214. TEST (expm1 (Vllong1), double, expm1);
  215. return result;
  216. }
  217. int
  218. test_lrint (const int Vint4, const long long int Vllong4)
  219. {
  220. int result = 0;
  221. TEST2 (lrint (vfloat1), float, long int, lrint);
  222. TEST2 (lrint (vdouble1), double, long int, lrint);
  223. TEST2 (lrint (vldouble1), ldouble, long int, lrint);
  224. TEST2 (lrint (vint1), double, long int, lrint);
  225. TEST2 (lrint (vllong1), double, long int, lrint);
  226. TEST2 (lrint (Vfloat1), float, long int, lrint);
  227. TEST2 (lrint (Vdouble1), double, long int, lrint);
  228. TEST2 (lrint (Vldouble1), ldouble, long int, lrint);
  229. TEST2 (lrint (Vint1), double, long int, lrint);
  230. TEST2 (lrint (Vllong1), double, long int, lrint);
  231. return result;
  232. }
  233. int
  234. test_ldexp (const int Vint4, const long long int Vllong4)
  235. {
  236. int result = 0;
  237. TEST (ldexp (vfloat1, 6), float, ldexp);
  238. TEST (ldexp (vdouble1, 6), double, ldexp);
  239. TEST (ldexp (vldouble1, 6), ldouble, ldexp);
  240. TEST (ldexp (vint1, 6), double, ldexp);
  241. TEST (ldexp (vllong1, 6), double, ldexp);
  242. TEST (ldexp (Vfloat1, 6), float, ldexp);
  243. TEST (ldexp (Vdouble1, 6), double, ldexp);
  244. TEST (ldexp (Vldouble1, 6), ldouble, ldexp);
  245. TEST (ldexp (Vint1, 6), double, ldexp);
  246. TEST (ldexp (Vllong1, 6), double, ldexp);
  247. return result;
  248. }
  249. #define FIRST(x, y) (y, x)
  250. #define SECOND(x, y) (x, y)
  251. #define NON_LDBL_TEST(fn, argm, arg, type, fnt) \
  252. TEST (fn argm (arg, vfloat1), type, fnt); \
  253. TEST (fn argm (arg, vdouble1), type, fnt); \
  254. TEST (fn argm (arg, vint1), type, fnt); \
  255. TEST (fn argm (arg, vllong1), type, fnt); \
  256. TEST (fn argm (arg, Vfloat1), type, fnt); \
  257. TEST (fn argm (arg, Vdouble1), type, fnt); \
  258. TEST (fn argm (arg, Vint1), type, fnt); \
  259. TEST (fn argm (arg, Vllong1), type, fnt);
  260. #define NON_LDBL_CTEST(fn, argm, arg, type, fnt) \
  261. NON_LDBL_TEST(fn, argm, arg, type, fnt); \
  262. TEST (fn argm (arg, vcfloat1), type, fnt); \
  263. TEST (fn argm (arg, vcdouble1), type, fnt); \
  264. TEST (fn argm (arg, Vcfloat1), type, fnt); \
  265. TEST (fn argm (arg, Vcdouble1), type, fnt);
  266. #define BINARY_TEST(fn, fnt) \
  267. TEST (fn (vfloat1, vfloat2), float, fnt); \
  268. TEST (fn (Vfloat1, vfloat2), float, fnt); \
  269. TEST (fn (vfloat1, Vfloat2), float, fnt); \
  270. TEST (fn (Vfloat1, Vfloat2), float, fnt); \
  271. TEST (fn (vldouble1, vldouble2), ldouble, fnt); \
  272. TEST (fn (Vldouble1, vldouble2), ldouble, fnt); \
  273. TEST (fn (vldouble1, Vldouble2), ldouble, fnt); \
  274. TEST (fn (Vldouble1, Vldouble2), ldouble, fnt); \
  275. NON_LDBL_TEST (fn, FIRST, vldouble2, ldouble, fnt); \
  276. NON_LDBL_TEST (fn, SECOND, vldouble2, ldouble, fnt); \
  277. NON_LDBL_TEST (fn, FIRST, Vldouble2, ldouble, fnt); \
  278. NON_LDBL_TEST (fn, SECOND, Vldouble2, ldouble, fnt); \
  279. NON_LDBL_TEST (fn, FIRST, vdouble2, double, fnt); \
  280. NON_LDBL_TEST (fn, SECOND, vdouble2, double, fnt); \
  281. NON_LDBL_TEST (fn, FIRST, Vdouble2, double, fnt); \
  282. NON_LDBL_TEST (fn, SECOND, Vdouble2, double, fnt); \
  283. NON_LDBL_TEST (fn, FIRST, vint2, double, fnt); \
  284. NON_LDBL_TEST (fn, SECOND, vint2, double, fnt); \
  285. NON_LDBL_TEST (fn, FIRST, Vint2, double, fnt); \
  286. NON_LDBL_TEST (fn, SECOND, Vint2, double, fnt); \
  287. NON_LDBL_TEST (fn, FIRST, vllong2, double, fnt); \
  288. NON_LDBL_TEST (fn, SECOND, vllong2, double, fnt); \
  289. NON_LDBL_TEST (fn, FIRST, Vllong2, double, fnt); \
  290. NON_LDBL_TEST (fn, SECOND, Vllong2, double, fnt);
  291. #define BINARY_CTEST(fn, fnt) \
  292. BINARY_TEST (fn, fnt); \
  293. TEST (fn (vcfloat1, vfloat2), cfloat, fnt); \
  294. TEST (fn (Vcfloat1, vfloat2), cfloat, fnt); \
  295. TEST (fn (vcfloat1, Vfloat2), cfloat, fnt); \
  296. TEST (fn (Vcfloat1, Vfloat2), cfloat, fnt); \
  297. TEST (fn (vcldouble1, vldouble2), cldouble, fnt); \
  298. TEST (fn (Vcldouble1, vldouble2), cldouble, fnt); \
  299. TEST (fn (vcldouble1, Vldouble2), cldouble, fnt); \
  300. TEST (fn (Vcldouble1, Vldouble2), cldouble, fnt); \
  301. TEST (fn (vcfloat1, vfloat2), cfloat, fnt); \
  302. TEST (fn (Vcfloat1, vfloat2), cfloat, fnt); \
  303. TEST (fn (vcfloat1, Vfloat2), cfloat, fnt); \
  304. TEST (fn (Vcfloat1, Vfloat2), cfloat, fnt); \
  305. TEST (fn (vcldouble1, vldouble2), cldouble, fnt); \
  306. TEST (fn (Vcldouble1, vldouble2), cldouble, fnt); \
  307. TEST (fn (vcldouble1, Vldouble2), cldouble, fnt); \
  308. TEST (fn (Vcldouble1, Vldouble2), cldouble, fnt); \
  309. TEST (fn (vcfloat1, vcfloat2), cfloat, fnt); \
  310. TEST (fn (Vcfloat1, vcfloat2), cfloat, fnt); \
  311. TEST (fn (vcfloat1, Vcfloat2), cfloat, fnt); \
  312. TEST (fn (Vcfloat1, Vcfloat2), cfloat, fnt); \
  313. TEST (fn (vcldouble1, vcldouble2), cldouble, fnt); \
  314. TEST (fn (Vcldouble1, vcldouble2), cldouble, fnt); \
  315. TEST (fn (vcldouble1, Vcldouble2), cldouble, fnt); \
  316. TEST (fn (Vcldouble1, Vcldouble2), cldouble, fnt); \
  317. NON_LDBL_CTEST (fn, FIRST, vcldouble2, cldouble, fnt); \
  318. NON_LDBL_CTEST (fn, SECOND, vcldouble2, cldouble, fnt); \
  319. NON_LDBL_CTEST (fn, FIRST, Vcldouble2, cldouble, fnt); \
  320. NON_LDBL_CTEST (fn, SECOND, Vcldouble2, cldouble, fnt); \
  321. NON_LDBL_CTEST (fn, FIRST, vcdouble2, cdouble, fnt); \
  322. NON_LDBL_CTEST (fn, SECOND, vcdouble2, cdouble, fnt); \
  323. NON_LDBL_CTEST (fn, FIRST, Vcdouble2, cdouble, fnt); \
  324. NON_LDBL_CTEST (fn, SECOND, Vcdouble2, cdouble, fnt);
  325. int
  326. test_atan2 (const int Vint4, const long long int Vllong4)
  327. {
  328. int result = 0;
  329. BINARY_TEST (atan2, atan2);
  330. return result;
  331. }
  332. int
  333. test_remquo (const int Vint4, const long long int Vllong4)
  334. {
  335. int result = 0;
  336. int quo = 0;
  337. #define my_remquo(x, y) remquo (x, y, &quo)
  338. BINARY_TEST (my_remquo, remquo);
  339. #undef my_remquo
  340. return result;
  341. }
  342. int
  343. test_pow (const int Vint4, const long long int Vllong4)
  344. {
  345. int result = 0;
  346. BINARY_CTEST (pow, pow);
  347. return result;
  348. }
  349. /* Testing all arguments of fma would be just too expensive,
  350. so test just some. */
  351. int
  352. test_fma_1 (const int Vint4, const long long int Vllong4)
  353. {
  354. int result = 0;
  355. #define my_fma(x, y) fma (x, y, vfloat3)
  356. BINARY_TEST (my_fma, fma);
  357. #undef my_fma
  358. return result;
  359. }
  360. int
  361. test_fma_2 (const int Vint4, const long long int Vllong4)
  362. {
  363. int result = 0;
  364. #define my_fma(x, y) fma (x, vfloat3, y)
  365. BINARY_TEST (my_fma, fma);
  366. #undef my_fma
  367. return result;
  368. }
  369. int
  370. test_fma_3 (const int Vint4, const long long int Vllong4)
  371. {
  372. int result = 0;
  373. #define my_fma(x, y) fma (Vfloat3, x, y)
  374. BINARY_TEST (my_fma, fma);
  375. #undef my_fma
  376. return result;
  377. }
  378. int
  379. test_fma_4 (const int Vint4, const long long int Vllong4)
  380. {
  381. int result = 0;
  382. TEST (fma (vdouble1, Vdouble2, vllong3), double, fma);
  383. TEST (fma (vint1, Vint2, vint3), double, fma);
  384. TEST (fma (Vldouble1, vldouble2, Vldouble3), ldouble, fma);
  385. TEST (fma (vldouble1, vint2, Vdouble3), ldouble, fma);
  386. return result;
  387. }
  388. static int
  389. do_test (void)
  390. {
  391. int result;
  392. result = test_cos (vint1, vllong1);
  393. result |= test_fabs (vint1, vllong1);
  394. result |= test_conj (vint1, vllong1);
  395. result |= test_expm1 (vint1, vllong1);
  396. result |= test_lrint (vint1, vllong1);
  397. result |= test_ldexp (vint1, vllong1);
  398. result |= test_atan2 (vint1, vllong1);
  399. result |= test_remquo (vint1, vllong1);
  400. result |= test_pow (vint1, vllong1);
  401. result |= test_fma_1 (vint1, vllong1);
  402. result |= test_fma_2 (vint1, vllong1);
  403. result |= test_fma_3 (vint1, vllong1);
  404. result |= test_fma_4 (vint1, vllong1);
  405. return result;
  406. }
  407. /* Now generate the three functions. */
  408. #define HAVE_MAIN
  409. #define F(name) name
  410. #define TYPE double
  411. #define CTYPE cdouble
  412. #define T Tdouble
  413. #define C Tcdouble
  414. #include "test-tgmath2.c"
  415. #define F(name) name##f
  416. #define TYPE float
  417. #define CTYPE cfloat
  418. #define T Tfloat
  419. #define C Tcfloat
  420. #include "test-tgmath2.c"
  421. #if LDBL_MANT_DIG > DBL_MANT_DIG
  422. #define F(name) name##l
  423. #define TYPE ldouble
  424. #define CTYPE cldouble
  425. #define T Tldouble
  426. #define C Tcldouble
  427. #include "test-tgmath2.c"
  428. #endif
  429. #define TEST_FUNCTION do_test ()
  430. #include "../test-skeleton.c"
  431. #else
  432. #ifdef DEBUG
  433. #define P() puts (__FUNCTION__); count++
  434. #else
  435. #define P() count++;
  436. #endif
  437. TYPE
  438. (F(cos)) (TYPE x)
  439. {
  440. counts[T][C_cos]++;
  441. P ();
  442. return x;
  443. }
  444. CTYPE
  445. (F(ccos)) (CTYPE x)
  446. {
  447. counts[C][C_cos]++;
  448. P ();
  449. return x;
  450. }
  451. TYPE
  452. (F(fabs)) (TYPE x)
  453. {
  454. counts[T][C_fabs]++;
  455. P ();
  456. return x;
  457. }
  458. TYPE
  459. (F(cabs)) (CTYPE x)
  460. {
  461. counts[T][C_cabs]++;
  462. P ();
  463. return x;
  464. }
  465. CTYPE
  466. (F(conj)) (CTYPE x)
  467. {
  468. counts[C][C_conj]++;
  469. P ();
  470. return x;
  471. }
  472. TYPE
  473. (F(expm1)) (TYPE x)
  474. {
  475. counts[T][C_expm1]++;
  476. P ();
  477. return x;
  478. }
  479. long int
  480. (F(lrint)) (TYPE x)
  481. {
  482. counts[T][C_lrint]++;
  483. P ();
  484. return x;
  485. }
  486. TYPE
  487. (F(ldexp)) (TYPE x, int y)
  488. {
  489. counts[T][C_ldexp]++;
  490. P ();
  491. return x + y;
  492. }
  493. TYPE
  494. (F(atan2)) (TYPE x, TYPE y)
  495. {
  496. counts[T][C_atan2]++;
  497. P ();
  498. return x + y;
  499. }
  500. TYPE
  501. (F(remquo)) (TYPE x, TYPE y, int *z)
  502. {
  503. counts[T][C_remquo]++;
  504. P ();
  505. return x + y + *z;
  506. }
  507. TYPE
  508. (F(pow)) (TYPE x, TYPE y)
  509. {
  510. counts[T][C_pow]++;
  511. P ();
  512. return x + y;
  513. }
  514. CTYPE
  515. (F(cpow)) (CTYPE x, CTYPE y)
  516. {
  517. counts[C][C_pow]++;
  518. P ();
  519. return x + y;
  520. }
  521. TYPE
  522. (F(fma)) (TYPE x, TYPE y, TYPE z)
  523. {
  524. counts[T][C_fma]++;
  525. P ();
  526. return x + y + z;
  527. }
  528. #undef F
  529. #undef TYPE
  530. #undef CTYPE
  531. #undef T
  532. #undef C
  533. #undef P
  534. #endif