diff options
| author | Saleem Abdulrasool <compnerd@compnerd.org> | 2015-10-07 02:58:07 +0000 |
|---|---|---|
| committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2015-10-07 02:58:07 +0000 |
| commit | b0b7c8a8dd2d6800886a7eff5605c3af0ae37811 (patch) | |
| tree | de673f645136feff020be731f6853a1934f90c4c /compiler-rt/lib/builtins/muldc3.c | |
| parent | 71c47e5a86e52131d76d134eb9edf418e68db663 (diff) | |
| download | bcm5719-llvm-b0b7c8a8dd2d6800886a7eff5605c3af0ae37811.tar.gz bcm5719-llvm-b0b7c8a8dd2d6800886a7eff5605c3af0ae37811.zip | |
builtins: emulate _Complex for cl
cl does not support C99 completely as of VS2015. Emulate _Complex to allow
building with MSVC.
Patch by Tee Hao Wei!
llvm-svn: 249514
Diffstat (limited to 'compiler-rt/lib/builtins/muldc3.c')
| -rw-r--r-- | compiler-rt/lib/builtins/muldc3.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler-rt/lib/builtins/muldc3.c b/compiler-rt/lib/builtins/muldc3.c index 3bfae2c5222..16d8e98390a 100644 --- a/compiler-rt/lib/builtins/muldc3.c +++ b/compiler-rt/lib/builtins/muldc3.c @@ -17,17 +17,17 @@ /* Returns: the product of a + ib and c + id */ -COMPILER_RT_ABI double _Complex +COMPILER_RT_ABI Dcomplex __muldc3(double __a, double __b, double __c, double __d) { double __ac = __a * __c; double __bd = __b * __d; double __ad = __a * __d; double __bc = __b * __c; - double _Complex z; - __real__ z = __ac - __bd; - __imag__ z = __ad + __bc; - if (crt_isnan(__real__ z) && crt_isnan(__imag__ z)) + Dcomplex z; + COMPLEX_REAL(z) = __ac - __bd; + COMPLEX_IMAGINARY(z) = __ad + __bc; + if (crt_isnan(COMPLEX_REAL(z)) && crt_isnan(COMPLEX_IMAGINARY(z))) { int __recalc = 0; if (crt_isinf(__a) || crt_isinf(__b)) @@ -65,8 +65,8 @@ __muldc3(double __a, double __b, double __c, double __d) } if (__recalc) { - __real__ z = CRT_INFINITY * (__a * __c - __b * __d); - __imag__ z = CRT_INFINITY * (__a * __d + __b * __c); + COMPLEX_REAL(z) = CRT_INFINITY * (__a * __c - __b * __d); + COMPLEX_IMAGINARY(z) = CRT_INFINITY * (__a * __d + __b * __c); } } return z; |

