[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v37 05/17] target/avr: Add instruction translation - Arithmet
Re: [PATCH v37 05/17] target/avr: Add instruction translation - Arithmetic and Logic Instructions
Mon, 2 Dec 2019 09:41:51 +0200
I could not find what happens if an instruction with unsupported registers is executed. So, I am leaving this tiny core for later.
On Sun, Dec 1, 2019 at 1:11 AM Aleksandar Markovic <address@hidden
On Saturday, November 30, 2019, Michael Rolnik <address@hidden> wrote:
thanks for pointing that out I was not aware of that.
I can fix it.
Please take alook at this:
It looks that all cases of AVR 16-gpr-registers cores belong to the group "avrtiny10", that actually you may want to add to your solution. Just a hint.
On Sat, Nov 30, 2019 at 6:29 PM Aleksandar Markovic <address@hidden
On Saturday, November 30, 2019, Aleksandar Markovic <address@hidden> wrote:
On Wednesday, November 27, 2019, Michael Rolnik <address@hidden> wrote:
+ * Performs the logical AND between the contents of register Rd and register
+ * Rr and places the result in the destination register Rd.
+static bool trans_AND(DisasContext *ctx, arg_AND *a)
+ TCGv Rd = cpu_r[a->rd];
+ TCGv Rr = cpu_r[a->rr];
+ TCGv R = tcg_temp_new_i32();
+ /* op */
+ tcg_gen_and_tl(R, Rd, Rr); /* Rd = Rd and Rr */
+ /* Vf */
+ tcg_gen_movi_tl(cpu_Vf, 0); /* Vf = 0 */
+ /* Zf */
+ tcg_gen_setcondi_tl(TCG_COND_EQ, cpu_Zf, R, 0); /* Zf = R == 0 */
+ /* R */
+ tcg_gen_mov_tl(Rd, R);
+ return true;
According to specs:
... the chips in question have cores with 16 GPRs (that correspond to GPRs R16-R31 of more common AVR cores with 32 GPRs).
There are more examples;
Also ATtiny20, ATtiny40.
How do you handle such cores?
I don't see here anything preventing usage of all 32 GPRs, resulting, of course, in an inaccurate emulation.
- Re: [PATCH v37 05/17] target/avr: Add instruction translation - Arithmetic and Logic Instructions,
Michael Rolnik <=