/src/wrappers/llvm/library/types/llvm_real_type.e

http://github.com/tybor/Liberty · Specman e · 81 lines · 46 code · 13 blank · 22 comment · 0 complexity · 7921f62e39da61f62dd1e54fb0cdb0e0 MD5 · raw file

  1. class LLVM_REAL_TYPE
  2. -- Float: 32bit
  3. -- Double: 64 bit
  4. -- X86: 80 bit
  5. -- fp128: 128bit with 112 bit of mantissa
  6. -- ppc_fp128: 128 bit (two 64 bits)
  7. inherit LLVM_TYPE
  8. create {ANY}
  9. from_external_pointer,
  10. as_float, as_float_in_context,
  11. as_double, as_double_in_context,
  12. as_x86, as_x86_in_context,
  13. with_128bits, with_128bits_in_context
  14. -- TODO: allow creation of fp128 and ppc_fp128
  15. feature {} -- Creation
  16. as_float
  17. do
  18. handle := llvmfloat_type
  19. end
  20. as_float_in_context (a_context: LLVM_CONTEXT)
  21. require a_context/=Void
  22. do
  23. handle:=llvmfloat_type_in_context(a_context.handle)
  24. end
  25. as_double
  26. do
  27. handle := llvmdouble_type
  28. end
  29. with_128bits
  30. do
  31. handle := llvmfp128type
  32. end
  33. with_128bits_in_context (a_context: LLVM_CONTEXT)
  34. require a_context/=Void
  35. do
  36. handle:=llvmfp128type_in_context(a_context.handle)
  37. end
  38. as_double_in_context (a_context: LLVM_CONTEXT)
  39. require a_context/=Void
  40. do
  41. handle:=llvmdouble_type_in_context(a_context.handle)
  42. end
  43. as_x86
  44. do
  45. handle := llvmx86fp80type
  46. end
  47. as_x86_in_context (a_context: LLVM_CONTEXT)
  48. require a_context/=Void
  49. do
  50. handle:=llvmx86fp80type_in_context(a_context.handle)
  51. end
  52. -- TODO: write a correct invariant type.is_real_type_kind
  53. end -- class LLVM_REAL_TYPE
  54. -- Copyright (C) 2009-2017: Paolo Redaelli
  55. -- This file is part of LLVM wrappers for Liberty Eiffel.
  56. --
  57. -- This library is free software: you can redistribute it and/or modify
  58. -- it under the terms of the GNU Lesser General Public License as published by
  59. -- the Free Software Foundation, version 3 of the License.
  60. --
  61. -- Liberty Eiffel is distributed in the hope that it will be useful,
  62. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  63. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  64. -- GNU General Public License for more details.
  65. --
  66. -- You should have received a copy of the GNU General Public License
  67. -- along with Liberty Eiffel. If not, see <http://www.gnu.org/licenses/>.
  68. --