Line 58... |
Line 58... |
|
|
#define DBLREGOP(OP,CND,IMM,B,A) (((OP&0x01f)<<22)|((A&0x0f)<<27) \
|
#define DBLREGOP(OP,CND,IMM,B,A) (((OP&0x01f)<<22)|((A&0x0f)<<27) \
|
|((CND&0x07)<<19)|(1<<18)|((B&0x0f)<<14) \
|
|((CND&0x07)<<19)|(1<<18)|((B&0x0f)<<14) \
|
| (IMM & 0x03fff))
|
| (IMM & 0x03fff))
|
|
|
|
#define LONG_MPY
|
|
|
|
ZPARSER::ZIPIMM ZPARSER::brev(ZIPIMM v) const {
|
|
unsigned r=0, b;
|
|
|
|
for(b=0; b<32; b++, v>>=1)
|
|
r = (r<<1)|(v&1);
|
|
|
|
return r;
|
|
}
|
|
|
ZIPI ZPARSER::op_cmp(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
|
ZIPI ZPARSER::op_cmp(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
|
return DBLREGOP(ZIPO_CMP, cnd, imm, b, a);
|
return DBLREGOP(ZIPO_CMP, cnd, imm, b, a);
|
}
|
}
|
|
|
ZIPI ZPARSER::op_cmp(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
|
ZIPI ZPARSER::op_cmp(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
|
Line 116... |
Line 127... |
return 0x76400000;
|
return 0x76400000;
|
} ZIPI ZPARSER::op_lock(void) const {
|
} ZIPI ZPARSER::op_lock(void) const {
|
return 0x76800000;
|
return 0x76800000;
|
}
|
}
|
|
|
|
#ifdef LONG_MPY
|
|
ZIPI ZPARSER::op_mpy(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
|
|
return DBLREGOP(ZIPO_MPY, cnd, imm, b, a);
|
|
} ZIPI ZPARSER::op_mpy(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
|
|
return IMMOP(ZIPO_MPY, cnd, imm, a);
|
|
} ZIPI ZPARSER::op_ldihi(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
|
|
ZIPI in = IMMOP(ZIPO_BREV, cnd, brev(imm)&0x0ffff, a);
|
|
return in;
|
|
}
|
|
#else
|
ZIPI ZPARSER::op_ldihi(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
|
ZIPI ZPARSER::op_ldihi(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
|
ZIPI in = IMMOP(ZIPO_LDIHI, cnd, (imm & 0x0ffff), a);
|
ZIPI in = IMMOP(ZIPO_LDIHI, cnd, (imm & 0x0ffff), a);
|
return in;
|
return in;
|
} ZIPI ZPARSER::op_ldilo(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
|
}
|
|
#endif
|
|
ZIPI ZPARSER::op_ldilo(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
|
ZIPI in = IMMOP(ZIPO_LDILO, cnd, (imm & 0x0ffff), a);
|
ZIPI in = IMMOP(ZIPO_LDILO, cnd, (imm & 0x0ffff), a);
|
return in;
|
return in;
|
}
|
}
|
|
|
ZIPI ZPARSER::op_mpyu(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
|
ZIPI ZPARSER::op_mpyu(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
|