From: Ali Saidi Date: Fri, 17 Mar 2006 04:09:01 +0000 (-0500) Subject: clean up condition codes a little bit X-Git-Tag: m5_2.0_beta1~162 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cf942425393dbd7ac3d05a9c94aab5140d0bf617;p=gem5.git clean up condition codes a little bit put back in Tcc code that was deleted in last merge arch/sparc/isa/bitfields.isa: clean up condition codes a little bit --HG-- extra : convert_revision : c554fd5c3ee8cfd6643f69f8351124a7a4b5d9fa --- diff --git a/arch/sparc/isa/bitfields.isa b/arch/sparc/isa/bitfields.isa index 237f0fa64..988f067c6 100644 --- a/arch/sparc/isa/bitfields.isa +++ b/arch/sparc/isa/bitfields.isa @@ -7,13 +7,11 @@ // simply defined alphabetically def bitfield A <29>; -def bitfield CC02 <20>; -def bitfield CC03 <25>; -def bitfield CC04 <11>; -def bitfield CC12 <21>; -def bitfield CC13 <26>; -def bitfield CC14 <12>; -def bitfield CC2 <18>; +def bitfield BPCC <21:20>; // for BPcc & FBPcc +def bitfield FCMPCC <26:56>; // for FCMP & FCMPEa +def bitflied FMOVCC <13:11>; // for FMOVcc +def bitfield CC <12:11>; // for MOVcc & Tcc +def bitfierd MOVCC3 <18>; // also for MOVcc def bitfield CMASK <6:4>; def bitfield COND2 <28:25>; def bitfield COND4 <17:14>; diff --git a/arch/sparc/isa/decoder.isa b/arch/sparc/isa/decoder.isa index 14280ef12..2b5296eed 100644 --- a/arch/sparc/isa/decoder.isa +++ b/arch/sparc/isa/decoder.isa @@ -10,7 +10,7 @@ decode OP default Unknown::unknown() //Throw an illegal instruction acception 0x0: Trap::illtrap({{fault = new IllegalInstruction;}}); 0x1: Branch::bpcc({{ - switch((CC12 << 1) | CC02) + switch(BPCC) { case 1: case 3: @@ -387,7 +387,7 @@ decode OP default Unknown::unknown() } 0x2B: BasicOperate::flushw({{\\window toilet}}); //FLUSHW 0x2C: movcc({{ - ccBank = (CC24 << 2) | (CC14 << 1) | (CC04 << 0); + ccBank = (MOVCC3 << 2) | CC; switch(ccBank) { case 0: case 1: case 2: case 3: @@ -511,20 +511,30 @@ decode OP default Unknown::unknown() 0x38: Branch::jmpl({{//Stuff}}); //JMPL 0x39: Branch::return({{//Other Stuff}}); //RETURN - 0x3A: decode CC04 + 0x3A: decode CC { - // If CC04 == 1, it's an illegal instruction - 0x0: decode CC14 - { - 0x0: Trap::tcci({{ - if(passesCondition(ccr_icc, machInst<25:28>)) - fault = new TrapInstruction; - }}); - 0x1: Trap::tccx({{ - if(passesCondition(ccr_xcc, machInst<25:28>)) - fault = new TrapInstruction; - }}); - } + 0x0: Trap::tcci({{ +#if FULL_SYSTEM + fault = new TrapInstruction; +#else + if(passesCondition(ccr_icc, machInst<25:28>)) + // At least glibc only uses trap 0, + // solaris/sunos may use others + assert((I ? Rs1 + Rs2 : Rs1 + SW_TRAP) == 0); + xc->syscall(); +#endif + }}); + 0x2: Trap::tccx({{ +#if FULL_SYSTEM + fault = new TrapInstruction; +#else + if(passesCondition(ccr_xcc, machInst<25:28>)) + // At least glibc only uses trap 0, + // solaris/sunos may use others + assert((I ? Rs1 + Rs2 : Rs1 + SW_TRAP) == 0); + xc->syscall(); +#endif + }}); } 0x3B: BasicOperate::flush({{//Lala}}); //FLUSH 0x3C: BasicOperate::save({{//leprechauns); //SAVE