diff options
author | Andrew Cagney <cagney@redhat.com> | 1997-09-19 06:39:21 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1997-09-19 06:39:21 +0000 |
commit | a276b6f057a0f2a6e1432117a55614d3df6148f5 (patch) | |
tree | 99ff3385e8fb5a0c469b287f1bc4d91f0c66b0c3 /sim/v850/v850.igen | |
parent | 4410c4b9254f6b29bab904a01cddd0ded8f51365 (diff) | |
download | gdb-a276b6f057a0f2a6e1432117a55614d3df6148f5.zip gdb-a276b6f057a0f2a6e1432117a55614d3df6148f5.tar.gz gdb-a276b6f057a0f2a6e1432117a55614d3df6148f5.tar.bz2 |
Clean up tracing for Bcond & jmp insns.
Fix computation of disp16 and disp22.
Clean up tracing of sld* insns.
Diffstat (limited to 'sim/v850/v850.igen')
-rw-r--r-- | sim/v850/v850.igen | 228 |
1 files changed, 100 insertions, 128 deletions
diff --git a/sim/v850/v850.igen b/sim/v850/v850.igen index 5ff2dc5..95103ca 100644 --- a/sim/v850/v850.igen +++ b/sim/v850/v850.igen @@ -40,10 +40,9 @@ :cache::unsigned:disp8:ddddddd:(ddddddd << 1) :cache::unsigned:disp8:dddddd:(dddddd << 2) :cache::unsigned:disp9:ddddd,ddd:SEXT32 ((ddddd << 4) + (ddd << 1), 9 - 1) -:cache::unsigned:disp16:dddddddddddddddd:SEXT32 (dddddddddddddddd, 16 - 1) -:cache::unsigned:disp16:ddddddddddddddd:SEXT32 (ddddddddddddddd << 1, 16 - 1) -:cache::unsigned:disp22:dddddd,dddddddddddddddd:SEXT32 ((dddddd << 16) + (dddddddddddddddd << 1), 22 - 1) -:cache::unsigned:disp22:dddddd,ddddddddddddddd:SEXT32 ((dddddd << 16) + (ddddddddddddddd << 2), 22 - 1) +:cache::unsigned:disp16:dddddddddddddddd:EXTEND16 (dddddddddddddddd) +:cache::unsigned:disp16:ddddddddddddddd: EXTEND16 (ddddddddddddddd << 1) +:cache::unsigned:disp22:dddddd,ddddddddddddddd: SEXT32 ((dddddd << 16) + (ddddddddddddddd << 1), 22 - 1) :cache::unsigned:imm5:iiiii:SEXT32 (iiiii, 4) :cache::unsigned:imm6:iiiiii:iiiiii @@ -158,109 +157,13 @@ rrrrr,110110,RRRRR + iiiiiiiiiiiiiiii:VI:::andi // Bcond -// ddddd,1011,ddd,cccc:III:::Bcond -// "b%s<cccc> <disp9>" -// { -// int cond = condition_met (cccc); -// if (cond) -// nia = cia + disp9; -// TRACE_BRANCH1 (cond); -// } - -ddddd,1011,ddd,0000:III:::bv -"bv <disp9>" -{ - COMPAT_1 (OP_580 ()); -} - -ddddd,1011,ddd,0001:III:::bl -"bl <disp9>" -{ - COMPAT_1 (OP_581 ()); -} - -ddddd,1011,ddd,0010:III:::be -"be <disp9>" -{ - COMPAT_1 (OP_582 ()); -} - -ddddd,1011,ddd,0011:III:::bnh -"bnh <disp9>" -{ - COMPAT_1 (OP_583 ()); -} - -ddddd,1011,ddd,0100:III:::bn -"bn <disp9>" -{ - COMPAT_1 (OP_584 ()); -} - -ddddd,1011,ddd,0101:III:::br -"br <disp9>" -{ - COMPAT_1 (OP_585 ()); -} - -ddddd,1011,ddd,0110:III:::blt -"blt <disp9>" -{ - COMPAT_1 (OP_586 ()); -} - -ddddd,1011,ddd,0111:III:::ble -"ble <disp9>" +ddddd,1011,ddd,cccc:III:::Bcond +"b%s<cccc> <disp9>" { - COMPAT_1 (OP_587 ()); -} - -ddddd,1011,ddd,1000:III:::bnv -"bnv <disp9>" -{ - COMPAT_1 (OP_588 ()); -} - -ddddd,1011,ddd,1001:III:::bnl -"bnl <disp9>" -{ - COMPAT_1 (OP_589 ()); -} - -ddddd,1011,ddd,1010:III:::bne -"bne <disp9>" -{ - COMPAT_1 (OP_58A ()); -} - -ddddd,1011,ddd,1011:III:::bh -"bh <disp9>" -{ - COMPAT_1 (OP_58B ()); -} - -ddddd,1011,ddd,1100:III:::bp -"bp <disp9>" -{ - COMPAT_1 (OP_58C ()); -} - -ddddd,1011,ddd,1101:III:::bsa -"bsa <disp9>" -{ - COMPAT_1 (OP_58D ()); -} - -ddddd,1011,ddd,1110:III:::bge -"bge <disp9>" -{ - COMPAT_1 (OP_58E ()); -} - -ddddd,1011,ddd,1111:III:::bgt -"bgt <disp9>" -{ - COMPAT_1 (OP_58F ()); + int cond = condition_met (cccc); + if (cond) + nia = cia + disp9; + TRACE_BRANCH1 (cond); } @@ -589,7 +492,9 @@ rrrrr,11111100000 + wwwww,01101000100:XII:::hsw rrrrr!0,11110,dddddd + ddddddddddddddd,0:V:::jarl "jarl <disp22>, r<reg2>" { - COMPAT_2 (OP_780 ()); + GR[reg2] = nia; + nia = cia + disp22; + TRACE_BRANCH1 (GR[reg2]); } @@ -598,7 +503,7 @@ rrrrr!0,11110,dddddd + ddddddddddddddd,0:V:::jarl 00000000011,RRRRR:I:::jmp "jmp [r<reg1>]" { - nia = GR[reg1]; + nia = GR[reg1] & ~1; TRACE_BRANCH0 (); } @@ -608,14 +513,15 @@ rrrrr!0,11110,dddddd + ddddddddddddddd,0:V:::jarl 0000011110,dddddd + ddddddddddddddd,0:V:::jr "jr <disp22>" { - COMPAT_2 (OP_780 ()); + nia = cia + disp22; + TRACE_BRANCH0 (); } // LD rrrrr,111000,RRRRR + dddddddddddddddd:VII:::ld.b -"ld.b <disp16>[r<reg1>, r<reg2>" +"ld.b <disp16>[r<reg1>], r<reg2>" { COMPAT_2 (OP_700 ()); } @@ -1090,53 +996,119 @@ rrrrr,010100,iiiii:II:::shr // SLD rrrrr,0110,ddddddd:IV:::sld.b +// start-sanitize-v850eq +"sld.bu <disp7>[ep], r<reg2>":(PSW & PSW_US) +// end-sanitize-v850eq "sld.b <disp7>[ep], r<reg2>" { - COMPAT_1 (OP_300 ()); + unsigned32 addr = EP + disp7; + unsigned32 result = load_mem (addr, 1); + /* start-sanitize-v850eq */ + if (PSW & PSW_US) + { + GR[reg2] = result; + TRACE_LD_NAME ("sld.bu", addr, result); + } + else + { +/* end-sanitize-v850eq */ + result = EXTEND8 (result); + GR[reg2] = result; + TRACE_LD (addr, result); +/* start-sanitize-v850eq */ + } +/* end-sanitize-v850eq */ } rrrrr,1000,ddddddd:IV:::sld.h +// start-sanitize-v850eq +"sld.hu <disp8>[ep], r<reg2>":(PSW & PSW_US) +// end-sanitize-v850eq "sld.h <disp8>[ep], r<reg2>" { - COMPAT_1 (OP_400 ()); + unsigned32 addr = EP + disp8; + unsigned32 result = load_mem (addr, 2); + /* start-sanitize-v850eq */ + if (PSW & PSW_US) + { + GR[reg2] = result; + TRACE_LD_NAME ("sld.hu", addr, result); + } + else + { +/* end-sanitize-v850eq */ + result = EXTEND16 (result); + GR[reg2] = result; + TRACE_LD (addr, result); +/* start-sanitize-v850eq */ + } +/* end-sanitize-v850eq */ } rrrrr,1010,dddddd,0:IV:::sld.w "sld.w <disp8>[ep], r<reg2>" { - COMPAT_1 (OP_500 ()); + unsigned32 addr = EP + disp8; + unsigned32 result = load_mem (addr, 4); + GR[reg2] = result; + TRACE_LD (addr, result); } // start-sanitize-v850e rrrrr!0,0000110,dddd:IV:::sld.bu +*v850e +// start-sanitize-v850eq +*v850eq +"sld.b <disp4>[ep], r<reg2>":(PSW & PSW_US) +// end-sanitize-v850eq "sld.bu <disp4>[ep], r<reg2>" { - unsigned long result; - - SAVE_1; - result = load_mem (State.regs[30] + disp4, 1); - + unsigned32 addr = EP + disp4; + unsigned32 result = load_mem (addr, 1); /* start-sanitize-v850eq */ - if (PSW & PSW_US) { - trace_input ("sld.b", OP_LOAD16, 1); - - State.regs[ reg2 ] = EXTEND8 (result); - } else { + if (PSW & PSW_US) + { + result = EXTEND8 (result); + GR[reg2] = result; + TRACE_LD_NAME ("sld.b", addr, result); + } + else + { /* end-sanitize-v850eq */ - trace_input ("sld.bu", OP_LOAD16, 1); - State.regs[ reg2 ] = result; + GR[reg2] = result; + TRACE_LD (addr, result); /* start-sanitize-v850eq */ - } + } /* end-sanitize-v850eq */ - trace_output (OP_LOAD16); } // end-sanitize-v850e // start-sanitize-v850e rrrrr!0,0000111,dddd:IV:::sld.hu +*v850e +// start-sanitize-v850eq +*v850eq +"sld.h <disp5>[ep], r<reg2>":(PSW & PSW_US) +// end-sanitize-v850eq "sld.hu <disp5>[ep], r<reg2>" { - COMPAT_1 (OP_70 ()); + unsigned32 addr = EP + disp5; + unsigned32 result = load_mem (addr, 2); + /* start-sanitize-v850eq */ + if (PSW & PSW_US) + { + result = EXTEND16 (result); + GR[reg2] = result; + TRACE_LD_NAME ("sld.h", addr, result); + } + else + { +/* end-sanitize-v850eq */ + GR[reg2] = result; + TRACE_LD (addr, result); +/* start-sanitize-v850eq */ + } +/* end-sanitize-v850eq */ } // end-sanitize-v850e |