aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/Asmexpand.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-12-17 10:32:47 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2015-12-17 10:32:47 +0100
commit5b9ce1dd0e0f22bd138ac7d43d25abf2f2011c7a (patch)
tree77d823b79ca8f377ff3f1f470475279f496b47fa /powerpc/Asmexpand.ml
parent0af96302ae861e35c7e2dace1182e30be0b67851 (diff)
parent267cb3b2fa4279eb1f313bcdda580c06c4666189 (diff)
downloadcompcert-5b9ce1dd0e0f22bd138ac7d43d25abf2f2011c7a.tar.gz
compcert-5b9ce1dd0e0f22bd138ac7d43d25abf2f2011c7a.zip
Merge branch 'master' of file:///common/repositories/git/tools/compcert
Diffstat (limited to 'powerpc/Asmexpand.ml')
-rw-r--r--powerpc/Asmexpand.ml20
1 files changed, 13 insertions, 7 deletions
diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml
index b50065f7..ca166fd1 100644
--- a/powerpc/Asmexpand.ml
+++ b/powerpc/Asmexpand.ml
@@ -507,16 +507,22 @@ let expand_builtin_inline name args res =
raise (Error "the first argument of __builtin_set_spr must be a constant")
(* Special registers in 32bit hybrid mode *)
| "__builtin_get_spr64", [BA_int n], BR_splitlong(BR(IR rh), BR(IR rl)) ->
- emit (Pmfspr(rl, n));
- emit (Prldicl(rh, rl, _32, _32));
- emit (Prldicl(rl, rl, _0, _32))
+ if Archi.ppc64 then begin
+ emit (Pmfspr(rl, n));
+ emit (Prldicl(rh, rl, _32, _32));
+ emit (Prldicl(rl, rl, _0, _32))
+ end else
+ raise (Error "__builtin_get_spr64 is only supported for PPC64 targets")
| "__builtin_get_spr64", _, _ ->
raise (Error "the argument of __builtin_get_spr64 must be a constant")
| "__builtin_set_spr64", [BA_int n; BA_splitlong(BA(IR ah), BA(IR al))], _ ->
- emit (Prldicr(GPR10, ah, _32, _31));
- emit (Prldicl(al, al, _0, _32));
- emit (Pori(GPR10, al, Cint _0));
- emit (Pmtspr(n, GPR10))
+ if Archi.ppc64 then begin
+ emit (Prldicr(GPR10, ah, _32, _31));
+ emit (Prldicl(al, al, _0, _32));
+ emit (Por(GPR10, GPR10, al));
+ emit (Pmtspr(n, GPR10))
+ end else
+ raise (Error "__builtin_set_spr64 is only supported for PPC64 targets")
| "__builtin_set_spr64", _, _ ->
raise (Error "the first argument of __builtin_set_spr64 must be a constant")
(* Move registers *)