* [Qemu-devel] [PULL 0/2] M68k for 2.8 patches @ 2016-10-31 9:50 Laurent Vivier 2016-10-31 9:50 ` [Qemu-devel] [PULL 1/2] target-m68k: add cmpm Laurent Vivier ` (3 more replies) 0 siblings, 4 replies; 10+ messages in thread From: Laurent Vivier @ 2016-10-31 9:50 UTC (permalink / raw) To: qemu-devel; +Cc: Laurent Vivier The following changes since commit 5b2ecabaeabc17f032197246c4846b9ba95ba8a6: Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20161028-1' into staging (2016-10-28 17:59:04 +0100) are available in the git repository at: git@github.com:vivier/qemu-m68k.git tags/m68k-for-2.8-pull-request for you to fetch changes up to b3d2ee9b3a0a03394b0f4f7f8cf4fd018de969b8: target-m68k: add 64bit mull (2016-10-31 10:35:26 +0100) ---------------------------------------------------------------- This two patches are extracted from my last series as they are already reviewed to make them available before the soft-freeze. ---------------------------------------------------------------- Laurent Vivier (2): target-m68k: add cmpm target-m68k: add 64bit mull target-m68k/translate.c | 88 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 76 insertions(+), 12 deletions(-) -- 2.7.4 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] [PULL 1/2] target-m68k: add cmpm 2016-10-31 9:50 [Qemu-devel] [PULL 0/2] M68k for 2.8 patches Laurent Vivier @ 2016-10-31 9:50 ` Laurent Vivier 2016-10-31 9:50 ` [Qemu-devel] [PULL 2/2] target-m68k: add 64bit mull Laurent Vivier ` (2 subsequent siblings) 3 siblings, 0 replies; 10+ messages in thread From: Laurent Vivier @ 2016-10-31 9:50 UTC (permalink / raw) To: qemu-devel; +Cc: Laurent Vivier Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <rth@twiddle.net> --- target-m68k/translate.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/target-m68k/translate.c b/target-m68k/translate.c index ee0ffe3..92e67eb 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -2173,6 +2173,33 @@ DISAS_INSN(cmpa) gen_update_cc_cmp(s, reg, src, opsize); } +DISAS_INSN(cmpm) +{ + int opsize = insn_opsize(insn); + TCGv tmp = tcg_temp_new(); + TCGv src, dst, addr; + + src = gen_load(s, opsize, AREG(insn, 0), 1); + /* delay the update after the second gen_load() */ + tcg_gen_addi_i32(tmp, AREG(insn, 0), opsize_bytes(opsize)); + + /* but if the we use the same address register to + * read the second value, we must use the updated address + */ + if (REG(insn, 0) == REG(insn, 9)) { + addr = tmp; + } else { + addr = AREG(insn, 9); + } + + dst = gen_load(s, opsize, addr, 1); + tcg_gen_mov_i32(AREG(insn, 0), tmp); + tcg_gen_addi_i32(AREG(insn, 9), addr, opsize_bytes(opsize)); + tcg_temp_free(tmp); + + gen_update_cc_cmp(s, dst, src, opsize); +} + DISAS_INSN(eor) { TCGv src; @@ -3414,6 +3441,7 @@ void register_m68k_insns (CPUM68KState *env) INSN(cmpa, b1c0, f1c0, CF_ISA_A); INSN(cmp, b000, f100, M68000); INSN(eor, b100, f100, M68000); + INSN(cmpm, b108, f138, M68000); INSN(cmpa, b0c0, f0c0, M68000); INSN(eor, b180, f1c0, CF_ISA_A); BASE(and, c000, f000); -- 2.7.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PULL 2/2] target-m68k: add 64bit mull 2016-10-31 9:50 [Qemu-devel] [PULL 0/2] M68k for 2.8 patches Laurent Vivier 2016-10-31 9:50 ` [Qemu-devel] [PULL 1/2] target-m68k: add cmpm Laurent Vivier @ 2016-10-31 9:50 ` Laurent Vivier 2016-10-31 13:12 ` [Qemu-devel] [PULL 0/2] M68k for 2.8 patches Laurent Vivier 2016-11-02 17:07 ` Stefan Hajnoczi 3 siblings, 0 replies; 10+ messages in thread From: Laurent Vivier @ 2016-10-31 9:50 UTC (permalink / raw) To: qemu-devel; +Cc: Laurent Vivier Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <rth@twidle.net> --- target-m68k/translate.c | 60 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 92e67eb..75d8c05 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -1812,24 +1812,60 @@ DISAS_INSN(tas) DISAS_INSN(mull) { uint16_t ext; - TCGv reg; TCGv src1; - TCGv dest; + int sign; - /* The upper 32 bits of the product are discarded, so - muls.l and mulu.l are functionally equivalent. */ ext = read_im16(env, s); - if (ext & 0x87ff) { - gen_exception(s, s->pc - 4, EXCP_UNSUPPORTED); + + sign = ext & 0x800; + + if (ext & 0x400) { + if (!m68k_feature(s->env, M68K_FEATURE_QUAD_MULDIV)) { + gen_exception(s, s->pc - 4, EXCP_UNSUPPORTED); + return; + } + + SRC_EA(env, src1, OS_LONG, 0, NULL); + + if (sign) { + tcg_gen_muls2_i32(DREG(ext, 12), DREG(ext, 0), src1, DREG(ext, 12)); + } else { + tcg_gen_mulu2_i32(DREG(ext, 12), DREG(ext, 0), src1, DREG(ext, 12)); + } + + tcg_gen_movi_i32(QREG_CC_V, 0); + tcg_gen_movi_i32(QREG_CC_C, 0); + tcg_gen_mov_i32(QREG_CC_N, DREG(ext, 0)); + tcg_gen_or_i32(QREG_CC_Z, DREG(ext, 12), DREG(ext, 0)); + + set_cc_op(s, CC_OP_FLAGS); return; } - reg = DREG(ext, 12); SRC_EA(env, src1, OS_LONG, 0, NULL); - dest = tcg_temp_new(); - tcg_gen_mul_i32(dest, src1, reg); - tcg_gen_mov_i32(reg, dest); - /* Unlike m68k, coldfire always clears the overflow bit. */ - gen_logic_cc(s, dest, OS_LONG); + if (m68k_feature(s->env, M68K_FEATURE_M68000)) { + tcg_gen_movi_i32(QREG_CC_C, 0); + if (sign) { + tcg_gen_muls2_i32(QREG_CC_N, QREG_CC_V, src1, DREG(ext, 12)); + /* QREG_CC_V is -(QREG_CC_V != (QREG_CC_N >> 31)) */ + tcg_gen_sari_i32(QREG_CC_Z, QREG_CC_N, 31); + tcg_gen_setcond_i32(TCG_COND_NE, QREG_CC_V, QREG_CC_V, QREG_CC_Z); + } else { + tcg_gen_mulu2_i32(QREG_CC_N, QREG_CC_V, src1, DREG(ext, 12)); + /* QREG_CC_V is -(QREG_CC_V != 0), use QREG_CC_C as 0 */ + tcg_gen_setcond_i32(TCG_COND_NE, QREG_CC_V, QREG_CC_V, QREG_CC_C); + } + tcg_gen_neg_i32(QREG_CC_V, QREG_CC_V); + tcg_gen_mov_i32(DREG(ext, 12), QREG_CC_N); + + tcg_gen_mov_i32(QREG_CC_Z, QREG_CC_N); + + set_cc_op(s, CC_OP_FLAGS); + } else { + /* The upper 32 bits of the product are discarded, so + muls.l and mulu.l are functionally equivalent. */ + tcg_gen_mul_i32(DREG(ext, 12), src1, DREG(ext, 12)); + gen_logic_cc(s, DREG(ext, 12), OS_LONG); + } } static void gen_link(DisasContext *s, uint16_t insn, int32_t offset) -- 2.7.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] M68k for 2.8 patches 2016-10-31 9:50 [Qemu-devel] [PULL 0/2] M68k for 2.8 patches Laurent Vivier 2016-10-31 9:50 ` [Qemu-devel] [PULL 1/2] target-m68k: add cmpm Laurent Vivier 2016-10-31 9:50 ` [Qemu-devel] [PULL 2/2] target-m68k: add 64bit mull Laurent Vivier @ 2016-10-31 13:12 ` Laurent Vivier 2016-11-02 17:07 ` Stefan Hajnoczi 3 siblings, 0 replies; 10+ messages in thread From: Laurent Vivier @ 2016-10-31 13:12 UTC (permalink / raw) To: qemu-devel@nongnu.org >> QEMU Developers Le 31/10/2016 à 10:50, Laurent Vivier a écrit : > The following changes since commit 5b2ecabaeabc17f032197246c4846b9ba95ba8a6: > > Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20161028-1' into staging (2016-10-28 17:59:04 +0100) > > are available in the git repository at: > > git@github.com:vivier/qemu-m68k.git tags/m68k-for-2.8-pull-request > > for you to fetch changes up to b3d2ee9b3a0a03394b0f4f7f8cf4fd018de969b8: > > target-m68k: add 64bit mull (2016-10-31 10:35:26 +0100) > > ---------------------------------------------------------------- > This two patches are extracted from my last series as they are > already reviewed to make them available before the soft-freeze. > ---------------------------------------------------------------- > > Laurent Vivier (2): > target-m68k: add cmpm > target-m68k: add 64bit mull > > target-m68k/translate.c | 88 ++++++++++++++++++++++++++++++++++++++++++------- > 1 file changed, 76 insertions(+), 12 deletions(-) > Cancel this request, there are more comments on the 64bit mull patch. Thanks, Laurent ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] M68k for 2.8 patches 2016-10-31 9:50 [Qemu-devel] [PULL 0/2] M68k for 2.8 patches Laurent Vivier ` (2 preceding siblings ...) 2016-10-31 13:12 ` [Qemu-devel] [PULL 0/2] M68k for 2.8 patches Laurent Vivier @ 2016-11-02 17:07 ` Stefan Hajnoczi 2016-11-02 17:12 ` Laurent Vivier 3 siblings, 1 reply; 10+ messages in thread From: Stefan Hajnoczi @ 2016-11-02 17:07 UTC (permalink / raw) To: Laurent Vivier; +Cc: qemu-devel [-- Attachment #1: Type: text/plain, Size: 659 bytes --] On Mon, Oct 31, 2016 at 10:50:29AM +0100, Laurent Vivier wrote: > The following changes since commit 5b2ecabaeabc17f032197246c4846b9ba95ba8a6: > > Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20161028-1' into staging (2016-10-28 17:59:04 +0100) > > are available in the git repository at: > > git@github.com:vivier/qemu-m68k.git tags/m68k-for-2.8-pull-request This URI is not publicly accessible. Some tools will fail to apply your pull request because of this. Please adjust your .gitconfig: [remote "origin"] url = git://github.com/vivier/qemu.git pushurl = git@github.com:vivier/qemu.git Thanks, Stefan [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 455 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] M68k for 2.8 patches 2016-11-02 17:07 ` Stefan Hajnoczi @ 2016-11-02 17:12 ` Laurent Vivier 2016-11-02 17:17 ` Stefan Hajnoczi 0 siblings, 1 reply; 10+ messages in thread From: Laurent Vivier @ 2016-11-02 17:12 UTC (permalink / raw) To: Stefan Hajnoczi; +Cc: qemu-devel [-- Attachment #1: Type: text/plain, Size: 846 bytes --] Le 02/11/2016 à 18:07, Stefan Hajnoczi a écrit : > On Mon, Oct 31, 2016 at 10:50:29AM +0100, Laurent Vivier wrote: >> The following changes since commit 5b2ecabaeabc17f032197246c4846b9ba95ba8a6: >> >> Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20161028-1' into staging (2016-10-28 17:59:04 +0100) >> >> are available in the git repository at: >> >> git@github.com:vivier/qemu-m68k.git tags/m68k-for-2.8-pull-request > > This URI is not publicly accessible. Some tools will fail to apply your > pull request because of this. > > Please adjust your .gitconfig: > > [remote "origin"] > url = git://github.com/vivier/qemu.git > pushurl = git@github.com:vivier/qemu.git Thank you Stefan. I'm using your tool "git-publish", is there a way to detect this problem automatically? Laurent [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] M68k for 2.8 patches 2016-11-02 17:12 ` Laurent Vivier @ 2016-11-02 17:17 ` Stefan Hajnoczi 2016-11-02 17:23 ` Stefan Hajnoczi 0 siblings, 1 reply; 10+ messages in thread From: Stefan Hajnoczi @ 2016-11-02 17:17 UTC (permalink / raw) To: Laurent Vivier; +Cc: qemu-devel On Wed, Nov 2, 2016 at 5:12 PM, Laurent Vivier <laurent@vivier.eu> wrote: > Le 02/11/2016 à 18:07, Stefan Hajnoczi a écrit : >> On Mon, Oct 31, 2016 at 10:50:29AM +0100, Laurent Vivier wrote: >>> The following changes since commit 5b2ecabaeabc17f032197246c4846b9ba95ba8a6: >>> >>> Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20161028-1' into staging (2016-10-28 17:59:04 +0100) >>> >>> are available in the git repository at: >>> >>> git@github.com:vivier/qemu-m68k.git tags/m68k-for-2.8-pull-request >> >> This URI is not publicly accessible. Some tools will fail to apply your >> pull request because of this. >> >> Please adjust your .gitconfig: >> >> [remote "origin"] >> url = git://github.com/vivier/qemu.git >> pushurl = git@github.com:vivier/qemu.git > > Thank you Stefan. > > I'm using your tool "git-publish", is there a way to detect this problem > automatically? Right now git-publish doesn't check the generated URI. In some use cases it's reasonable to use an SSH URI so adding an error or even warning to git-publish isn't ideal. I am modifying the patches tool (https://github.com/stefanha/patches) to automatically translate GitHub URIs since they are so prevalent... This will allow me to apply pull requests that have GitHub SSH URIs. Stefan ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] M68k for 2.8 patches 2016-11-02 17:17 ` Stefan Hajnoczi @ 2016-11-02 17:23 ` Stefan Hajnoczi 2016-11-02 17:26 ` Laurent Vivier 0 siblings, 1 reply; 10+ messages in thread From: Stefan Hajnoczi @ 2016-11-02 17:23 UTC (permalink / raw) To: Laurent Vivier; +Cc: qemu-devel On Wed, Nov 2, 2016 at 5:17 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote: > On Wed, Nov 2, 2016 at 5:12 PM, Laurent Vivier <laurent@vivier.eu> wrote: >> Le 02/11/2016 à 18:07, Stefan Hajnoczi a écrit : >>> On Mon, Oct 31, 2016 at 10:50:29AM +0100, Laurent Vivier wrote: >>>> The following changes since commit 5b2ecabaeabc17f032197246c4846b9ba95ba8a6: >>>> >>>> Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20161028-1' into staging (2016-10-28 17:59:04 +0100) >>>> >>>> are available in the git repository at: >>>> >>>> git@github.com:vivier/qemu-m68k.git tags/m68k-for-2.8-pull-request >>> >>> This URI is not publicly accessible. Some tools will fail to apply your >>> pull request because of this. >>> >>> Please adjust your .gitconfig: >>> >>> [remote "origin"] >>> url = git://github.com/vivier/qemu.git >>> pushurl = git@github.com:vivier/qemu.git >> >> Thank you Stefan. >> >> I'm using your tool "git-publish", is there a way to detect this problem >> automatically? > > Right now git-publish doesn't check the generated URI. In some use > cases it's reasonable to use an SSH URI so adding an error or even > warning to git-publish isn't ideal. > > I am modifying the patches tool (https://github.com/stefanha/patches) > to automatically translate GitHub URIs since they are so prevalent... > This will allow me to apply pull requests that have GitHub SSH URIs. On second thought, even that isn't a general solution. If people are collaborating on private GitHub repos then translating URIs to HTTPS is not correct either. Instead of trying to do magic I'll ask pull request submitters to fix their .gitconfig. Stefan ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] M68k for 2.8 patches 2016-11-02 17:23 ` Stefan Hajnoczi @ 2016-11-02 17:26 ` Laurent Vivier 2016-11-03 16:12 ` Stefan Hajnoczi 0 siblings, 1 reply; 10+ messages in thread From: Laurent Vivier @ 2016-11-02 17:26 UTC (permalink / raw) To: Stefan Hajnoczi; +Cc: qemu-devel Le 02/11/2016 à 18:23, Stefan Hajnoczi a écrit : > On Wed, Nov 2, 2016 at 5:17 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote: >> On Wed, Nov 2, 2016 at 5:12 PM, Laurent Vivier <laurent@vivier.eu> wrote: >>> Le 02/11/2016 à 18:07, Stefan Hajnoczi a écrit : >>>> On Mon, Oct 31, 2016 at 10:50:29AM +0100, Laurent Vivier wrote: >>>>> The following changes since commit 5b2ecabaeabc17f032197246c4846b9ba95ba8a6: >>>>> >>>>> Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20161028-1' into staging (2016-10-28 17:59:04 +0100) >>>>> >>>>> are available in the git repository at: >>>>> >>>>> git@github.com:vivier/qemu-m68k.git tags/m68k-for-2.8-pull-request >>>> >>>> This URI is not publicly accessible. Some tools will fail to apply your >>>> pull request because of this. >>>> >>>> Please adjust your .gitconfig: >>>> >>>> [remote "origin"] >>>> url = git://github.com/vivier/qemu.git >>>> pushurl = git@github.com:vivier/qemu.git >>> >>> Thank you Stefan. >>> >>> I'm using your tool "git-publish", is there a way to detect this problem >>> automatically? >> >> Right now git-publish doesn't check the generated URI. In some use >> cases it's reasonable to use an SSH URI so adding an error or even >> warning to git-publish isn't ideal. >> >> I am modifying the patches tool (https://github.com/stefanha/patches) >> to automatically translate GitHub URIs since they are so prevalent... >> This will allow me to apply pull requests that have GitHub SSH URIs. > > On second thought, even that isn't a general solution. If people are > collaborating on private GitHub repos then translating URIs to HTTPS > is not correct either. > > Instead of trying to do magic I'll ask pull request submitters to fix > their .gitconfig. Perhaps you can also update git-publish README.rst? Thanks, Laurent ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] M68k for 2.8 patches 2016-11-02 17:26 ` Laurent Vivier @ 2016-11-03 16:12 ` Stefan Hajnoczi 0 siblings, 0 replies; 10+ messages in thread From: Stefan Hajnoczi @ 2016-11-03 16:12 UTC (permalink / raw) To: Laurent Vivier; +Cc: qemu-devel [-- Attachment #1: Type: text/plain, Size: 2084 bytes --] On Wed, Nov 02, 2016 at 06:26:20PM +0100, Laurent Vivier wrote: > Le 02/11/2016 à 18:23, Stefan Hajnoczi a écrit : > > On Wed, Nov 2, 2016 at 5:17 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote: > >> On Wed, Nov 2, 2016 at 5:12 PM, Laurent Vivier <laurent@vivier.eu> wrote: > >>> Le 02/11/2016 à 18:07, Stefan Hajnoczi a écrit : > >>>> On Mon, Oct 31, 2016 at 10:50:29AM +0100, Laurent Vivier wrote: > >>>>> The following changes since commit 5b2ecabaeabc17f032197246c4846b9ba95ba8a6: > >>>>> > >>>>> Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20161028-1' into staging (2016-10-28 17:59:04 +0100) > >>>>> > >>>>> are available in the git repository at: > >>>>> > >>>>> git@github.com:vivier/qemu-m68k.git tags/m68k-for-2.8-pull-request > >>>> > >>>> This URI is not publicly accessible. Some tools will fail to apply your > >>>> pull request because of this. > >>>> > >>>> Please adjust your .gitconfig: > >>>> > >>>> [remote "origin"] > >>>> url = git://github.com/vivier/qemu.git > >>>> pushurl = git@github.com:vivier/qemu.git > >>> > >>> Thank you Stefan. > >>> > >>> I'm using your tool "git-publish", is there a way to detect this problem > >>> automatically? > >> > >> Right now git-publish doesn't check the generated URI. In some use > >> cases it's reasonable to use an SSH URI so adding an error or even > >> warning to git-publish isn't ideal. > >> > >> I am modifying the patches tool (https://github.com/stefanha/patches) > >> to automatically translate GitHub URIs since they are so prevalent... > >> This will allow me to apply pull requests that have GitHub SSH URIs. > > > > On second thought, even that isn't a general solution. If people are > > collaborating on private GitHub repos then translating URIs to HTTPS > > is not correct either. > > > > Instead of trying to do magic I'll ask pull request submitters to fix > > their .gitconfig. > > Perhaps you can also update git-publish README.rst? Good idea, I'll add info on how to set up separate url and pushurl fields. Stefan [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 455 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2016-11-03 16:12 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-10-31 9:50 [Qemu-devel] [PULL 0/2] M68k for 2.8 patches Laurent Vivier 2016-10-31 9:50 ` [Qemu-devel] [PULL 1/2] target-m68k: add cmpm Laurent Vivier 2016-10-31 9:50 ` [Qemu-devel] [PULL 2/2] target-m68k: add 64bit mull Laurent Vivier 2016-10-31 13:12 ` [Qemu-devel] [PULL 0/2] M68k for 2.8 patches Laurent Vivier 2016-11-02 17:07 ` Stefan Hajnoczi 2016-11-02 17:12 ` Laurent Vivier 2016-11-02 17:17 ` Stefan Hajnoczi 2016-11-02 17:23 ` Stefan Hajnoczi 2016-11-02 17:26 ` Laurent Vivier 2016-11-03 16:12 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).