diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2019-04-15 15:21:49 +0200 |
---|---|---|
committer | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2019-05-20 18:00:46 +0200 |
commit | 996f2e071baaf52105714283d141af2eac8ffbfb (patch) | |
tree | 0d3968e7cb130b2399fe53a30ac7b3b6405d2284 /x86/PrintOp.ml | |
parent | d002919334e83904447957f666f0d48704c5e55b (diff) | |
download | compcert-996f2e071baaf52105714283d141af2eac8ffbfb.tar.gz compcert-996f2e071baaf52105714283d141af2eac8ffbfb.zip |
Implement a `Osel` operation for x86
The operation compiles down to conditional moves.
Diffstat (limited to 'x86/PrintOp.ml')
-rw-r--r-- | x86/PrintOp.ml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/x86/PrintOp.ml b/x86/PrintOp.ml index faa5bb5f..6aa4d450 100644 --- a/x86/PrintOp.ml +++ b/x86/PrintOp.ml @@ -164,6 +164,10 @@ let print_operation reg pp = function | Olongofsingle, [r1] -> fprintf pp "longofsingle(%a)" reg r1 | Osingleoflong, [r1] -> fprintf pp "singleoflong(%a)" reg r1 | Ocmp c, args -> print_condition reg pp (c, args) + | Osel (c, ty), r1::r2::args -> + fprintf pp "%a ?%s %a : %a" + (print_condition reg) (c, args) + (PrintAST.name_of_type ty) reg r1 reg r2 | _ -> fprintf pp "<bad operator>" |