qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v1] include/exec/helper-head.h: support "const v


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v1] include/exec/helper-head.h: support "const void *" in helper calls
Date: Thu, 21 Feb 2019 10:25:35 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 2/21/19 1:34 AM, David Hildenbrand wrote:
> Especially when dealing with out-of-line gvec helpers, it is often
> helpful to specify some vector pointers as constant. E.g. when
> we have two inputs and one output, marking the two inputs as consts
> pointers helps to avoid bugs.
> 
> Const pointers can be specified via "cptr", however behave in TCG just
> like ordinary pointers. We can specify helpers like:
> 
> DEF_HELPER_FLAGS_4(gvec_vbperm, TCG_CALL_NO_RWG, void, ptr, cptr, cptr, i32)
> 
> void HELPER(gvec_vbperm)(void *v1, const void *v2, const void *v3,
>                          uint32_t desc)
> 
> And make sure that here, only v1 will be written (as long as const is
> not casted away, of course).
> 
> Signed-off-by: David Hildenbrand <address@hidden>
> ---
>  include/exec/helper-head.h | 5 +++++
>  1 file changed, 5 insertions(+)

Queued, thanks.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]