在 2023-12-04一的 20:38 +0800,Xi Ruoyao写道: > On Mon, 2023-12-04 at 20:31 +0800, Xi Ruoyao wrote: > > On Mon, 2023-12-04 at 20:14 +0800, chenxiaolong wrote: > > > On LoongArch architecture, using the latest gcc14 in regression > > > test, > > > it is found that the vector test cases in vector directory appear > > > FAIL > > > entries with unmatched pointer types. In order to solve this kind > > > of > > > problem, the type of the variable in the check result is modified > > > with > > > the parameter type defined in the vector builtin function. > > > > IMO we should write something more readable: > > > > static inline > > void ASSERTEQ_64 (int line, const void *_ref, const void *_res) > > { > > if (memcmp (_ref, _res, 16) == 0) > > return; > > > > const char *ref = (const char *)_ref; > > const char *res = (const char *)_res; > > > > printf ("error %s:%d: result mismatch\n", __FILE__, line); > > > > printf ("ref:"); > > for (int i = 0; i < 16; i++) > > printf (" %02x", ref[i]); > > Sorry, should be " %02hhx" here. > > > printf ("\nres:"); > > for (int i = 0; i < 16; i++) > > printf (" %02x", res[i]); > > Likewise. > > > putchar ('\n'); > > abort (); > > }
According to your suggestion, the check of the built-in function was modifiedin the simd_correctness_check.h file, and the types of the actual parameters of the built-in function were inconsistent with those of the formal parameters. The problems with the GCC regression test are as follows: ... note: expected 'const void *' but argument is of type '__m128i' error: incompatible type for argument 3 of 'ASSERTEQ_64' ... The reason is that the types used in __m{128i,128,128d} are defined in the vector header file (lsxintrin.h or lasxintrin.h), and their basic types do not match the parameter types corresponding to the functions.