aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/Asmexpand.ml
diff options
context:
space:
mode:
authorMichael Schmidt <github@mschmidt.me>2017-05-03 17:36:53 +0200
committerMichael Schmidt <github@mschmidt.me>2017-05-03 17:36:53 +0200
commit996d8079ef32cbf6c83c458a5df4e548def2d2dc (patch)
treef83c126d7d4c5803a82b61cf04bdc7003af55687 /powerpc/Asmexpand.ml
parent2bbb20db14cba7c2a460f58ae84c2526e3bb35aa (diff)
downloadcompcert-kvx-996d8079ef32cbf6c83c458a5df4e548def2d2dc.tar.gz
compcert-kvx-996d8079ef32cbf6c83c458a5df4e548def2d2dc.zip
bug 20956, print correct error message depending on architecture
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