aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/Asmexpand.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-09-02 17:17:00 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2015-09-02 17:17:00 +0200
commitcfee340dc514e2cfbc5df910f7aa687e78a54d41 (patch)
tree1b6544f0dbbc628ee1b10c191a794c1ef5ab9ab8 /powerpc/Asmexpand.ml
parent30ebbcd0731f680d1d283afb99318fb9d6e9cead (diff)
downloadcompcert-kvx-cfee340dc514e2cfbc5df910f7aa687e78a54d41.tar.gz
compcert-kvx-cfee340dc514e2cfbc5df910f7aa687e78a54d41.zip
Added builtin for the icbtls instruction.
This commit adds a builtin for the icbtls instruction.
Diffstat (limited to 'powerpc/Asmexpand.ml')
-rw-r--r--powerpc/Asmexpand.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml
index caf256ef..43d8fc6e 100644
--- a/powerpc/Asmexpand.ml
+++ b/powerpc/Asmexpand.ml
@@ -368,6 +368,12 @@ let expand_builtin_dcbtls addr loc =
let emit_inst addr = emit (Pdcbtls (loc,addr)) in
expand_builtin_cache_common addr emit_inst
+let expand_builtin_icbtls addr loc =
+ if not ((loc == _0) || (loc = _2)) then
+ raise (Error "the second argument of __builtin_icbtls must be a constant between 0 and 2");
+ let emit_inst addr = emit (Picbtls (loc,addr)) in
+ expand_builtin_cache_common addr emit_inst
+
(* Handling of compiler-inlined builtins *)
let expand_builtin_inline name args res =
@@ -476,6 +482,10 @@ let expand_builtin_inline name args res =
expand_builtin_dcbtls a loc
| "__builtin_dcbtls",_,_ ->
raise (Error "the second argument of __builtin_dcbtls must be a constant")
+ | "__builtin_icbtls", [a; BA_int loc],_ ->
+ expand_builtin_icbtls a loc
+ | "__builtin_icbtls",_,_ ->
+ raise (Error "the second argument of __builtin_icbtls must be a constant")
| "__builtin_prefetch" , [a1 ;BA_int rw; BA_int loc],_ ->
expand_builtin_prefetch a1 rw loc
| "__builtin_prefetch" ,_,_ ->