From 456f991c51021ef42941a6f27b41f4a1de230619 Mon Sep 17 00:00:00 2001 From: sergei Date: Thu, 20 Jun 2013 13:14:38 +0000 Subject: [PATCH] * MIPS: 3-operand forms of DIV and DIVU are not macros if first operand is $zero. git-svn-id: trunk@24918 - --- compiler/mips/cpugas.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/mips/cpugas.pas b/compiler/mips/cpugas.pas index dab32d2c9c..13b5b09aa2 100644 --- a/compiler/mips/cpugas.pas +++ b/compiler/mips/cpugas.pas @@ -241,7 +241,9 @@ unit cpugas; or (op=A_LA) or ((op=A_BC) and not (ai.condition in [C_EQ,C_NE,C_GTZ,C_GEZ,C_LTZ,C_LEZ,C_COP1TRUE,C_COP1FALSE])) {or (op=A_JAL)} or (op=A_REM) or (op=A_REMU) - or (op=A_DIV) or (op=A_DIVU) + { DIV and DIVU are normally macros, but use $zero as first arg to generate a CPU instruction. } + or ((op=A_DIV) or (op=A_DIVU) and + ((ai.ops<>3) or (ai.oper[0]^.typ<>top_reg) or (ai.oper[0]^.reg<>NR_R0))) or (op=A_MULO) or (op=A_MULOU) { A_LI is only a macro if the immediate is not in thez 16-bit range } or (op=A_LI);