From: "Mike Uhler" <uhler@mips.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linux/MIPS Development <linux-mips@linux-mips.org>
Cc: uhler@mips.com
Subject: Re: unaligned load in branch delay slot
Date: Mon, 13 Jan 2003 09:19:45 -0800 [thread overview]
Message-ID: <200301131719.h0DHJkG29389@uhler-linux.mips.com> (raw)
In-Reply-To: Your message of "Mon, 13 Jan 2003 17:13:17 +0100." <Pine.GSO.4.21.0301131704080.21279-100000@vervain.sonytel.be>
> If I print the parameters at label `sigill' in emulate_load_store_insn(), I
> get:
>
> pc 0x80346448 addr 0x83d9f81e ins 0x14600012
>
> And emulate_load_store_insn() gets confused because 0x14600012 is not a
> load/store. 0x14600012 is the branch instruction before the load, not the load
> after the branch instruction! Note that bit 31 of cause (CAUSEF_BD) is not set.
> Some more investigations showed that the branch is indeed not taken.
>
> Apparently if an unaligned access happens right after a branch which is not
> taking, epc points to the branch instruction, and CAUSEF_BD is not set
> (technically speaking, this is not a branch delay, since the branch is not
> taken :-). Is this expected behavior? The CPU is a VR4120A core.
>
> As a workaround, I assume I can just test whether pc points to a branch
> instruction, and increment pc if that's the case?
Prior to the MIPS32/MIPS64 architecture definition, which requires that EPC
point at the branch and the Cause[BD] bit be set on any exception in the
branch delay slot, there were a few CPUs which interpreted the rules in the
manner that you describe. I don't happen to have a VR4120A manual in front
of me, but the behavior you describe could easily be the case of this differnt
interpretation.
/gmu
--
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
Michael Uhler, VP, Systems, Architecture, and Software Products
MIPS Technologies, Inc. Email: uhler@mips.com Pager: uhler_p@mips.com
1225 Charleston Road Voice: (650)567-5025 FAX: (650)567-5225
Mountain View, CA 94043 Mobile: (650)868-6870 Admin: (650)567-5085
WARNING: multiple messages have this Message-ID (diff)
From: "Mike Uhler" <uhler@mips.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linux/MIPS Development <linux-mips@linux-mips.org>, uhler@mips.com
Subject: Re: unaligned load in branch delay slot
Date: Mon, 13 Jan 2003 09:19:45 -0800 [thread overview]
Message-ID: <200301131719.h0DHJkG29389@uhler-linux.mips.com> (raw)
Message-ID: <20030113171945.VlxgQwiWd9v9WZ2pQVWxUa5p6gEWBMIz_0tiEiEWTfI@z> (raw)
In-Reply-To: Your message of "Mon, 13 Jan 2003 17:13:17 +0100." <Pine.GSO.4.21.0301131704080.21279-100000@vervain.sonytel.be>
> If I print the parameters at label `sigill' in emulate_load_store_insn(), I
> get:
>
> pc 0x80346448 addr 0x83d9f81e ins 0x14600012
>
> And emulate_load_store_insn() gets confused because 0x14600012 is not a
> load/store. 0x14600012 is the branch instruction before the load, not the load
> after the branch instruction! Note that bit 31 of cause (CAUSEF_BD) is not set.
> Some more investigations showed that the branch is indeed not taken.
>
> Apparently if an unaligned access happens right after a branch which is not
> taking, epc points to the branch instruction, and CAUSEF_BD is not set
> (technically speaking, this is not a branch delay, since the branch is not
> taken :-). Is this expected behavior? The CPU is a VR4120A core.
>
> As a workaround, I assume I can just test whether pc points to a branch
> instruction, and increment pc if that's the case?
Prior to the MIPS32/MIPS64 architecture definition, which requires that EPC
point at the branch and the Cause[BD] bit be set on any exception in the
branch delay slot, there were a few CPUs which interpreted the rules in the
manner that you describe. I don't happen to have a VR4120A manual in front
of me, but the behavior you describe could easily be the case of this differnt
interpretation.
/gmu
--
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
Michael Uhler, VP, Systems, Architecture, and Software Products
MIPS Technologies, Inc. Email: uhler@mips.com Pager: uhler_p@mips.com
1225 Charleston Road Voice: (650)567-5025 FAX: (650)567-5225
Mountain View, CA 94043 Mobile: (650)868-6870 Admin: (650)567-5085
next prev parent reply other threads:[~2003-01-13 17:20 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-13 16:13 unaligned load in branch delay slot Geert Uytterhoeven
2003-01-13 17:19 ` Mike Uhler [this message]
2003-01-13 17:19 ` Mike Uhler
2003-01-13 18:04 ` Geert Uytterhoeven
2003-01-13 20:12 ` Mike Uhler
2003-01-13 20:12 ` Mike Uhler
2003-01-28 2:39 ` Ralf Baechle
2003-01-28 9:30 ` Geert Uytterhoeven
2003-01-28 11:47 ` Ralf Baechle
2003-01-28 12:27 ` Geert Uytterhoeven
2003-01-29 1:39 ` Brad Parker
2003-01-29 6:40 ` Ralf Baechle
2003-01-28 12:30 ` Maciej W. Rozycki
2003-01-28 12:54 ` Ralf Baechle
2003-01-28 17:53 ` Jun Sun
2003-01-28 19:48 ` Mike Uhler
2003-01-28 19:48 ` Mike Uhler
2003-01-28 21:30 ` [OT] " justinca
2003-01-28 21:39 ` Mike Uhler
2003-01-28 21:39 ` Mike Uhler
2003-01-29 14:25 ` Ralf Baechle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200301131719.h0DHJkG29389@uhler-linux.mips.com \
--to=uhler@mips.com \
--cc=geert@linux-m68k.org \
--cc=linux-mips@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox