diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2022-02-07 15:10:54 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@college-de-france.fr> | 2022-02-07 15:12:20 +0100 |
commit | 38b0425d524cd3e7260ac46e13153f007e8bc00d (patch) | |
tree | 987d9d3c42c6b0d7873115ec00fcdd99a714d7b5 /x86/Asmexpand.ml | |
parent | 87de3969856cf6a5eb5e1615ec817a015ed90d1c (diff) | |
download | compcert-38b0425d524cd3e7260ac46e13153f007e8bc00d.tar.gz compcert-38b0425d524cd3e7260ac46e13153f007e8bc00d.zip |
Add op for float max and min for x86.
The ops `Omaxf` and `Ominf` have the same semantics as `minsd` and
`maxsd` instruction, i.e. if both arguments are equal the second
argument is returned as well as for NaN.
The operations are the used in SelectOp to implement the built-in
function `__builtin_fmax` and `__builtin_fmin`.
Bug 32640
Diffstat (limited to 'x86/Asmexpand.ml')
-rw-r--r-- | x86/Asmexpand.ml | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/x86/Asmexpand.ml b/x86/Asmexpand.ml index a1c24f2d..b76ad3a3 100644 --- a/x86/Asmexpand.ml +++ b/x86/Asmexpand.ml @@ -408,24 +408,6 @@ let expand_builtin_inline name args res = (* Float arithmetic *) | ("__builtin_fsqrt" | "__builtin_sqrt"), [BA(FR a1)], BR(FR res) -> emit (Psqrtsd (res,a1)) - | "__builtin_fmax", [BA(FR a1); BA(FR a2)], BR(FR res) -> - if res = a1 then - emit (Pmaxsd (res,a2)) - else if res = a2 then - emit (Pmaxsd (res,a1)) - else begin - emit (Pmovsd_ff (res,a1)); - emit (Pmaxsd (res,a2)) - end - | "__builtin_fmin", [BA(FR a1); BA(FR a2)], BR(FR res) -> - if res = a1 then - emit (Pminsd (res,a2)) - else if res = a2 then - emit (Pminsd (res,a1)) - else begin - emit (Pmovsd_ff (res,a1)); - emit (Pminsd (res,a2)) - end | "__builtin_fmadd", _, _ -> expand_fma args res (fun r1 r2 r3 -> Pfmadd132(r1, r2, r3)) |