summaryrefslogtreecommitdiff
path: root/sljit/sljitNativePPC_32.c
diff options
context:
space:
mode:
authorzherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-01-09 20:12:58 +0000
committerzherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-01-09 20:12:58 +0000
commitf2488124fa9818754bd6c2178b64e3a7874f5de1 (patch)
tree43b2e15637f9abe5e944744418a2b42127f846c8 /sljit/sljitNativePPC_32.c
parent7d9f10d751dfb23d4343c095e1c10ec8a08cf302 (diff)
downloadpcre-f2488124fa9818754bd6c2178b64e3a7874f5de1.tar.gz
rename PCRE_SCHAR16 to PCRE_UCHAR16 and JIT compiler update
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@860 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'sljit/sljitNativePPC_32.c')
-rw-r--r--sljit/sljitNativePPC_32.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/sljit/sljitNativePPC_32.c b/sljit/sljitNativePPC_32.c
index 82be28c..82d0508 100644
--- a/sljit/sljitNativePPC_32.c
+++ b/sljit/sljitNativePPC_32.c
@@ -47,10 +47,12 @@ static SLJIT_INLINE int emit_single_op(struct sljit_compiler *compiler, int op,
switch (op) {
case SLJIT_ADD:
if (flags & ALT_FORM1) {
+ /* Flags does not set: BIN_IMM_EXTS unnecessary. */
SLJIT_ASSERT(src2 == TMP_REG2);
return push_inst(compiler, ADDI | D(dst) | A(src1) | compiler->imm);
}
if (flags & ALT_FORM2) {
+ /* Flags does not set: BIN_IMM_EXTS unnecessary. */
SLJIT_ASSERT(src2 == TMP_REG2);
return push_inst(compiler, ADDIS | D(dst) | A(src1) | compiler->imm);
}
@@ -58,6 +60,11 @@ static SLJIT_INLINE int emit_single_op(struct sljit_compiler *compiler, int op,
SLJIT_ASSERT(src2 == TMP_REG2);
return push_inst(compiler, ADDIC | D(dst) | A(src1) | compiler->imm);
}
+ if (flags & ALT_FORM4) {
+ /* Flags does not set: BIN_IMM_EXTS unnecessary. */
+ FAIL_IF(push_inst(compiler, ADDI | D(dst) | A(src1) | (compiler->imm & 0xffff)));
+ return push_inst(compiler, ADDIS | D(dst) | A(dst) | (((compiler->imm >> 16) & 0xffff) + ((compiler->imm >> 15) & 0x1)));
+ }
if (!(flags & ALT_SET_FLAGS))
return push_inst(compiler, ADD | D(dst) | A(src1) | B(src2));
return push_inst(compiler, ADDC | OERC(ALT_SET_FLAGS) | D(dst) | A(src1) | B(src2));
@@ -72,22 +79,28 @@ static SLJIT_INLINE int emit_single_op(struct sljit_compiler *compiler, int op,
case SLJIT_SUB:
if (flags & ALT_FORM1) {
+ /* Flags does not set: BIN_IMM_EXTS unnecessary. */
SLJIT_ASSERT(src2 == TMP_REG2);
return push_inst(compiler, SUBFIC | D(dst) | A(src1) | compiler->imm);
}
- if (flags & ALT_FORM2) {
+ if (flags & (ALT_FORM2 | ALT_FORM3)) {
SLJIT_ASSERT(src2 == TMP_REG2);
- return push_inst(compiler, CMPI | CRD(0) | A(src1) | compiler->imm);
+ if (flags & ALT_FORM2)
+ FAIL_IF(push_inst(compiler, CMPI | CRD(0) | A(src1) | compiler->imm));
+ if (flags & ALT_FORM3)
+ return push_inst(compiler, CMPLI | CRD(4) | A(src1) | compiler->imm);
+ return SLJIT_SUCCESS;
}
- if (flags & ALT_FORM3) {
- SLJIT_ASSERT(src2 == TMP_REG2);
- return push_inst(compiler, CMPLI | CRD(4) | A(src1) | compiler->imm);
+ if (flags & (ALT_FORM4 | ALT_FORM5)) {
+ if (flags & ALT_FORM4)
+ FAIL_IF(push_inst(compiler, CMPL | CRD(4) | A(src1) | B(src2)));
+ if (flags & ALT_FORM5)
+ FAIL_IF(push_inst(compiler, CMP | CRD(0) | A(src1) | B(src2)));
+ return SLJIT_SUCCESS;
}
- if (flags & ALT_FORM4)
- return push_inst(compiler, CMPL | CRD(4) | A(src1) | B(src2));
if (!(flags & ALT_SET_FLAGS))
return push_inst(compiler, SUBF | D(dst) | A(src2) | B(src1));
- if (flags & ALT_FORM5)
+ if (flags & ALT_FORM6)
FAIL_IF(push_inst(compiler, CMPL | CRD(4) | A(src1) | B(src2)));
return push_inst(compiler, SUBFC | OERC(ALT_SET_FLAGS) | D(dst) | A(src2) | B(src1));