fdlibm-stubs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. echo '#include "real.h"' > real.c
  2. for(i in getFPcontrol getFPstatus){
  3. echo 'void'
  4. echo 'Real_'$i'(void *fp)'
  5. echo '{'
  6. echo ' F_Real_'$i' *f;'
  7. echo ''
  8. echo ' f = fp;'
  9. echo ''
  10. echo ' *f->ret = '$i'(f->x);'
  11. echo '}'
  12. echo ''
  13. } >> real.c
  14. for(i in finite ilogb isnan acos acosh asin asinh atan atanh cbrt ceil cos cosh erf erfc exp expm1 fabs floor j0 j1 log log10 log1p rint sin sinh sqrt tan tanh y0 y1){
  15. echo 'void'
  16. echo 'Real_'$i'(void *fp)'
  17. echo '{'
  18. echo ' F_Real_'$i' *f;'
  19. echo ''
  20. echo ' f = fp;'
  21. echo ''
  22. echo ' *f->ret = '$i'(f->x);'
  23. echo '}'
  24. echo ''
  25. } >> real.c
  26. for(i in fdim fmax fmin fmod hypot nextafter pow){
  27. echo 'void'
  28. echo 'Real_'$i'(void *fp)'
  29. echo '{'
  30. echo ' F_Real_'$i' *f;'
  31. echo ''
  32. echo ' f = fp;'
  33. echo ''
  34. echo ' *f->ret = '$i'(f->x, f->x);'
  35. echo '}'
  36. echo ''
  37. } >> real.c
  38. FPcontrol fn(r, mask: int) of int;
  39. FPstatus fn(r, mask: int) of int;
  40. atan2 fn(y, x: real) of real;
  41. copysign fn(x, s: real) of real;
  42. jn fn(n: int; x: real) of real;
  43. lgamma fn(x: real) of (int,real);
  44. modf fn(x: real) of (int,real);
  45. pow10 fn(p: int) of real;
  46. remainder fn(x, p: real) of real;
  47. scalbn fn(x: real; n: int) of real;
  48. yn fn(n: int; x: real) of real;
  49. dot fn(x, y: array of real) of real;
  50. iamax fn(x: array of real) of int;
  51. norm1, norm2 fn(x: array of real) of real;
  52. gemm fn(transa, transb: byte; m, n, k: int; alpha: real; a: array of real; ai0, aj0, lda: int; b: array of real; bi0, bj0, ldb: int; beta: real; c: array of real; ci0, cj0, ldc: int);
  53. for(i in FPcontrol FPstatus atan2 copysign jn lgamma modf pow10 remainder scalbn yn dot iamax norm1, norm2 gemm){
  54. echo 'void'
  55. echo 'Real_'$i'(void *fp)'
  56. echo '{'
  57. echo ' F_Real_'$i' *f;'
  58. echo ''
  59. echo ' f = fp;'
  60. echo ''
  61. echo ' *f->ret = '$i'(f->x, f->x);'
  62. echo '}'
  63. echo ''
  64. } >> real.c