tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] [PATCH 7/9] arm-asm: Print a warning if asm_binary_opcode


From: Danny Milosavljevic
Subject: [Tinycc-devel] [PATCH 7/9] arm-asm: Print a warning if asm_binary_opcode is used with SP as operand
Date: Mon, 28 Dec 2020 02:44:11 +0100

---
 arm-asm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arm-asm.c b/arm-asm.c
index d6adc20..028f30c 100644
--- a/arm-asm.c
+++ b/arm-asm.c
@@ -222,6 +222,9 @@ static void asm_binary_opcode(TCCState *s1, int token)
         return;
     }
 
+    if (ops[0].reg == 13)
+        tcc_warning("Using 'sp' as operand with '%s' is deprecated by ARM", 
get_tok_str(token, NULL));
+
     if (ops[1].type != OP_REG32) {
         expect("(source operand) register");
         return;
@@ -232,6 +235,9 @@ static void asm_binary_opcode(TCCState *s1, int token)
         return;
     }
 
+    if (ops[1].reg == 13)
+        tcc_warning("Using 'sp' as operand with '%s' is deprecated by ARM", 
get_tok_str(token, NULL));
+
     if (tok == ',') {
         next(); // skip ','
         if (tok == TOK_ASM_ror) {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]