Open tsingbx opened 1 week ago
刚刚去看了一下Bit field这块,虽然在这里表达看起来是从 invalid
到 pc
共同组成一个unsigned short ,但实际上这几个是分开的,连续的位域定义可以省略前面的类型,所以这里从invalid开始到pc 都是unsigned short 类型的位域,那我们肯定是不能将其合并为同一个底层类型的
而中间那个没名字的位置则是用于对齐位置的空域,不能访问,仅用作占位对齐
#define _STRUCT_FP_CONTROL struct fp_control
_STRUCT_FP_CONTROL
{
unsigned short invalid :1,
denorm :1,
zdiv :1,
ovrfl :1,
undfl :1,
precis :1,
:2,
pc :2,
#define FP_PREC_24B 0
#define FP_PREC_53B 2
#define FP_PREC_64B 3
rc :2,
#define FP_RND_NEAR 0
#define FP_RND_DOWN 1
#define FP_RND_UP 2
#define FP_CHOP 3
/*inf*/ :1,
:3;
};
_structs.txt
1、Supports merging multiple bit fields into one underlying type, such as unsigned int. 2、The ast file should not contain code that the compiler ignores. For example, #ifdef XXX code #endif. The code here should be ignored when XXX is not defined, and the ast file should not contain this code.