[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 571924b 7/7: Drop support for an ancient non-
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 571924b 7/7: Drop support for an ancient non-free compiler |
Date: |
Thu, 5 Jan 2017 03:41:39 +0000 (UTC) |
branch: master
commit 571924bbc8f29c3002e28e4ee3f1c3f2c3269d22
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Drop support for an ancient non-free compiler
---
fenv_lmi.cpp | 42 ++++--------------------------------------
1 file changed, 4 insertions(+), 38 deletions(-)
diff --git a/fenv_lmi.cpp b/fenv_lmi.cpp
index 6cc1e25..889f88c 100644
--- a/fenv_lmi.cpp
+++ b/fenv_lmi.cpp
@@ -76,15 +76,7 @@ void fenv_initialize()
e_ieee754_precision fenv_precision()
{
-#if defined __BORLANDC__
- unsigned short int pc = (unsigned short int)(MCW_PC) & x87_control_word();
- return
- (PC_24 == pc) ? fe_fltprec
- : (PC_53 == pc) ? fe_dblprec
- : (PC_64 == pc) ? fe_ldblprec
- : throw std::runtime_error("Failed to determine hardware precision.")
- ;
-#elif defined LMI_X87
+#if defined LMI_X87
e_x87_precision pc = intel_control_word(x87_control_word()).pc();
return
(x87_fe_fltprec == pc) ? fe_fltprec
@@ -101,15 +93,7 @@ e_ieee754_precision fenv_precision()
void fenv_precision(e_ieee754_precision precision_mode)
{
-#if defined __BORLANDC__
- unsigned short int z =
- (fe_fltprec == precision_mode) ? (unsigned short int)(PC_24)
- : (fe_dblprec == precision_mode) ? (unsigned short int)(PC_53)
- : (fe_ldblprec == precision_mode) ? (unsigned short int)(PC_64)
- : throw std::runtime_error("Failed to set hardware precision.")
- ;
- _control87(z, MCW_PC);
-#elif defined LMI_X87
+#if defined LMI_X87
e_x87_precision pc =
(fe_fltprec == precision_mode) ? x87_fe_fltprec
: (fe_dblprec == precision_mode) ? x87_fe_dblprec
@@ -126,16 +110,7 @@ void fenv_precision(e_ieee754_precision precision_mode)
e_ieee754_rounding fenv_rounding()
{
-#if defined __BORLANDC__
- unsigned short int rc = (unsigned short int)(MCW_RC) & x87_control_word();
- return
- (RC_NEAR == rc) ? fe_tonearest
- : (RC_DOWN == rc) ? fe_downward
- : (RC_UP == rc) ? fe_upward
- : (RC_CHOP == rc) ? fe_towardzero
- : throw std::runtime_error("Failed to determine rounding mode.")
- ;
-#elif defined LMI_X87
+#if defined LMI_X87
e_x87_rounding rc = intel_control_word(x87_control_word()).rc();
return
(x87_fe_tonearest == rc) ? fe_tonearest
@@ -158,16 +133,7 @@ e_ieee754_rounding fenv_rounding()
void fenv_rounding(e_ieee754_rounding rounding_mode)
{
-#if defined __BORLANDC__
- unsigned short int z =
- (fe_tonearest == rounding_mode) ? (unsigned short int)(RC_NEAR)
- : (fe_downward == rounding_mode) ? (unsigned short int)(RC_DOWN)
- : (fe_upward == rounding_mode) ? (unsigned short int)(RC_UP)
- : (fe_towardzero == rounding_mode) ? (unsigned short int)(RC_CHOP)
- : throw std::runtime_error("Failed to set rounding mode.")
- ;
- _control87(z, MCW_RC);
-#elif defined LMI_X87
+#if defined LMI_X87
e_x87_rounding rc =
(fe_tonearest == rounding_mode) ? x87_fe_tonearest
: (fe_downward == rounding_mode) ? x87_fe_downward
- [lmi-commits] [lmi] master updated (4cc9f66 -> 571924b), Greg Chicares, 2017/01/04
- [lmi-commits] [lmi] master ae3dc97 3/7: Test for x87, Greg Chicares, 2017/01/04
- [lmi-commits] [lmi] master 73e6bec 1/7: Do not indent top-level preprocessor directives, Greg Chicares, 2017/01/04
- [lmi-commits] [lmi] master ea356b1 4/7: Improve documentation, Greg Chicares, 2017/01/04
- [lmi-commits] [lmi] master 13090e1 2/7: Update reserved-name exceptions in coding rules, Greg Chicares, 2017/01/04
- [lmi-commits] [lmi] master 2c16778 5/7: Refactor to make ensuing changes simpler, Greg Chicares, 2017/01/04
- [lmi-commits] [lmi] master 571924b 7/7: Drop support for an ancient non-free compiler,
Greg Chicares <=
- [lmi-commits] [lmi] master c07baf8 6/7: Conditionalize x87 code; provide <cfenv> alternatives where possible, Greg Chicares, 2017/01/04