• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisión8c6edfdd90522caa4fc429144d393aba5b99f584 (tree)
Tiempo2019-02-22 03:22:24
AutorDavid Hildenbrand <david@redh...>
CommiterRichard Henderson

Log Message

include/exec/helper-head.h: support "const void *" in helper calls

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 <david@redhat.com>
Message-Id: <20190221093459.22547-1-david@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Cambiar Resumen

Diferencia incremental

--- a/include/exec/helper-head.h
+++ b/include/exec/helper-head.h
@@ -30,6 +30,7 @@
3030 #define dh_alias_f32 i32
3131 #define dh_alias_f64 i64
3232 #define dh_alias_ptr ptr
33+#define dh_alias_cptr ptr
3334 #define dh_alias_void void
3435 #define dh_alias_noreturn noreturn
3536 #define dh_alias(t) glue(dh_alias_, t)
@@ -43,6 +44,7 @@
4344 #define dh_ctype_f32 float32
4445 #define dh_ctype_f64 float64
4546 #define dh_ctype_ptr void *
47+#define dh_ctype_cptr const void *
4648 #define dh_ctype_void void
4749 #define dh_ctype_noreturn void QEMU_NORETURN
4850 #define dh_ctype(t) dh_ctype_##t
@@ -88,6 +90,7 @@
8890 #define dh_is_64bit_i32 0
8991 #define dh_is_64bit_i64 1
9092 #define dh_is_64bit_ptr (sizeof(void *) == 8)
93+#define dh_is_64bit_cptr dh_is_64bit_ptr
9194 #define dh_is_64bit(t) glue(dh_is_64bit_, dh_alias(t))
9295
9396 #define dh_is_signed_void 0
@@ -105,6 +108,7 @@
105108 extension instructions that may be required, e.g. ia64's addp4. But
106109 for now we don't support any 64-bit targets with 32-bit pointers. */
107110 #define dh_is_signed_ptr 0
111+#define dh_is_signed_cptr dh_is_signed_ptr
108112 #define dh_is_signed_env dh_is_signed_ptr
109113 #define dh_is_signed(t) dh_is_signed_##t
110114
@@ -117,6 +121,7 @@
117121 #define dh_callflag_f32 0
118122 #define dh_callflag_f64 0
119123 #define dh_callflag_ptr 0
124+#define dh_callflag_cptr dh_callflag_ptr
120125 #define dh_callflag_void 0
121126 #define dh_callflag_noreturn TCG_CALL_NO_RETURN
122127 #define dh_callflag(t) glue(dh_callflag_, dh_alias(t))