aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/Asmexpand.ml
diff options
context:
space:
mode:
Diffstat (limited to 'powerpc/Asmexpand.ml')
-rw-r--r--powerpc/Asmexpand.ml10
1 files changed, 8 insertions, 2 deletions
diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml
index da229d0b..fc787a35 100644
--- a/powerpc/Asmexpand.ml
+++ b/powerpc/Asmexpand.ml
@@ -554,14 +554,20 @@ let expand_builtin_inline name args res =
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")
+ if Archi.ppc64 then
+ raise (Error "the argument of __builtin_get_spr64 must be a constant")
+ else
+ raise (Error "__builtin_get_spr64 is only supported for PPC64 targets")
| "__builtin_set_spr64", [BA_int n; BA(IR a)], _ ->
if Archi.ppc64 then
emit (Pmtspr(n, a))
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")
+ if Archi.ppc64 then
+ raise (Error "the first argument of __builtin_set_spr64 must be a constant")
+ else
+ raise (Error "__builtin_set_spr64 is only supported for PPC64 targets")
(* Move registers *)
| "__builtin_mr", [BA_int dst; BA_int src], _ ->
(match int_to_int_reg (Z.to_int dst), int_to_int_reg (Z.to_int src) with