aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/PrintOp.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@college-de-france.fr>2019-04-14 10:47:14 +0200
committerXavier Leroy <xavierleroy@users.noreply.github.com>2019-05-20 18:00:46 +0200
commit43e7b6702a76306f20687bc9aba93ae465d6e4be (patch)
tree48531b9f57986b01315d2b3f87f8ac43b72c4c42 /powerpc/PrintOp.ml
parent72ab6ad1dcf13dd61d3bdb896660b0f399e9f8a5 (diff)
downloadcompcert-kvx-43e7b6702a76306f20687bc9aba93ae465d6e4be.tar.gz
compcert-kvx-43e7b6702a76306f20687bc9aba93ae465d6e4be.zip
Implement a `Osel` operation for PowerPC
This operation compiles down to an `isel` instruction (conditional move). The semantics is given by `Val.select`.
Diffstat (limited to 'powerpc/PrintOp.ml')
-rw-r--r--powerpc/PrintOp.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/powerpc/PrintOp.ml b/powerpc/PrintOp.ml
index cffaafdb..8d7f17ab 100644
--- a/powerpc/PrintOp.ml
+++ b/powerpc/PrintOp.ml
@@ -110,6 +110,10 @@ let print_operation reg pp = function
| Olowlong, [r1] -> fprintf pp "lowlong(%a)" reg r1
| Ohighlong, [r1] -> fprintf pp "highlong(%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
| Olongconst n, [] -> fprintf pp "%LdL" (camlint64_of_coqint n)
| Ocast32signed, [r1] -> fprintf pp "int32signed(%a)" reg r1
| Ocast32unsigned, [r1] -> fprintf pp "int32unsigned(%a)" reg r1