floatmgr.pp 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. {$MACRO ON}
  2. (******************************************************************************
  3. *
  4. * Copyright (c) 1996-2000 Palm, Inc. or its subsidiaries.
  5. * All rights reserved.
  6. *
  7. * File: FloatMgr.h
  8. *
  9. * Release: Palm OS SDK 4.0 (63220)
  10. *
  11. * Description:
  12. * New Floating point routines, provided by new IEEE arithmetic
  13. * 68K software floating point emulator (sfpe) code.
  14. *
  15. * History:
  16. * 9/23/96 - Created by SCL
  17. * 11/15/96 - First build of NewFloatMgr.lib
  18. * 11/26/96 - Added FlpCorrectedAdd and FlpCorrectedSub routines
  19. * 12/30/96 - Added FlpVersion routine
  20. * 2/ 4/97 - Fixed FlpDoubleBits definition - sign & exp now Int32s
  21. * so total size of FlpCompDouble is 64 bits, not 96.
  22. * 2/ 5/97 - Added note about FlpBase10Info reporting "negative" zero.
  23. * 7/21/99 - Renamed NewFloatMgr.h to FloatMgr.h.
  24. *
  25. *****************************************************************************)
  26. {$IFNDEF FPC_DOTTEDUNITS}
  27. unit floatmgr;
  28. {$ENDIF FPC_DOTTEDUNITS}
  29. interface
  30. {$IFDEF FPC_DOTTEDUNITS}
  31. uses PalmApi.Palmos, PalmApi.Coretraps, PalmApi.Errorbase;
  32. {$ELSE FPC_DOTTEDUNITS}
  33. uses palmos, coretraps, errorbase;
  34. {$ENDIF FPC_DOTTEDUNITS}
  35. (************************************************************************
  36. * Differences between FloatMgr (PalmOS v1.0) and (this) NewFloatMgr
  37. ***********************************************************************)
  38. //
  39. // FloatMgr (PalmOS v1.0) NewFloatMgr
  40. // ---------------------- ---------------------------------------------
  41. // FloatType (64-bits) use FlpFloat (32-bits) or FlpDouble (64-bits)
  42. //
  43. // fplErrOutOfRange use _fp_get_fpscr() to retrieve errors
  44. //
  45. // FplInit() not necessary
  46. // FplFree() not necessary
  47. //
  48. // FplFToA() use FlpFToA()
  49. // FplAToF() use FlpAToF()
  50. // FplBase10Info() use FlpBase10Info() [*signP returns sign BIT: 1 if negative]
  51. //
  52. // FplLongToFloat() use _f_itof() or _d_itod()
  53. // FplFloatToLong() use _f_ftoi() or _d_dtoi()
  54. // FplFloatToULong() use _f_ftou() or _d_dtou()
  55. //
  56. // FplMul() use _f_mul() or _d_mul()
  57. // FplAdd() use _f_add() or _d_add()
  58. // FplSub() use _f_sub() or _d_sub()
  59. // FplDiv() use _f_div() or _d_div()
  60. (************************************************************************
  61. * New Floating point manager constants
  62. ***********************************************************************)
  63. const
  64. flpVersion_ = $02008000; // first version of NewFloatMgr (PalmOS 2.0)
  65. (*
  66. * These constants are passed to and received from the _fp_round routine.
  67. *)
  68. flpToNearest = 0;
  69. flpTowardZero = 1;
  70. flpUpward = 3;
  71. flpDownward = 2;
  72. flpModeMask = $00000030;
  73. flpModeShift = 4;
  74. (*
  75. * These masks define the fpscr bits supported by the sfpe (software floating point emulator).
  76. * These constants are used with the _fp_get_fpscr and _fp_set_fpscr routines.
  77. *)
  78. flpInvalid = $00008000;
  79. flpOverflow = $00004000;
  80. flpUnderflow = $00002000;
  81. flpDivByZero = $00001000;
  82. flpInexact = $00000800;
  83. (*
  84. * These constants are returned by _d_cmp, _d_cmpe, _f_cmp, and _f_cmpe:
  85. *)
  86. flpEqual = 0;
  87. flpLess = 1;
  88. flpGreater = 2;
  89. flpUnordered = 3;
  90. (************************************************************************
  91. * New Floating point manager types (private)
  92. ***********************************************************************)
  93. type
  94. _sfpe_64_bits = record // for internal use only
  95. high: Int32;
  96. low: Int32;
  97. end;
  98. sfpe_long_long = _sfpe_64_bits; // for internal use only
  99. sfpe_unsigned_long_long = _sfpe_64_bits; // for internal use only
  100. (************************************************************************
  101. * New Floating point manager types (public)
  102. ***********************************************************************)
  103. FlpFloat = {$IFDEF FPUNONE}Int32{$ELSE}Single{$ENDIF}; //Int32;
  104. FlpDouble ={$IFDEF FPUNONE}Int64{$ELSE}Double{$ENDIF}; //_sfpe_64_bits;
  105. FlpLongDouble = _sfpe_64_bits;
  106. (*
  107. * A double value comprises the fields:
  108. * 0x80000000 0x00000000 -- sign bit (1 for negative)
  109. * 0x7ff00000 0x00000000 -- exponent, biased by 0x3ff == 1023
  110. * 0x000fffff 0xffffffff -- significand == the fraction after an implicit "1."
  111. * So a double has the mathematical form:
  112. * (-1)^sign_bit * 2^(exponent - bias) * 1.significand
  113. * What follows are some structures (and macros) useful for decomposing numbers.
  114. *)
  115. FlpDoubleBits = record // for accessing specific fields
  116. Bits1: UInt32;
  117. {
  118. UInt32 sign: 1;
  119. Int32 exp : 11;
  120. UInt32 manH: 20;
  121. }
  122. ManL: UInt32;
  123. end;
  124. (*!!!
  125. typedef union {
  126. double d; // for easy assignment of values
  127. FlpDouble fd; // for calling New Floating point manager routines
  128. UInt32 ul[2]; // for accessing upper and lower longs
  129. FlpDoubleBits fdb; // for accessing specific fields
  130. } FlpCompDouble;
  131. typedef union {
  132. float f; // for easy assignment of values
  133. FlpFloat ff; // for calling New Floating point manager routines
  134. UInt32 ul; // for accessing bits of the float
  135. } FlpCompFloat;
  136. !!!*)
  137. (************************************************************************
  138. * Useful macros...
  139. ***********************************************************************)
  140. {
  141. #define BIG_ENDIAN 1
  142. #define __FIRST32(x) *((UInt32 *) &x)
  143. #define __SECOND32(x) *((UInt32 *) &x + 1)
  144. #define __ALL32(x) *((UInt32 *) &x)
  145. #ifdef LITTLE_ENDIAN
  146. #define __LO32(x) *((UInt32 *) &x)
  147. #define __HI32(x) *((UInt32 *) &x + 1)
  148. #define __HIX 1
  149. #define __LOX 0
  150. #else
  151. #define __HI32(x) *((UInt32 *) &x)
  152. #define __LO32(x) *((UInt32 *) &x + 1)
  153. #define __HIX 0
  154. #define __LOX 1
  155. #endif
  156. #define FlpGetSign(x) ((__HI32(x) & 0x80000000) != 0)
  157. #define FlpIsZero(x) ( ((__HI32(x) & 0x7fffffff) | (__LO32(x))) == 0)
  158. #define FlpGetExponent(x) (((__HI32(x) & 0x7ff00000) >> 20) - 1023)
  159. #define FlpNegate(x) (((FlpCompDouble *)&x)->ul[__HIX] ^= 0x80000000)
  160. #define FlpSetNegative(x) (((FlpCompDouble *)&x)->ul[__HIX] |= 0x80000000)
  161. #define FlpSetPositive(x) (((FlpCompDouble *)&x)->ul[__HIX] &= ~0x80000000)
  162. }
  163. (*******************************************************************
  164. * New Floating point manager errors
  165. * The constant fplErrorClass is defined in SystemMgr.h
  166. *******************************************************************)
  167. const
  168. flpErrOutOfRange = flpErrorClass or 1;
  169. (************************************************************
  170. * New Floating point manager trap macros
  171. *************************************************************)
  172. (************************************************************
  173. * New Floating point manager selectors
  174. *************************************************************)
  175. type
  176. sysFloatSelector = Enum; // The order of this enum *MUST* match the
  177. // corresponding table in NewFloatDispatch.c
  178. const
  179. sysFloatBase10Info = 0; // 0
  180. sysFloatFToA = Succ(sysFloatBase10Info); // 1
  181. sysFloatAToF = Succ(sysFloatFToA); // 2
  182. sysFloatCorrectedAdd = Succ(sysFloatAToF); // 3
  183. sysFloatCorrectedSub = Succ(sysFloatCorrectedAdd); // 4
  184. sysFloatVersion = Succ(sysFloatCorrectedSub); // 5
  185. flpMaxFloatSelector = sysFloatVersion; // used by NewFloatDispatch.c
  186. type
  187. sysFloatEmSelector = Enum; // The order of this enum *MUST* match the
  188. // sysFloatSelector table in NewFloatDispatch.c
  189. const
  190. sysFloatEm_fp_round = 0; // 0
  191. sysFloatEm_fp_get_fpscr = Succ(sysFloatEm_fp_round); // 1
  192. sysFloatEm_fp_set_fpscr = Succ(sysFloatEm_fp_get_fpscr); // 2
  193. sysFloatEm_f_utof = Succ(sysFloatEm_fp_set_fpscr); // 3
  194. sysFloatEm_f_itof = Succ(sysFloatEm_f_utof); // 4
  195. sysFloatEm_f_ulltof = Succ(sysFloatEm_f_itof); // 5
  196. sysFloatEm_f_lltof = Succ(sysFloatEm_f_ulltof); // 6
  197. sysFloatEm_d_utod = Succ(sysFloatEm_f_lltof); // 7
  198. sysFloatEm_d_itod = Succ(sysFloatEm_d_utod); // 8
  199. sysFloatEm_d_ulltod = Succ(sysFloatEm_d_itod); // 9
  200. sysFloatEm_d_lltod = Succ(sysFloatEm_d_ulltod); // 10
  201. sysFloatEm_f_ftod = Succ(sysFloatEm_d_lltod); // 11
  202. sysFloatEm_d_dtof = Succ(sysFloatEm_f_ftod); // 12
  203. sysFloatEm_f_ftoq = Succ(sysFloatEm_d_dtof); // 13
  204. sysFloatEm_f_qtof = Succ(sysFloatEm_f_ftoq); // 14
  205. sysFloatEm_d_dtoq = Succ(sysFloatEm_f_qtof); // 15
  206. sysFloatEm_d_qtod = Succ(sysFloatEm_d_dtoq); // 16
  207. sysFloatEm_f_ftou = Succ(sysFloatEm_d_qtod); // 17
  208. sysFloatEm_f_ftoi = Succ(sysFloatEm_f_ftou); // 18
  209. sysFloatEm_f_ftoull = Succ(sysFloatEm_f_ftoi); // 19
  210. sysFloatEm_f_ftoll = Succ(sysFloatEm_f_ftoull); // 20
  211. sysFloatEm_d_dtou = Succ(sysFloatEm_f_ftoll); // 21
  212. sysFloatEm_d_dtoi = Succ(sysFloatEm_d_dtou); // 22
  213. sysFloatEm_d_dtoull = Succ(sysFloatEm_d_dtoi); // 23
  214. sysFloatEm_d_dtoll = Succ(sysFloatEm_d_dtoull); // 24
  215. sysFloatEm_f_cmp = Succ(sysFloatEm_d_dtoll); // 25
  216. sysFloatEm_f_cmpe = Succ(sysFloatEm_f_cmp); // 26
  217. sysFloatEm_f_feq = Succ(sysFloatEm_f_cmpe); // 27
  218. sysFloatEm_f_fne = Succ(sysFloatEm_f_feq); // 28
  219. sysFloatEm_f_flt = Succ(sysFloatEm_f_fne); // 29
  220. sysFloatEm_f_fle = Succ(sysFloatEm_f_flt); // 30
  221. sysFloatEm_f_fgt = Succ(sysFloatEm_f_fle); // 31
  222. sysFloatEm_f_fge = Succ(sysFloatEm_f_fgt); // 32
  223. sysFloatEm_f_fun = Succ(sysFloatEm_f_fge); // 33
  224. sysFloatEm_f_for = Succ(sysFloatEm_f_fun); // 34
  225. sysFloatEm_d_cmp = Succ(sysFloatEm_f_for); // 35
  226. sysFloatEm_d_cmpe = Succ(sysFloatEm_d_cmp); // 36
  227. sysFloatEm_d_feq = Succ(sysFloatEm_d_cmpe); // 37
  228. sysFloatEm_d_fne = Succ(sysFloatEm_d_feq); // 38
  229. sysFloatEm_d_flt = Succ(sysFloatEm_d_fne); // 39
  230. sysFloatEm_d_fle = Succ(sysFloatEm_d_flt); // 40
  231. sysFloatEm_d_fgt = Succ(sysFloatEm_d_fle); // 41
  232. sysFloatEm_d_fge = Succ(sysFloatEm_d_fgt); // 42
  233. sysFloatEm_d_fun = Succ(sysFloatEm_d_fge); // 43
  234. sysFloatEm_d_for = Succ(sysFloatEm_d_fun); // 44
  235. sysFloatEm_f_neg = Succ(sysFloatEm_d_for); // 45
  236. sysFloatEm_f_add = Succ(sysFloatEm_f_neg); // 46
  237. sysFloatEm_f_mul = Succ(sysFloatEm_f_add); // 47
  238. sysFloatEm_f_sub = Succ(sysFloatEm_f_mul); // 48
  239. sysFloatEm_f_div = Succ(sysFloatEm_f_sub); // 49
  240. sysFloatEm_d_neg = Succ(sysFloatEm_f_div); // 50
  241. sysFloatEm_d_add = Succ(sysFloatEm_d_neg); // 51
  242. sysFloatEm_d_mul = Succ(sysFloatEm_d_add); // 52
  243. sysFloatEm_d_sub = Succ(sysFloatEm_d_mul); // 53
  244. sysFloatEm_d_div = Succ(sysFloatEm_d_sub); // 54
  245. (************************************************************
  246. * New Floating point manager routines
  247. *************************************************************)
  248. // Note: FlpBase10Info returns the actual sign bit in *signP (1 if negative)
  249. // Note: FlpBase10Info reports that zero is "negative".
  250. // A workaround is to check (*signP && *mantissaP) instead of just *signP.
  251. function FlpBase10Info(a: FlpDouble; var mantissaP: UInt32; var exponentP, signP: Int16): Err; syscall sysTrapFlpDispatch, sysFloatBase10Info;
  252. function FlpFToA(a: FlpDouble; s: PAnsiChar): Err; syscall sysTrapFlpDispatch, sysFloatFToA;
  253. function FlpAToF(const s: PAnsiChar): FlpDouble; syscall sysTrapFlpDispatch, sysFloatAToF;
  254. function FlpCorrectedAdd(firstOperand, secondOperand: FlpDouble; howAccurate: Int16): FlpDouble; syscall sysTrapFlpDispatch, sysFloatCorrectedAdd;
  255. function FlpCorrectedSub(firstOperand, secondOperand: FlpDouble; howAccurate: Int16): FlpDouble; syscall sysTrapFlpDispatch, sysFloatCorrectedSub;
  256. // These next three functions correspond to the previous three above.
  257. // The signatures are different, but in fact with CodeWarrior for Palm OS
  258. // the structure return values above are implemented via a hidden pointer
  259. // parameter, so corresponding functions are binary compatible. Programs
  260. // using CodeWarrior to target m68k Palm OS can use either function
  261. // interchangeably.
  262. //
  263. // However, a description of the handling of structure return values is
  264. // missing from the defined Palm OS ABI, and m68k-palmos-gcc does it
  265. // differently. So programs compiled with GCC using the standard functions
  266. // above are likely to crash: GCC users must use the FlpBuffer* forms of
  267. // these functions.
  268. //
  269. // The FlpBuffer* functions are not available on the Simulator, so you need
  270. // to use the standard versions above if you want Simulator compatibility.
  271. //
  272. // Many of the _d_* functions further below suffer from the same problem.
  273. // This is not an issue, because programs targeting Palm OS devices can use
  274. // operators (+ - * / etc) instead of calling these functions directly.
  275. // (GCC users may wish to use -lnfm -- see the documentation for details.)
  276. //
  277. // See the SDK's SampleCalc example for further discussion.
  278. procedure FlpBufferAToF(var result: FlpDouble; const s: PAnsiChar); syscall sysTrapFlpDispatch, sysFloatAToF;
  279. procedure FlpBufferCorrectedAdd(var result: FlpDouble; firstOperand, secondOperand: FlpDouble; howAccurate: Int16); syscall sysTrapFlpDispatch, sysFloatCorrectedAdd;
  280. procedure FlpBufferCorrectedSub(var result: FlpDouble; firstOperand, secondOperand: FlpDouble; howAccurate: Int16); syscall sysTrapFlpDispatch, sysFloatCorrectedSub;
  281. function FlpVersion: UInt32; syscall sysTrapFlpDispatch, sysFloatVersion;
  282. //procedure FlpSelectorErrPrv(flpSelector: UInt16); // used only by NewFloatDispatch.c
  283. // The following macros could be useful but are left undefined due to the
  284. // confusion they might cause. What was called a "float" in PalmOS v1.0 was
  285. // really a 64-bit; in v2.0 "float" is only 32-bits and "double" is 64-bits.
  286. // However, if a v1.0 program is converted to use the NewFloatMgr, these
  287. // macros could be re-defined, or the native _d_ routines could be called.
  288. //#define FlpLongToFloat(x) _d_itod(x) // similar to 1.0 call, but returns double
  289. //#define FlpFloatToLong(f) _d_dtoi(f) // similar to 1.0 call, but takes a double
  290. //#define FlpFloatToULong(f) _d_dtou(f) // similar to 1.0 call, but takes a double
  291. (************************************************************
  292. * New Floating point emulator functions
  293. *************************************************************)
  294. (*
  295. * These three functions define the interface to the (software) fpscr
  296. * of the sfpe. _fp_round not only sets the rounding mode according
  297. * the low two bits of its argument, but it also returns those masked
  298. * two bits. This provides some hope of compatibility with less capable
  299. * emulators, which support only rounding to nearest. A programmer
  300. * concerned about getting the rounding mode requested can test the
  301. * return value from _fp_round; it will indicate what the current mode is.
  302. *
  303. * Constants passed to and received from _fp_round are:
  304. * flpToNearest, flpTowardZero, flpUpward, or flpDownward
  305. *)
  306. function _fp_round(Value: Int32): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_fp_round;
  307. (*
  308. * Constants passed to _fp_set_fpscr and received from _fp_get_fpscr are:
  309. * flpInvalid, flpOverflow, flpUnderflow, flpDivByZero, or flpInexact
  310. *)
  311. function _fp_get_fpscr: Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_fp_get_fpscr;
  312. procedure _fp_set_fpscr(Value: Int32); syscall sysTrapFlpEmDispatch, sysFloatEm_fp_set_fpscr;
  313. (*
  314. * The shorthand here can be determined from the context:
  315. * i --> long (Int32)
  316. * u --> UInt32 (UInt32)
  317. * ll --> long long int
  318. * ull --> UInt32 long int
  319. * f --> float
  320. * d --> double
  321. * q --> long double (defaults to double in this implementaton)
  322. * XtoY--> map of type X to a value of type Y
  323. *)
  324. function _f_utof(Value: UInt32): FlpFloat; syscall sysTrapFlpEmDispatch, sysFloatEm_f_utof;
  325. function _f_itof(Value: Int32): FlpFloat; syscall sysTrapFlpEmDispatch, sysFloatEm_f_itof;
  326. //!!!function _f_ulltof(Value: sfpe_unsigned_long_long): FlpFloat; syscall sysTrapFlpEmDispatch, sysFloatEm_f_ulltof;
  327. //!!!function _f_lltof(Value: sfpe_long_long): FlpFloat; syscall sysTrapFlpEmDispatch, sysFloatEm_f_lltof;
  328. function _d_utod(Value: UInt32): FlpDouble; syscall sysTrapFlpEmDispatch, sysFloatEm_d_utod;
  329. function _d_itod(Value: Int32): FlpDouble; syscall sysTrapFlpEmDispatch, sysFloatEm_d_itod;
  330. //!!!function _d_ulltod(Value: sfpe_unsigned_long_long): FlpDouble; syscall sysTrapFlpEmDispatch, sysFloatEm_d_ulltod;
  331. //!!!function _d_lltod(Value: sfpe_long_long): FlpDouble; syscall sysTrapFlpEmDispatch, sysFloatEm_d_lltod;
  332. function _f_ftod(Value: FlpFloat): FlpDouble; syscall sysTrapFlpEmDispatch, sysFloatEm_f_ftod;
  333. function _d_dtof(Value: FlpDouble): FlpFloat; syscall sysTrapFlpEmDispatch, sysFloatEm_d_dtof;
  334. //!!!function _f_ftoq(Value: FlpFloat): FlpLongDouble; syscall sysTrapFlpEmDispatch, sysFloatEm_f_ftoq;
  335. function _f_qtof(var Value: FlpLongDouble): FlpFloat; syscall sysTrapFlpEmDispatch, sysFloatEm_f_qtof;
  336. //!!!function _d_dtoq(Value: FlpDouble): FlpLongDouble; syscall sysTrapFlpEmDispatch, sysFloatEm_d_dtoq;
  337. //!!!function _d_qtod(var Value: FlpLongDouble): FlpDouble; syscall sysTrapFlpEmDispatch, sysFloatEm_d_qtod;
  338. function _f_ftou(Value: FlpFloat): UInt32; syscall sysTrapFlpEmDispatch, sysFloatEm_f_ftou;
  339. function _f_ftoi(Value: FlpFloat): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_f_ftoi;
  340. //!!!function _f_ftoull(Value: FlpFloat): sfpe_unsigned_long_long; syscall sysTrapFlpEmDispatch, sysFloatEm_f_ftoull;
  341. //!!!function _f_ftoll(Value: FlpFloat): sfpe_long_long; syscall sysTrapFlpEmDispatch, sysFloatEm_f_ftoll;
  342. function _d_dtou(Value: FlpDouble): UInt32; syscall sysTrapFlpEmDispatch, sysFloatEm_d_dtou;
  343. function _d_dtoi(Value: FlpDouble): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_d_dtoi;
  344. //!!!function _d_dtoull(Value: FlpDouble): sfpe_unsigned_long_long; syscall sysTrapFlpEmDispatch, sysFloatEm_d_dtoull;
  345. //!!!function _d_dtoll(Value: FlpDouble): sfpe_long_long; syscall sysTrapFlpEmDispatch, sysFloatEm_d_dtoll;
  346. (*
  347. * The comparison functions _T_Tcmp[e] compare their two arguments,
  348. * of type T, and return one of the four values defined below.
  349. * The functions _d_dcmpe and _f_fcmpe, in addition to returning
  350. * the comparison code, also set the invalid flag in the fpscr if
  351. * the operands are unordered. Two floating point values are unordered
  352. * when they enjoy no numerical relationship, as is the case when one
  353. * or both are NaNs.
  354. *
  355. * Return values for _d_cmp, _d_cmpe, _f_cmp, and _f_cmpe are:
  356. * flpEqual, flpLess, flpGreater, or flpUnordered
  357. *
  358. * The function shorthand is:
  359. * eq --> equal
  360. * ne --> not equal
  361. * lt --> less than
  362. * le --> less than or equal to
  363. * gt --> greater than
  364. * ge --> greater than or equal to
  365. * un --> unordered with
  366. * or --> ordered with (i.e. less than, equal to, or greater than)
  367. *)
  368. function _f_cmp(Left: FlpFloat; Right: FlpFloat): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_f_cmp;
  369. function _f_cmpe(Left: FlpFloat; Right: FlpFloat): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_f_cmpe;
  370. function _f_feq(Left: FlpFloat; Right: FlpFloat): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_f_feq;
  371. function _f_fne(Left: FlpFloat; Right: FlpFloat): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_f_fne;
  372. function _f_flt(Left: FlpFloat; Right: FlpFloat): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_f_flt;
  373. function _f_fle(Left: FlpFloat; Right: FlpFloat): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_f_fle;
  374. function _f_fgt(Left: FlpFloat; Right: FlpFloat): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_f_fgt;
  375. function _f_fge(Left: FlpFloat; Right: FlpFloat): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_f_fge;
  376. function _f_fun(Left: FlpFloat; Right: FlpFloat): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_f_fun;
  377. function _f_for(Left: FlpFloat; Right: FlpFloat): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_f_for;
  378. function _d_cmp(Left: FlpDouble; Right: FlpDouble): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_d_cmp;
  379. function _d_cmpe(Left: FlpDouble; Right: FlpDouble): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_d_cmpe;
  380. function _d_feq(Left: FlpDouble; Right: FlpDouble): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_d_feq;
  381. function _d_fne(Left: FlpDouble; Right: FlpDouble): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_d_fne;
  382. function _d_flt(Left: FlpDouble; Right: FlpDouble): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_d_flt;
  383. function _d_fle(Left: FlpDouble; Right: FlpDouble): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_d_fle;
  384. function _d_fgt(Left: FlpDouble; Right: FlpDouble): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_d_fgt;
  385. function _d_fge(Left: FlpDouble; Right: FlpDouble): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_d_fge;
  386. function _d_fun(Left: FlpDouble; Right: FlpDouble): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_d_fun;
  387. function _d_for(Left: FlpDouble; Right: FlpDouble): Int32; syscall sysTrapFlpEmDispatch, sysFloatEm_d_for;
  388. function _f_neg(Value: FlpFloat): FlpFloat; syscall sysTrapFlpEmDispatch, sysFloatEm_f_neg;
  389. function _f_add(Left: FlpFloat; Right: FlpFloat): FlpFloat; syscall sysTrapFlpEmDispatch, sysFloatEm_f_add;
  390. function _f_mul(Left: FlpFloat; Right: FlpFloat): FlpFloat; syscall sysTrapFlpEmDispatch, sysFloatEm_f_mul;
  391. function _f_sub(Left: FlpFloat; Right: FlpFloat): FlpFloat; syscall sysTrapFlpEmDispatch, sysFloatEm_f_sub;
  392. function _f_div(Left: FlpFloat; Right: FlpFloat): FlpFloat; syscall sysTrapFlpEmDispatch, sysFloatEm_f_div;
  393. function _d_neg(Value: FlpDouble): FlpDouble; syscall sysTrapFlpEmDispatch, sysFloatEm_d_neg;
  394. function _d_add(Left: FlpDouble; Right: FlpDouble): FlpDouble; syscall sysTrapFlpEmDispatch, sysFloatEm_d_add;
  395. function _d_mul(Left: FlpDouble; Right: FlpDouble): FlpDouble; syscall sysTrapFlpEmDispatch, sysFloatEm_d_mul;
  396. function _d_sub(Left: FlpDouble; Right: FlpDouble): FlpDouble; syscall sysTrapFlpEmDispatch, sysFloatEm_d_sub;
  397. function _d_div(Left: FlpDouble; Right: FlpDouble): FlpDouble; syscall sysTrapFlpEmDispatch, sysFloatEm_d_div;
  398. implementation
  399. end.