Home | History | Annotate | Download | only in sljit_src

Lines Matching refs:compiler

4  *    Stack-less Just-In-Time compiler
44 push_inst(compiler, RLDI(reg, reg, 63 - shift, shift, 1))
46 static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 reg, sljit_sw imm)
54 return push_inst(compiler, ADDI | D(reg) | A(0) | IMM(imm));
57 return push_inst(compiler, ORI | S(TMP_ZERO) | A(reg) | IMM(imm));
60 FAIL_IF(push_inst(compiler, ADDIS | D(reg) | A(0) | IMM(imm >> 16)));
61 return (imm & 0xffff) ? push_inst(compiler, ORI | S(reg) | A(reg) | IMM(imm)) : SLJIT_SUCCESS;
72 FAIL_IF(push_inst(compiler, ADDI | D(reg) | A(0) | IMM(tmp >> 48)));
78 FAIL_IF(push_inst(compiler, ADDIS | D(reg) | A(0) | IMM(tmp >> 48)));
79 FAIL_IF(push_inst(compiler, ORI | S(reg) | A(reg) | IMM(tmp >> 32)));
89 FAIL_IF(push_inst(compiler, ADDI | D(reg) | A(0) | IMM(tmp >> 48)));
91 return push_inst(compiler, ORI | S(reg) | A(reg) | tmp2);
95 FAIL_IF(push_inst(compiler, ADDI | D(reg) | A(0) | IMM(tmp >> 48)));
97 FAIL_IF(push_inst(compiler, ORIS | S(reg) | A(reg) | (tmp2 >> 16)));
98 return (imm & 0xffff) ? push_inst(compiler, ORI | S(reg) | A(reg) | IMM(tmp2)) : SLJIT_SUCCESS;
105 FAIL_IF(push_inst(compiler, ADDI | D(reg) | A(0) | IMM(tmp >> 48)));
109 FAIL_IF(push_inst(compiler, ORI | S(reg) | A(reg) | (tmp2 >> 48)));
114 FAIL_IF(push_inst(compiler, ADDIS | D(reg) | A(0) | IMM(imm >> 48)));
115 FAIL_IF(push_inst(compiler, ORI | S(reg) | A(reg) | IMM(imm >> 32)));
117 FAIL_IF(push_inst(compiler, ORIS | S(reg) | A(reg) | IMM(imm >> 16)));
118 return push_inst(compiler, ORI | S(reg) | A(reg) | IMM(imm));
128 FAIL_IF(push_inst(compiler, EXTSW | S(src2) | A(TMP_REG2))); \
135 FAIL_IF(push_inst(compiler, EXTSW | S(src1) | A(TMP_REG1))); \
139 FAIL_IF(push_inst(compiler, EXTSW | S(src2) | A(TMP_REG2))); \
146 FAIL_IF(push_inst(compiler, EXTSW | S(src1) | A(TMP_REG1))); \
150 static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 flags,
158 return push_inst(compiler, OR | S(src2) | A(dst) | B(src2));
166 return push_inst(compiler, EXTSW | S(src2) | A(dst));
167 return push_inst(compiler, INS_CLEAR_LEFT(dst, src2, 0));
179 return push_inst(compiler, EXTSB | S(src2) | A(dst));
180 return push_inst(compiler, INS_CLEAR_LEFT(dst, src2, 24));
183 return push_inst(compiler, EXTSB | S(src2) | A(dst));
194 return push_inst(compiler, EXTSH | S(src2) | A(dst));
195 return push_inst(compiler, INS_CLEAR_LEFT(dst, src2, 16));
205 return push_inst(compiler, NOR | RC(flags) | S(src2) | A(dst) | B(src2));
210 return push_inst(compiler, NEG | OERC(flags) | D(dst) | A(src2));
215 return push_inst(compiler, CNTLZW | RC(flags) | S(src2) | A(dst));
216 return push_inst(compiler, CNTLZD | RC(flags) | S(src2) | A(dst));
222 return push_inst(compiler, ADDI | D(dst) | A(src1) | compiler->imm);
227 return push_inst(compiler, ADDIS | D(dst) | A(src1) | compiler->imm);
232 return push_inst(compiler, ADDIC | D(dst) | A(src1) | compiler->imm);
236 FAIL_IF(push_inst(compiler, ADDI | D(dst) | A(src1) | (compiler->imm & 0xffff)));
237 return push_inst(compiler, ADDIS | D(dst) | A(dst) | (((compiler->imm >> 16) & 0xffff) + ((compiler->imm >> 15) & 0x1)));
240 return push_inst(compiler, ADD | D(dst) | A(src1) | B(src2));
242 return push_inst(compiler, ADDC | OERC(ALT_SET_FLAGS) | D(dst) | A(src1) | B(src2));
246 return push_inst(compiler, ADDE | D(dst) | A(src1) | B(src2));
252 return push_inst(compiler, SUBFIC | D(dst) | A(src1) | compiler->imm);
256 return push_inst(compiler, ((flags & ALT_FORM2) ? CMPI : CMPLI) | CRD(0 | ((flags & ALT_SIGN_EXT) ? 0 : 1)) | A(src1) | compiler->imm);
259 return push_inst(compiler, ((flags & ALT_FORM4) ? CMP : CMPL) | CRD(0 | ((flags & ALT_SIGN_EXT) ? 0 : 1)) | A(src1) | B(src2));
263 FAIL_IF(push_inst(compiler, CMPLI | CRD(0 | ((flags & ALT_SIGN_EXT) ? 0 : 1)) | A(src1) | compiler->imm));
264 return push_inst(compiler, ADDI | D(dst) | A(src1) | (-compiler->imm & 0xffff));
267 FAIL_IF(push_inst(compiler, CMPL | CRD(0 | ((flags & ALT_SIGN_EXT) ? 0 : 1)) | A(src1) | B(src2)));
268 return push_inst(compiler, SUBF | D(dst) | A(src2) | B(src1));
271 return push_inst(compiler, SUBF | D(dst) | A(src2) | B(src1));
273 return push_inst(compiler, SUBFC | OERC(ALT_SET_FLAGS) | D(dst) | A(src2) | B(src1));
277 return push_inst(compiler, SUBFE | D(dst) | A(src2) | B(src1));
282 return push_inst(compiler, MULLI | D(dst) | A(src1) | compiler->imm);
286 return push_inst(compiler, MULLW | OERC(flags) | D(dst) | A(src2) | B(src1));
287 return push_inst(compiler, MULLD | OERC(flags) | D(dst) | A(src2) | B(src1));
292 return push_inst(compiler, ANDI | S(src1) | A(dst) | compiler->imm);
296 return push_inst(compiler, ANDIS | S(src1) | A(dst) | compiler->imm);
298 return push_inst(compiler, AND | RC(flags) | S(src1) | A(dst) | B(src2));
303 return push_inst(compiler, ORI | S(src1) | A(dst) | compiler->imm);
307 return push_inst(compiler, ORIS | S(src1) | A(dst) | compiler->imm);
311 FAIL_IF(push_inst(compiler, ORI | S(src1) | A(dst) | IMM(compiler->imm)));
312 return push_inst(compiler, ORIS | S(dst) | A(dst) | IMM(compiler->imm >> 16));
314 return push_inst(compiler, OR | RC(flags) | S(src1) | A(dst) | B(src2));
319 return push_inst(compiler, XORI | S(src1) | A(dst) | compiler->imm);
323 return push_inst(compiler, XORIS | S(src1) | A(dst) | compiler->imm);
327 FAIL_IF(push_inst(compiler, XORI | S(src1) | A(dst) | IMM(compiler->imm)));
328 return push_inst(compiler, XORIS | S(dst) | A(dst) | IMM(compiler->imm >> 16));
330 return push_inst(compiler, XOR | RC(flags) | S(src1) | A(dst) | B(src2));
336 compiler->imm &= 0x1f;
337 return push_inst(compiler, RLWINM | RC(flags) | S(src1) | A(dst) | (compiler->imm << 11) | ((31 - compiler->imm) << 1));
339 compiler->imm &= 0x3f;
340 return push_inst(compiler, RLDI(dst, src1, compiler->imm, 63 - compiler->imm, 1) | RC(flags));
342 return push_inst(compiler, ((flags & ALT_FORM2) ? SLW : SLD) | RC(flags) | S(src1) | A(dst) | B(src2));
348 compiler->imm &= 0x1f;
349 return push_inst(compiler, RLWINM | RC(flags) | S(src1) | A(dst) | (((32 - compiler->imm) & 0x1f) << 11) | (compiler->imm << 6) | (31 << 1));
351 compiler->imm &= 0x3f;
352 return push_inst(compiler, RLDI(dst, src1, 64 - compiler->imm, compiler->imm, 0) | RC(flags));
354 return push_inst(compiler, ((flags & ALT_FORM2) ? SRW : SRD) | RC(flags) | S(src1) | A(dst) | B(src2));
360 compiler->imm &= 0x1f;
361 return push_inst(compiler, SRAWI | RC(flags) | S(src1) | A(dst) | (compiler->imm << 11));
363 compiler->imm &= 0x3f;
364 return push_inst(compiler, SRADI | RC(flags) | S(src1) | A(dst) | ((compiler->imm & 0x1f) << 11) | ((compiler->imm & 0x20) >> 4));
366 return push_inst(compiler, ((flags & ALT_FORM2) ? SRAW : SRAD) | RC(flags) | S(src1) | A(dst) | B(src2));
373 static SLJIT_INLINE sljit_s32 emit_const(struct sljit_compiler *compiler, sljit_s32 reg, sljit_sw init_value)
375 FAIL_IF(push_inst(compiler, ADDIS | D(reg) | A(0) | IMM(init_value >> 48)));
376 FAIL_IF(push_inst(compiler, ORI | S(reg) | A(reg) | IMM(init_value >> 32)));
378 FAIL_IF(push_inst(compiler, ORIS | S(reg) | A(reg) | IMM(init_value >> 16)));
379 return push_inst(compiler, ORI | S(reg) | A(reg) | IMM(init_value));