Commit 9f96ce16 authored by Doug Nazar's avatar Doug Nazar

powerpc: Use extended mnemonic for load immediate

parent 8a025b88
......@@ -100,9 +100,14 @@ powerpc_emit_addi (OrcCompiler *compiler, int regd, int rega, int imm)
{
unsigned int insn;
ORC_ASM_CODE(compiler," addi %s, %s, %d\n",
powerpc_get_regname(regd),
powerpc_get_regname(rega), imm);
if (rega == 0) {
ORC_ASM_CODE(compiler, " li %s, %d\n",
powerpc_get_regname(regd), imm);
} else {
ORC_ASM_CODE(compiler," addi %s, %s, %d\n",
powerpc_get_regname(regd),
powerpc_get_regname(rega), imm);
}
insn = (14<<26) | (powerpc_regnum (regd)<<21) | (powerpc_regnum (rega)<<16);
insn |= imm&0xffff;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment