From: Doug Nazar Date: Fri, 13 Sep 2019 23:32:24 +0000 (-0400) Subject: powerpc: Fix register order of a few emit helpers X-Git-Tag: orc-0.4.33~109 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d3723a51089f669c79a22f9d6e0ec932c7fb4750;p=platform%2Fupstream%2Forc.git powerpc: Fix register order of a few emit helpers Two emit helpers had their parameters in the wrong location in the generated opcode. Hasn't mattered because they were using the same register for source & dest. Constant flags are now at the end, so the label should be marked forward, not backward. --- diff --git a/orc/orcpowerpc.c b/orc/orcpowerpc.c index e054d07..0b84134 100644 --- a/orc/orcpowerpc.c +++ b/orc/orcpowerpc.c @@ -208,7 +208,7 @@ powerpc_emit_srawi (OrcCompiler *compiler, int regd, int rega, int shift, powerpc_get_regname(regd), powerpc_get_regname(rega), shift); - insn = (31<<26) | (powerpc_regnum (regd)<<21) | (powerpc_regnum (rega)<<16); + insn = (31<<26) | (powerpc_regnum (rega)<<21) | (powerpc_regnum (regd)<<16); insn |= (shift<<11) | (824<<1) | record; powerpc_emit (compiler, insn); @@ -233,7 +233,7 @@ powerpc_emit_D (OrcCompiler *compiler, const char *name, ORC_ASM_CODE(compiler," %s %s, %s, %d\n", name, powerpc_get_regname(regd), powerpc_get_regname(rega), imm); - insn |= (powerpc_regnum (regd)<<21) | (powerpc_regnum (rega)<<16); + insn |= (powerpc_regnum (rega)<<21) | (powerpc_regnum (regd)<<16); insn |= imm&0xffff; powerpc_emit (compiler, insn); @@ -543,7 +543,7 @@ powerpc_load_constant (OrcCompiler *p, int i, int reg) { unsigned int insn; - ORC_ASM_CODE(p," addi %s, %s, %db - %s\n", + ORC_ASM_CODE(p," addi %s, %s, %df - %s\n", powerpc_get_regname(greg), powerpc_get_regname(greg), p->constants[i].label, p->program->name); insn = (14<<26) | (powerpc_regnum (greg)<<21) | (powerpc_regnum (greg)<<16); diff --git a/orc/orcrules-altivec.c b/orc/orcrules-altivec.c index fa40ac3..a17e024 100644 --- a/orc/orcrules-altivec.c +++ b/orc/orcrules-altivec.c @@ -370,8 +370,7 @@ powerpc_rule_storeX (OrcCompiler *compiler, void *user, OrcInstruction *insn) powerpc_regnum(tmp), 0, powerpc_regnum(dest->ptr_register)); - powerpc_emit_D (compiler, "addi", 0x38000000, compiler->gp_tmpreg, - 0, 4); + powerpc_emit_addi (compiler, compiler->gp_tmpreg, 0, 4); ORC_ASM_CODE(compiler," stvewx %s, %s, %s\n", powerpc_get_regname (tmp),