diff options
author | David Schleef <ds@schleef.org> | 2010-08-27 10:45:09 -0700 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2010-08-27 10:45:09 -0700 |
commit | b03424a47b06529eed4e79649a3d50522b7799ed (patch) | |
tree | f63e1327c97c661c296acab6dafe502c08b49bf8 | |
parent | 21cc9b3a1c36619644d640f94f375f25a6c715ac (diff) |
c: Fix code for ldreslinl
-rw-r--r-- | orc/orcemulateopcodes.c | 8 | ||||
-rw-r--r-- | orc/orcprogram-c.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/orc/orcemulateopcodes.c b/orc/orcemulateopcodes.c index c7559d0..d3f75ca 100644 --- a/orc/orcemulateopcodes.c +++ b/orc/orcemulateopcodes.c @@ -533,10 +533,10 @@ emulate_ldreslinl (OrcOpcodeExecutor *ex, int offset, int n) int tmp = ((orc_union32 *)(ex->src_ptrs[1]))->i + (offset + i) * ((orc_union32 *)(ex->src_ptrs[2]))->i; orc_union32 a = ptr4[tmp>>16]; orc_union32 b = ptr4[(tmp>>16)+1]; - var32.x4[0] = a.x4[0] * (256-((tmp>>8)&0xff)) + b.x4[0] * ((tmp>>8)&0xff); - var32.x4[1] = a.x4[1] * (256-((tmp>>8)&0xff)) + b.x4[1] * ((tmp>>8)&0xff); - var32.x4[2] = a.x4[2] * (256-((tmp>>8)&0xff)) + b.x4[2] * ((tmp>>8)&0xff); - var32.x4[3] = a.x4[3] * (256-((tmp>>8)&0xff)) + b.x4[3] * ((tmp>>8)&0xff); + var32.x4[0] = (a.x4[0] * (256-((tmp>>8)&0xff)) + b.x4[0] * ((tmp>>8)&0xff))>>8; + var32.x4[1] = (a.x4[1] * (256-((tmp>>8)&0xff)) + b.x4[1] * ((tmp>>8)&0xff))>>8; + var32.x4[2] = (a.x4[2] * (256-((tmp>>8)&0xff)) + b.x4[2] * ((tmp>>8)&0xff))>>8; + var32.x4[3] = (a.x4[3] * (256-((tmp>>8)&0xff)) + b.x4[3] * ((tmp>>8)&0xff))>>8; } /* 1: storel */ ptr0[i] = var32; diff --git a/orc/orcprogram-c.c b/orc/orcprogram-c.c index e2dbed3..c4eda3b 100644 --- a/orc/orcprogram-c.c +++ b/orc/orcprogram-c.c @@ -840,7 +840,7 @@ c_rule_ldreslinl (OrcCompiler *p, void *user, OrcInstruction *insn) ORC_ASM_CODE(p," orc_union32 a = ptr%d[tmp>>16];\n", insn->src_args[0]); ORC_ASM_CODE(p," orc_union32 b = ptr%d[(tmp>>16)+1];\n", insn->src_args[0]); for (i=0;i<4;i++){ - ORC_ASM_CODE(p," var%d.x4[%d] = a.x4[%d] * (256-((tmp>>8)&0xff)) + b.x4[%d] * ((tmp>>8)&0xff);\n", + ORC_ASM_CODE(p," var%d.x4[%d] = (a.x4[%d] * (256-((tmp>>8)&0xff)) + b.x4[%d] * ((tmp>>8)&0xff))>>8;\n", insn->dest_args[0], i, i, i); } ORC_ASM_CODE(p," }\n"); |