]>
Commit | Line | Data |
---|---|---|
7d5074ff DG |
1 | // Each of the following complex functions can be implemented with a single |
2 | // wasm instruction, so use that implementation rather than the portable | |
3 | // one in libm. | |
4 | ||
5 | #include <complex.h> | |
6 | ||
5ccebd31 DG |
7 | float (crealf)(float _Complex x) { |
8 | return __builtin_crealf(x); | |
7d5074ff DG |
9 | } |
10 | ||
5ccebd31 DG |
11 | double (creal)(double _Complex x) { |
12 | return __builtin_creal(x); | |
7d5074ff DG |
13 | } |
14 | ||
5ccebd31 DG |
15 | long double (creall)(long double _Complex x) { |
16 | return __builtin_creall(x); | |
7d5074ff DG |
17 | } |
18 | ||
5ccebd31 DG |
19 | float (cimagf)(float _Complex x) { |
20 | return __builtin_cimagf(x); | |
21 | } | |
22 | ||
23 | double (cimag)(double _Complex x) { | |
24 | return __builtin_cimag(x); | |
25 | } | |
26 | ||
27 | long double (cimagl)(long double _Complex x) { | |
28 | return __builtin_cimagl(x); | |
7d5074ff | 29 | } |