OpenCores
URL https://opencores.org/ocsvn/zipcpu/zipcpu/trunk

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [sw/] [zasm/] [zparser.cpp] - Diff between revs 13 and 26

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 13 Rev 26
Line 120... Line 120...
        in  = ((0x4f)<<24)|((cnd&0x07)<<21)|(0<<20)|((a&0x0f)<<16);
        in  = ((0x4f)<<24)|((cnd&0x07)<<21)|(0<<20)|((a&0x0f)<<16);
        in |= (imm & 0x0ffff);
        in |= (imm & 0x0ffff);
        return in;
        return in;
}
}
 
 
ZIPI    ZPARSER::op_mpy(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_mpyu(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        return DBLREGOP(0x4, cnd, imm, b, a);
        return (0x04<<28)|((a&0x0f)<<24)|((cnd&0x7)<<21)|(0<<20)|((b&0x0f)<<16)|(imm & 0x0ffff);
} ZIPI  ZPARSER::op_mpy(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
} ZIPI  ZPARSER::op_mpyu(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
        return IMMOP(0x4, cnd, imm, a);
        return (0x04<<28)|((a&0x0f)<<24)|((cnd&0x7)<<21)|(0<<20)|((0x0f)<<16)|(imm & 0x0ffff);
 
}
 
 
 
ZIPI    ZPARSER::op_mpys(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
 
        return (0x04<<28)|((a&0x0f)<<24)|((cnd&0x7)<<21)|(1<<20)|((b&0x0f)<<16)|(imm & 0x0ffff);
 
} ZIPI  ZPARSER::op_mpys(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
 
        return (0x04<<28)|((a&0x0f)<<24)|((cnd&0x7)<<21)|(1<<20)|((0x0f)<<16)|(imm & 0x0ffff);
}
}
 
 
ZIPI    ZPARSER::op_rol(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_rol(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        return DBLREGOP(0x5, cnd, imm, b, a);
        return DBLREGOP(0x5, cnd, imm, b, a);
} ZIPI  ZPARSER::op_rol(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
} ZIPI  ZPARSER::op_rol(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
Line 149... Line 155...
 
 
 
 
ZIPI    ZPARSER::op_sub(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_sub(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        return DBLREGOP(0x8, cnd, imm, b, a);
        return DBLREGOP(0x8, cnd, imm, b, a);
} ZIPI  ZPARSER::op_sub(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
} ZIPI  ZPARSER::op_sub(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
 
        // While it seems like we might do well replacing a subtract immediate
 
        // with an add of the negative same, the conditions aren't the same
 
        // when doing so.  Hence this is an invalid substitution.
 
        // return IMMOP(0xa, cnd, -imm, a); // Do an add of the negative of imm
        return IMMOP(0x8, cnd, imm, a);
        return IMMOP(0x8, cnd, imm, a);
}
}
 
 
 
 
ZIPI    ZPARSER::op_and(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_and(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.