+#if defined(HOST_WORDS_BIGENDIAN)
+#define ELEM_ADDR(VEC, IDX, SIZE) (&(VEC)->VsrB(IDX))
+#else
+#define ELEM_ADDR(VEC, IDX, SIZE) (&(VEC)->VsrB(IDX) - (SIZE) + 1)
+#endif
+#define VINSX(SUFFIX, TYPE) \
+void glue(glue(helper_VINS, SUFFIX), LX)(CPUPPCState *env, ppc_avr_t *t,
\
+ uint64_t val, target_ulong index)
\
+{
\
+ const int maxidx = ARRAY_SIZE(t->u8) - sizeof(TYPE);
\
+ target_long idx = index;
\
+
\
+ if (idx < 0 || idx > maxidx) {
\
+ char c = idx < 0 ? 'R' : 'L';
\
+ idx = idx < 0 ? sizeof(TYPE) - idx : idx;
\
+ qemu_log_mask(LOG_GUEST_ERROR, "Invalid index for VINS" #SUFFIX "%cX"
\
+ " at 0x" TARGET_FMT_lx ", RA = " TARGET_FMT_ld " >
%d\n",\
+ c, env->nip, idx, maxidx);
\