📄 avcall.h
字号:
*/#define __av_word(LIST,VAL) \ (--(LIST).aptr < __av_eptr(LIST) \ ? -1 : (*(LIST).aptr = (__avword)(VAL), 0))#endif#if defined(AMIGA)/* Some arguments are passed in registers. Query the macro AV_ARG_REGNUM. * This should really be an argument to __av_word. */#undef __av_word /**/#define __av_word(LIST,VAL) \ ((AV_ARG_REGNUM) >= 0 \ ? ((AV_ARG_REGNUM) < 8+7 \ ? -1 : ((LIST).regargs[(AV_ARG_REGNUM)] = (__avword)(VAL), 0)) \ : (++(LIST).aptr > __av_eptr(LIST) \ ? -1 : ((LIST).aptr[-1] = (__avword)(VAL), 0)))#endif/* integer argument types */#if defined(__x86_64__)/* The first 6 integer arguments are passed in registers. */#define av_long(LIST,VAL) \ ((LIST).iaptr < &(LIST).iargs[6] \ ? (*(LIST).iaptr++ = (long)(VAL), 0) \ : __av_word(LIST,(long)(VAL)))#else#define av_long(LIST,VAL) __av_word(LIST,(long)(VAL))#endif#if defined(__x86_64__)/* The first 6 integer arguments are passed in registers. */#define av_ulong(LIST,VAL) \ ((LIST).iaptr < &(LIST).iargs[6] \ ? (*(LIST).iaptr++ = (unsigned long)(VAL), 0) \ : __av_word(LIST,(unsigned long)(VAL)))#else#define av_ulong(LIST,VAL) __av_word(LIST,(unsigned long)(VAL))#endif#if defined(__x86_64__)/* The first 6 integer arguments are passed in registers. */#define av_ptr(LIST,TYPE,VAL) \ ((LIST).iaptr < &(LIST).iargs[6] \ ? (*(LIST).iaptr++ = (__avword)(TYPE)(VAL), 0) \ : __av_word(LIST,(TYPE)(VAL)))#else#define av_ptr(LIST,TYPE,VAL) __av_word(LIST,(TYPE)(VAL))#endif#define av_char av_long#define av_schar av_long#define av_short av_long#define av_int av_long#define av_uchar av_ulong#define av_ushort av_ulong#define av_uint av_ulong#if defined(__mips64__) || defined(__sparc64__) || defined(__alpha__) || defined(__ia64__) || defined(__x86_64__)/* `long long' and `long' are identical. */#define av_longlong av_long#define av_ulonglong av_ulong#elif defined(__mipsn32__)/* `long long' fits in __avword. */#define av_longlong __av_word#define av_ulonglong(LIST,VAL) __av_word(LIST,(unsigned long long)(VAL))#elif defined(__i386__) || defined(__m68k__) || defined(__mips__) || (defined(__sparc__) && !defined(__sparc64__)) || defined(__hppa__) || defined(__arm__) || defined(__rs6000__) || defined(__m88k__) || defined(__convex__) || defined(__s390__)/* `long long's are passed embedded on the arg stack. */#define av_longlong(LIST,VAL) __av_longlong(LIST,long long,VAL)#define av_ulonglong(LIST,VAL) __av_longlong(LIST,unsigned long long,VAL)#if defined(__i386__) || defined(__m68k__) || defined(__arm__) || (defined(__rs6000__) && (defined(_AIX) || (defined(__MACH__) && defined(__APPLE__)))) || defined(__convex__)/* `long long's are (at most) word-aligned. */#define __av_longlong(LIST,TYPE,VAL) \ (((LIST).aptr += sizeof(TYPE)/sizeof(__avword)) > __av_eptr(LIST) \ ? -1 : (((TYPE*)(LIST).aptr)[-1] = (TYPE)(VAL), 0))#endif#if defined(__mips__) || (defined(__sparc__) && !defined(__sparc64__)) || defined(__hppa__) || (defined(__rs6000__) && !(defined(_AIX) || (defined(__MACH__) && defined(__APPLE__)))) || defined(__m88k__) || defined(__s390__)/* `long long's have alignment 8. */#if defined(__mips__)#define __av_longlong(LIST,TYPE,VAL) \ (((LIST).aptr = (__avword*)(((__avword)(LIST).aptr+sizeof(TYPE)+__AV_alignof(TYPE)-1) & -(long)__AV_alignof(TYPE))) > __av_eptr(LIST) \ ? -1 : ((LIST).anum++, ((TYPE*)(LIST).aptr)[-1] = (TYPE)(VAL), 0))#endif#if defined(__sparc__) && !defined(__sparc64__)/* Within the arg stack, the alignment is only 4, not 8. *//* This assumes sizeof(long long) == 2*sizeof(__avword). */#define __av_longlong(LIST,TYPE,VAL) \ (((LIST).aptr += sizeof(TYPE)/sizeof(__avword)) > __av_eptr(LIST) \ ? -1 : \ ((LIST).tmp._longlong = (TYPE)(VAL), \ (LIST).aptr[-2] = (LIST).tmp.words[0], \ (LIST).aptr[-1] = (LIST).tmp.words[1], \ 0))#endif#if defined(__hppa__)#define __av_longlong(LIST,TYPE,VAL) \ (((LIST).aptr = (__avword*)(((__avword)(LIST).aptr & -(long)__AV_alignof(TYPE)) - sizeof(TYPE))) < __av_eptr(LIST) \ ? -1 : (*(TYPE*)(LIST).aptr = (TYPE)(VAL), 0))#endif#if (defined(__rs6000__) && !(defined(_AIX) || (defined(__MACH__) && defined(__APPLE__)))) || defined(__m88k__)#define __av_longlong(LIST,TYPE,VAL) \ (((LIST).aptr = (__avword*)(((__avword)(LIST).aptr+sizeof(TYPE)+__AV_alignof(TYPE)-1) & -(long)__AV_alignof(TYPE))) > __av_eptr(LIST) \ ? -1 : (((TYPE*)(LIST).aptr)[-1] = (TYPE)(VAL), 0))#endif#if defined(__s390__)#define __av_longlong(LIST,TYPE,VAL) \ (((LIST).aptr = (__avword*)(((__avword)(LIST).aptr+sizeof(TYPE)+__AV_alignof(TYPE)-1) & -(long)__AV_alignof(TYPE))) > __av_eptr(LIST) \ ? -1 : \ (((LIST).aptr - (LIST).args - (LIST).fargwords == 4 ? ++(LIST).aptr,0 : 0), \ (((TYPE*)(LIST).aptr)[-1] = (TYPE)(VAL), 0)))#endif#endif#endif/* floating-point argument types */#define av_float(LIST,VAL) \ ((LIST).flags & __AV_TRADITIONAL_FLOAT_ARGS \ ? av_double(LIST,(float)(VAL)) \ : __av_float(LIST,VAL))#if defined(__i386__) || defined(__m68k__) || (defined(__sparc__) && !defined(__sparc64__)) || defined(__arm__) || defined(__convex__)#define __av_float(LIST,VAL) \ (++(LIST).aptr > __av_eptr(LIST) \ ? -1 : (((float*)(LIST).aptr)[-1] = (float)(VAL), 0))/* This assumes sizeof(double) == 2*sizeof(__avword). */#define av_double(LIST,VAL) \ (((LIST).aptr += 2) > __av_eptr(LIST) \ ? -1 : \ ((LIST).tmp._double = (double)(VAL), \ (LIST).aptr[-2] = (LIST).tmp.words[0], \ (LIST).aptr[-1] = (LIST).tmp.words[1], \ 0))#endif#if defined(__mips__) && !defined(__mipsn32__)/* Up to 2 leading float or double non-varargs args can be passed in * float registers, but we also push them into the corresponding int * registers in case of varargs. For doubles we need to align the aptr * to an even boundary. */#define __av_float(LIST,VAL) \ (++(LIST).aptr > __av_eptr(LIST) \ ? -1 : ((++(LIST).anum == 1 \ ? ((LIST).flags |= __AV_FLOAT_1, \ ((float*)(LIST).floatarg)[1] = ((float*)(LIST).aptr)[-1] = (float)(VAL))\ : (LIST).anum == 2 && ((LIST).flags & __AV_FLOAT_1) \ ? ((LIST).flags |= __AV_FLOAT_2, \ ((float*)(LIST).floatarg)[3] = ((float*)(LIST).aptr)[-1] = (float)(VAL))\ : (*(float*)&(LIST).aptr[-1] = (float)(VAL))), \ 0))#define av_double(LIST,VAL) \ (((LIST).aptr = (__avword*)(((__avword)(LIST).aptr+15)&-8)) \ > __av_eptr(LIST) \ ? -1 : ((++(LIST).anum == 1 \ ? ((LIST).flags |= __AV_FLOAT_1, \ (LIST).floatarg[0] = ((double*)(LIST).aptr)[-1] = (double)(VAL))\ : (LIST).anum == 2 && ((LIST).flags & __AV_FLOAT_1) \ ? ((LIST).flags |= __AV_FLOAT_2, \ (LIST).floatarg[1] = ((double*)(LIST).aptr)[-1] = (double)(VAL))\ : (((double*)(LIST).aptr)[-1] = (double)(VAL))), \ 0))#endif#if defined(__mipsn32__) || defined(__mips64__)/* Up to 8 leading float or double non-varargs args can be passed in * float registers, but we also push them into the corresponding int * registers in case of varargs. */#define __av_float(LIST,VAL) \ ((LIST).aptr >= __av_eptr(LIST) \ ? -1 : (((LIST).anum < 8 \ ? ((LIST).farg_mask |= (1 << (LIST).anum), \ (LIST).farg[(LIST).anum] = *(float*)(LIST).aptr = (float)(VAL)) \ : (*(float*)(LIST).aptr = (float)(VAL))), \ (LIST).anum++, \ (LIST).aptr++, \ 0))#define av_double(LIST,VAL) \ ((LIST).aptr >= __av_eptr(LIST) \ ? -1 : (((LIST).anum < 8 && ((LIST).darg_mask |= (1 << (LIST).anum))), \ *(double*)(LIST).aptr = (double)(VAL), \ (LIST).anum++, \ (LIST).aptr++, \ 0))#endif#if defined(__sparc64__)/* Up to 16 leading float or double non-varargs args can be passed in * float registers, but we also push them into the corresponding int * registers in case of varargs. */#define __av_float(LIST,VAL) \ ((LIST).aptr >= __av_eptr(LIST) \ ? -1 : (((LIST).anum < 16 && ((LIST).farg_mask |= (1 << (LIST).anum))), \ (*(float*)(LIST).aptr = (float)(VAL)), \ (LIST).anum++, \ (LIST).aptr++, \ 0))#define av_double(LIST,VAL) \ ((LIST).aptr >= __av_eptr(LIST) \ ? -1 : (((LIST).anum < 16 && ((LIST).darg_mask |= (1 << (LIST).anum))), \ *(double*)(LIST).aptr = (double)(VAL), \ (LIST).anum++, \ (LIST).aptr++, \ 0))#endif#if defined(__alpha__)#define av_double(LIST,VAL) \ (++(LIST).aptr > __av_eptr(LIST) \ ? -1 : (((double*)(LIST).aptr)[-1] = (double)(VAL), 0))#define __av_float(LIST,VAL) \ (++(LIST).aptr > __av_eptr(LIST) \ ? -1 \ : (((LIST).aptr > &(LIST).args[6] \ ? /* These args will be fetched from memory using "lds" instructions */ \ /* therefore store them as floats */ \ (*(float*)((LIST).aptr-1) = (float)(VAL)) \ : /* The first 6 args will be put into registers by "ldt" instructions */ \ /* (see avcall-alpha.c!). Therefore store them as doubles. */ \ /* When viewed as floats, the value will be the correct one. */\ (*(double*)((LIST).aptr-1) = (double)(float)(VAL)) \ ), 0))#endif#if defined(__hppa__)#define __av_float(LIST,VAL) \ (--(LIST).aptr < __av_eptr(LIST) \ ? -1 : (*(float*)(LIST).aptr = (float)(VAL), 0))#define av_double(LIST,VAL) \ (((LIST).aptr = (__avword*)(((long)(LIST).aptr-sizeof(double)) & -(long)sizeof(double))) \ < __av_eptr(LIST) \ ? -1 : (*(double*)(LIST).aptr = (double)(VAL), 0))#endif#if defined(__rs6000__) && (defined(_AIX) || (defined(__MACH__) && defined(__APPLE__)))/* Up to 13 float or double non-varargs args can be passed in * float registers, but we also push them into the corresponding int * registers in case of varargs. */#define __av_float(LIST,VAL) \ (++(LIST).aptr > __av_eptr(LIST) \ ? -1 : (((float*)(LIST).aptr)[-1] = (float)(VAL), \ (LIST).faptr < &(LIST).fargs[13] && \ (*(LIST).faptr++ = (double)(float)(VAL)), \ 0))#define av_double(LIST,VAL) \ (((LIST).aptr += 2) > __av_eptr(LIST) \ ? -1 : \ ((LIST).tmp._double = (double)(VAL), \ (LIST).aptr[-2] = (LIST).tmp.words[0], \ (LIST).aptr[-1] = (LIST).tmp.words[1], \ (LIST).faptr < &(LIST).fargs[13] && \ (*(LIST).faptr++ = (LIST).tmp._double), \ 0))#endif#if defined(__rs6000__) && !(defined(_AIX) || (defined(__MACH__) && defined(__APPLE__)))/* Up to 8 float or double non-varargs args can be passed in * float registers, without occupying space in the general registers. */#define __av_float(LIST,VAL) \ ((LIST).faptr < &(LIST).fargs[8] \ ? ((*(LIST).faptr++ = (double)(float)(VAL)), 0) \ : (++(LIST).aptr > __av_eptr(LIST) \ ? -1 : (((float*)(LIST).aptr)[-1] = (float)(VAL), 0)))#define av_double(LIST,VAL) \ ((LIST).faptr < &(LIST).fargs[8] \ ? ((*(LIST).faptr++ = (double)(VAL)), 0) \ : (((LIST).aptr += 2) > __av_eptr(LIST) \ ? -1 : \ ((LIST).tmp._double = (double)(VAL), \ (LIST).aptr[-2] = (LIST).tmp.words[0], \ (LIST).aptr[-1] = (LIST).tmp.words[1], \ 0)))#endif#if defined(__s390__)/* Up to 2 float or double non-varargs args can be passed in * float registers, without occupying space in the general registers. */#define __av_float(LIST,VAL) \ ((LIST).faptr < &(LIST).fargs[2] \ ? (LIST).daptr++, *(LIST).fargsusedptr++ = 1, *(LIST).dargsusedptr++ = 0, ((*(LIST).faptr++ = (float)(VAL)), 0) \ : (++(LIST).aptr > __av_eptr(LIST) \ ? -1 : ((LIST).fargwords++, ((float*)(LIST).aptr)[-1] = (float)(VAL), 0)))#define av_double(LIST,VAL) \ ((LIST).daptr < &(LIST).dargs[2] \ ? (LIST).faptr++, *(LIST).dargsusedptr++ = 1, *(LIST).fargsusedptr++ = 0, ((*(LIST).daptr++ = (double)(VAL)), 0) \ : (((LIST).aptr += 2) > __av_eptr(LIST) \ ? -1 : \ ((LIST).fargwords+=2, (LIST).tmp._double = (double)(VAL), \ (LIST).aptr[-2] = (LIST).tmp.words[0], \ (LIST).aptr[-1] = (LIST).tmp.words[1], \ 0)))#endif#if defined(__m88k__)#define __av_float(LIST,VAL) \ (++(LIST).aptr > __av_eptr(LIST) \ ? -1 : (((float*)(LIST).aptr)[-1] = (float)(VAL), 0))#define av_double(LIST,VAL) \ (((LIST).aptr = (__avword*)(((long)(LIST).aptr+sizeof(double)+sizeof(double)-1) & -(long)sizeof(double))) \ > __av_eptr(LIST) \ ? -1 : (((double*)(LIST).aptr)[-1] = (double)(VAL), 0))#endif#if defined(__ia64__)/* Up to 8 leading float or double non-varargs args can be passed in * float registers, but we also push them into the corresponding int * registers in case of varargs. */#define __av_float(LIST,VAL) \ ((LIST).aptr >= __av_eptr(LIST) \ ? -1 : ((*(float*)(LIST).aptr = (float)(VAL)), \ ((LIST).faptr < &(LIST).fargs[8] && (*(LIST).faptr = *(float*)(LIST).aptr, (LIST).faptr++)), \ (LIST).aptr++, \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -