From: Francesco VIRLINZI <francesco.virlinzi@st.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH][RFC] sh: suspend interpreter V1
Date: Tue, 24 Mar 2009 07:00:20 +0000 [thread overview]
Message-ID: <49C88504.2030505@st.com> (raw)
In-Reply-To: <20090323091739.25647.6773.sendpatchset@rx1.opensource.se>
Hi Magnus
> Hi Magnus
> I think I understood how your system works.
>
> Tell me if I'm wrong...
>
> It seems all your instructions accepts zero of at least one argument
> and all the ' 1: bra 1f' are used to preload.
>
> The main issue, I see, is that there is no conditional statement
> possible.
>
> I tryed to build something like:
>
> void while_eq(unsigned long *add, unsigned long mask, unsigned long addr)
> {
> for (; ((*add) & mask) != value; );
> }
>
> but
>
> sh_pm_op(info, SH_PM_OP_MOV_MEM32_R0, _ADDR_);
> sh_pm_op(info, SH_PM_OP_AND_IMM_R0, _MASK_);
> sh_pm_op(info, SH_PM_OP_CMP_R0, _VALUE));
> sh_pm_op(info, SH_PM_OP_BT, __LABEL__);
>
> On 'SH_PM_OP_CMP_R0' it isn't really a problem... It could be build
> like the other instruction...
>
> While on 'SH_PM_OP_BT' it could be a problem because we don't know the
> 'label' address... but I think it
> could be resolved if the sh_pm_op() instead of void returns the
> address of just assembled operation
> therefore I should be able to build something like:
>
> addr = sh_pm_op(info, SH_PM_OP_MOV_MEM32_R0, _ADDR_);
> sh_pm_op(info, SH_PM_OP_AND_IMM_R0, _MASK_);
> sh_pm_op(info, SH_PM_OP_CMP_R0, _VALUE));
> sh_pm_op(info, SH_PM_OP_BT, addr); /* to jump backward... */
>
> Something similar could be done to jump forward... also in this case
> the 'jump' should
> be marked in a first phase as incomplete... and resolved when all
> the code is built.
>
> At least in a first release the jump forward could be not supported.
I was thinking that the jump forward could be closed with a function:
void sh_pm_set_data(unsigned long *addr, unsigned long data); /* to set
the data field in the instruction*/
In this manner
a jump forward could be done with:
jump_addr = sh_pm_op(info, SH_PM_OP_BT, 0); /* to jump forward... zero
doesn't matter*/
...
...
jump_target = sh_pm_op(info, ....);
sh_pm_set_data(jump_addr, jump_target); /* to set the right data value
in the previous jump */
In this manner both the jumps are supported.
And with an ADD or a SUB instruction also some delay can be built on top
of these instructions.
Let me know.
Regards
Francesco
next prev parent reply other threads:[~2009-03-24 7:00 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-23 9:17 [PATCH][RFC] sh: suspend interpreter V1 Magnus Damm
2009-03-23 15:35 ` Francesco VIRLINZI
2009-03-24 7:00 ` Francesco VIRLINZI [this message]
2009-03-24 11:08 ` Magnus Damm
2009-03-24 13:41 ` Francesco VIRLINZI
2009-03-25 10:10 ` Magnus Damm
2009-03-25 14:46 ` takasi-y
2009-03-30 2:45 ` Magnus Damm
2009-03-30 7:02 ` Francesco VIRLINZI
2009-03-31 8:42 ` Paul Mundt
2009-04-15 11:15 ` Magnus Damm
2009-04-15 11:23 ` Paul Mundt
2009-04-16 14:15 ` Francesco VIRLINZI
2009-04-16 14:22 ` Francesco VIRLINZI
2009-04-17 2:07 ` Magnus Damm
2009-04-17 6:44 ` Francesco VIRLINZI
2009-04-17 10:39 ` Magnus Damm
2009-04-17 12:00 ` Francesco VIRLINZI
2009-04-17 21:38 ` Jean-Christophe PLAGNIOL-VILLARD
2009-04-20 10:26 ` Magnus Damm
2009-04-20 12:27 ` Jean-Christophe PLAGNIOL-VILLARD
2009-04-20 12:33 ` Francesco VIRLINZI
2009-04-20 12:55 ` Francesco VIRLINZI
2009-04-20 13:03 ` Jean-Christophe PLAGNIOL-VILLARD
2009-04-20 13:15 ` Jean-Christophe PLAGNIOL-VILLARD
2009-04-20 13:30 ` Michael Trimarchi
2009-04-21 7:17 ` Francesco VIRLINZI
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=49C88504.2030505@st.com \
--to=francesco.virlinzi@st.com \
--cc=linux-sh@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.