From: Richard Henderson <rth@twiddle.net>
To: Jia Liu <proljc@gmail.com>
Cc: qemu-devel@nongnu.org, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH V3 01/12] add MIPS DSP internal functions
Date: Tue, 27 Mar 2012 08:33:26 -0700 [thread overview]
Message-ID: <4F71DDC6.10700@twiddle.net> (raw)
In-Reply-To: <1332840290-24553-2-git-send-email-proljc@gmail.com>
On 03/27/12 02:24, Jia Liu wrote:
> +ifeq ($(TARGET_BASE_ARCH), mips)
> +libobj-y += dsp_helper.o
> +endif
...
> +#include "dyngen-exec.h"
> +
> +/*** MIPS DSP internal functions begin ***/
> +static inline void set_DSPControl_overflow_flag(uint32_t flag, int position)
> +{
> + env->active_tc.DSPControl |= (target_ulong)flag << position;
> +}
In order to use dyngen-exec.h, and the global ENV variable,
you must also do
dsp_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
in the Makefile.target. If you had tested i386 host instead
of x86_64, you should have seen this failure.
Better, from the point of view of one working toward eliminating
dyngen-exec.h and these special calling conventions, is to actually
pass down env in the helper. E.g.
+/** DSP Arithmetic Sub-class insns **/
+uint32_t helper_addq_ph(CPUMIPSState *env, uint32_t rs, uint32_t rt)
+DEF_HELPER_FLAGS_3(addq_ph, 0, i32, env, i32, i32)
where mipsdsp_add_i16 and thence set_DSPControl_overflow_flag also
grow ENV parameters.
In addition, we can't use TCG_CALL_CONST | TCG_CALL_PURE on any
function that sets DSPControl, because that's the cpu_dspctrl tcg
variable.
You might get better performance out of TCG if you do *not* make
DSPControl a TCG variable, but instead perform explicit loads from
that slot in the few places that need it. That way you can at
least set TCG_CALL_CONST. (Though not TCG_CALL_PURE, because the
functions do have side effects.)
> + if (len == 2)
> + env->active_tc.DSPControl &= 0xFCFFFFFF;
> + else if (len == 4)
> + env->active_tc.DSPControl &= 0xF0FFFFFF;
Run all your patches through ./scripts/checkpatch.pl and fix the
errors that will report.
r~
next prev parent reply other threads:[~2012-03-27 15:33 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-27 9:24 [Qemu-devel] [PATCH V3 00/12] Qemu MIPS ASE DSP Support Jia Liu
2012-03-27 9:24 ` [Qemu-devel] [PATCH V3 01/12] add MIPS DSP internal functions Jia Liu
2012-03-27 15:33 ` Richard Henderson [this message]
2012-03-28 2:03 ` Jia Liu
2012-03-29 11:16 ` Richard Henderson
2012-03-27 9:24 ` [Qemu-devel] [PATCH V3 02/12] Use correct acc value to index cpu_HI/cpu_LO rather than using a fix number Jia Liu
2012-03-27 15:34 ` Richard Henderson
2012-03-27 9:24 ` [Qemu-devel] [PATCH V3 03/12] Add MIPS DSP Branch instruction Support Jia Liu
2012-03-27 15:46 ` Richard Henderson
2012-03-28 1:27 ` Jia Liu
2012-03-27 9:24 ` [Qemu-devel] [PATCH V3 04/12] Add MIPS DSP Load instructions Support Jia Liu
2012-03-27 15:49 ` Richard Henderson
2012-03-28 1:46 ` Jia Liu
2012-03-27 9:24 ` [Qemu-devel] [PATCH V3 05/12] Add helper functions for MIPS DSP Arithmetic instructions Jia Liu
2012-03-27 16:03 ` Richard Henderson
2012-03-28 1:45 ` Jia Liu
2012-03-27 9:24 ` [Qemu-devel] [PATCH V3 06/12] Add helper functions for MIPS DSP GPR-Based Shift instructions Jia Liu
2012-03-27 16:11 ` Richard Henderson
2012-03-28 1:43 ` Jia Liu
2012-03-29 13:09 ` Richard Henderson
2012-03-27 9:24 ` [Qemu-devel] [PATCH V3 07/12] Add helper functions for MIPS DSP Multiply instructions Jia Liu
2012-03-27 9:24 ` [Qemu-devel] [PATCH V3 08/12] Add helper functions for MIPS DSP Bit/Manipulation instructions Jia Liu
2012-03-27 16:23 ` Richard Henderson
2012-03-28 1:47 ` Jia Liu
2012-03-27 9:24 ` [Qemu-devel] [PATCH V3 09/12] Add helper functions for MIPS DSP Compare-Pick instructions Jia Liu
2012-03-27 17:42 ` Richard Henderson
2012-03-28 1:52 ` Jia Liu
2012-03-27 9:24 ` [Qemu-devel] [PATCH V3 10/12] Add helper functions for MIPS DSP Accumulator and DSPControl Access instrutions helpers Jia Liu
2012-03-27 9:24 ` [Qemu-devel] [PATCH V3 11/12] Handle MIPS DSP instructions in target-mips/translate.c Jia Liu
2012-03-27 17:48 ` Richard Henderson
2012-03-28 1:36 ` Jia Liu
2012-03-29 13:20 ` Richard Henderson
2012-03-27 9:24 ` [Qemu-devel] [PATCH V3 12/12] add MIPS DSP testcases Jia Liu
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=4F71DDC6.10700@twiddle.net \
--to=rth@twiddle.net \
--cc=aurelien@aurel32.net \
--cc=proljc@gmail.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).