Skip to content

Commit f6ccfce

Browse files
2 parents ecc3557 + 71e8965 commit f6ccfce

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Then 'Quadmath_examples' will be listed in the JuliaBox home screen. The example
2020
+ `ccall` does not treat parameters and returning values of Julia type `Float128` as C type `__float128` as it would
2121
be appropriate.
2222

23-
Unfortunately, this is a bug which cannot easily be fixed.
23+
Unfortunately, this is a bug which cannot easily be fixed without modifying the internals of Julia.
2424
The [x86-64 Application Binary Interface](http://www.x86-64.org/documentation.html)
2525
says that parameters and returning values of type `__float128` should be passed preferably in the (128 bit long) SSE floating point registers `xmm0`,...,`xmm7`. However, for the datatype `Float128` defined as
2626
```julia
@@ -36,8 +36,9 @@ Then 'Quadmath_examples' will be listed in the JuliaBox home screen. The example
3636
```
3737
in C.
3838

39-
A remedy is to implement a wrapper function for each external function with `__float128` parameters or return values,
40-
that you want to call by `ccall`. Such a wrapper takes parameters `x` of type `myfloat128` declared as
39+
As a remedy, you can implement a wrapper function for each external function with `__float128` parameters
40+
or return values, that you want to call with `ccall`. Such a wrapper takes parameters `x` of type
41+
`myfloat128` declared as
4142
```c
4243
typedef union
4344
{
@@ -49,7 +50,7 @@ Then 'Quadmath_examples' will be listed in the JuliaBox home screen. The example
4950
} words64;
5051
} myfloat128;
5152
```
52-
and calls the original function with `x.value` as actual parameter for the coorresponding formal parameter of type
53+
and calls the original function with `x.value` as actual parameter for the corresponding formal parameter of type
5354
`__float128`.
5455
This is exactly the technique we use in
5556
[quadmath_wrapper.c](https://github.com/HaraldHofstaetter/Quadmath.jl/blob/master/deps/src/quadmath_wrapper.c)

0 commit comments

Comments
 (0)