From 996d8079ef32cbf6c83c458a5df4e548def2d2dc Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Wed, 3 May 2017 17:36:53 +0200 Subject: bug 20956, print correct error message depending on architecture --- powerpc/Asmexpand.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'powerpc/Asmexpand.ml') 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 -- cgit