foo.c:7:51: error: expected ‘;’, ‘,’ or ‘)’ before ‘&’ token
7 | long long exgcd(long long a,long long b,long long &x,long long &y)
| ^
foo.c: In function ‘mul’:
foo.c:17:49: error: expected ‘)’ before ‘z’
17 | return (z+(unsigned long long)(unsigned(z)*r)*mod)>>32;//对p取模
| ^
| )
foo.c:17:51: error: expected ‘)’ before ‘*’ token
17 | return (z+(unsigned long long)(unsigned(z)*r)*mod)>>32;//对p取模
| ~ ^
| )
foo.c: At top level:
foo.c:27:16: error: conflicting types for ‘mul’; have ‘__m256i(__m256i, __m256i)’
27 | inline __m256i mul(__m256i _num1,__m256i _num2)//将8个32位整数相乘并取模
| ^~~
foo.c:14:17: note: previous definition of ‘mul’ with type ‘unsigned int(unsigned int, unsigned int)’
14 | inline unsigned mul(unsigned x,unsigned y)//蒙哥马利数域内的乘法及取模
| ^~~
foo.c: In function ‘mon_in’:
foo.c:39:47: error: incompatible type for argument 1 of ‘mul’
39 | inline unsigned mon_in(unsigned x){return mul(x,n2_);}//进入蒙哥马利数域
| ^
| |
| unsigned int
foo.c:27:28: note: expected ‘__m256i’ but argument is of type ‘unsigned int’
27 | inline __m256i mul(__m256i _num1,__m256i _num2)//将8个32位整数相乘并取模
| ~~~~~~~~^~~~~
foo.c:39:49: error: incompatible type for argument 2 of ‘mul’
39 | inline unsigned mon_in(unsigned x){return mul(x,n2_);}//进入蒙哥马利数域
| ^~~
| |
| unsigned int
foo.c:27:42: note: expected ‘__m256i’ but argument is of type ‘unsigned int’
27 | inline __m256i mul(__m256i _num1,__m256i _num2)//将8个32位整数相乘并取模
| ~~~~~~~~^~~~~
foo.c: In function ‘mon_out’:
foo.c:41:49: error: expected ‘)’ before ‘x’
41 | {unsigned ret=((x+(unsigned long long)(unsigned(x)*r)*mod)>>32);return ret<mod?ret:ret-mod;}
| ^
| )
foo.c:41:51: error: expected ‘)’ before ‘*’ token
41 | {unsigned ret=((x+(unsigned long long)(unsigned(x)*r)*mod)>>32);return ret<mod?ret:ret-mod;}
| ~ ^
| )
foo.c: In function ‘solve’:
foo.c:47:42: warning: implicit declaration of function ‘exgcd’ [-Wimplicit-function-declaration]
47 | n2_=-(unsigned long long)mod%mod;exgcd(mod,1ll<<32,x,y);r=-unsigned(x);//初始化一些蒙哥马利约减需要使用的变量
| ^~~~~
foo.c:47:68: error: expected expression before ‘unsigned’
47 | n2_=-(unsigned long long)mod%mod;exgcd(mod,1ll<<32,x,y);r=-unsigned(x);//初始化一些蒙哥马利约减需要使用的变量
| ^~~~~~~~
foo.c:60:35: error: incompatible type for argument 1 of ‘mul’
60 | unsigned as=mul(mul(mul(fl[0],fl[1]),mul(fl[2],fl[3])),mul(mul(fl[4],fl[5]),mul(fl[6],fl[7])));//取出ans的8位并相乘
| ~~^~~
| |
| unsigned int
foo.c:27:28: note: expected ‘__m256i’ but argument is of type ‘unsigned int’
27 | inline __m256i mul(__m256i _num1,__m256i _num2)//将8个32位整数相乘并取模
| ~~~~~~~~^~~~~
foo.c:60:41: error: incompatible type for argument 2 of ‘mul’
60 | unsigned as=mul(mul(mul(fl[0],fl[1]),mul(fl[2],fl[3])),mul(mul(fl[4],fl[5]),mul(fl[6],fl[7])));//取出ans的8位并相乘
| ~~^~~
| |
| unsigned int
foo.c:27:42: note: expected ‘__m256i’ but argument is of type ‘unsigned int’
27 | inline __m256i mul(__m256i _num1,__m256i _num2)//将8个32位整数相乘并取模
| ~~~~~~~~^~~~~
foo.c:60:52: error: incompatible type for argument 1 of ‘mul’
60 | unsigned as=mul(mul(mul(fl[0],fl[1]),mul(fl[2],fl[3])),mul(mul(fl[4],fl[5]),mul(fl[6],fl[7])));//取出ans的8位并相乘
| ~~^~~
| |
| unsigned int
foo.c:27:28: note: expected ‘__m256i’ but argument is of type ‘unsigned int’
27 | inline __m256i mul(__m256i _num1,__m256i _num2)//将8个32位整数相乘并取模
| ~~~~~~~~^~~~~
foo.c:60:58: error: incompatible type for argument 2 of ‘mul’
60 | unsigned as=mul(mul(mul(fl[0],fl[1]),mul(fl[2],fl[3])),mul(mul(fl[4],fl[5]),mul(fl[6],fl[7])));//取出ans的8位并相乘
| ~~^~~
| |
| unsigned int
foo.c:27:42: note: expected ‘__m256i’ but argument is of type ‘unsigned int’
27 | inline __m256i mul(__m256i _num1,__m256i _num2)//将8个32位整数相乘并取模
| ~~~~~~~~^~~~~
foo.c:60:74: error: incompatible type for argument 1 of ‘mul’
60 | unsigned as=mul(mul(mul(fl[0],fl[1]),mul(fl[2],fl[3])),mul(mul(fl[4],fl[5]),mul(fl[6],fl[7])));//取出ans的8位并相乘
| ~~^~~
| |
| unsigned int
foo.c:27:28: note: expected ‘__m256i’ but argument is of type ‘unsigned int’
27 | inline __m256i mul(__m256i _num1,__m256i _num2)//将8个32位整数相乘并取模
| ~~~~~~~~^~~~~
foo.c:60:80: error: incompatible type for argument 2 of ‘mul’
60 | unsigned as=mul(mul(mul(fl[0],fl[1]),mul(fl[2],fl[3])),mul(mul(fl[4],fl[5]),mul(fl[6],fl[7])));//取出ans的8位并相乘
| ~~^~~
| |
| unsigned int
foo.c:27:42: note: expected ‘__m256i’ but argument is of type ‘unsigned int’
27 | inline __m256i mul(__m256i _num1,__m256i _num2)//将8个32位整数相乘并取模
| ~~~~~~~~^~~~~
foo.c:60:91: error: incompatible type for argument 1 of ‘mul’
60 | unsigned as=mul(mul(mul(fl[0],fl[1]),mul(fl[2],fl[3])),mul(mul(fl[4],fl[5]),mul(fl[6],fl[7])));//取出ans的8位并相乘
| ~~^~~
| |
| unsigned int
foo.c:27:28: note: expected ‘__m256i’ but argument is of type ‘unsigned int’
27 | inline __m256i mul(__m256i _num1,__m256i _num2)//将8个32位整数相乘并取模
| ~~~~~~~~^~~~~
foo.c:60:97: error: incompatible type for argument 2 of ‘mul’
60 | unsigned as=mul(mul(mul(fl[0],fl[1]),mul(fl[2],fl[3])),mul(mul(fl[4],fl[5]),mul(fl[6],fl[7])));//取出ans的8位并相乘
| ~~^~~
| |
| unsigned int
foo.c:27:42: note: expected ‘__m256i’ but argument is of type ‘unsigned int’
27 | inline __m256i mul(__m256i _num1,__m256i _num2)//将8个32位整数相乘并取模
| ~~~~~~~~^~~~~
foo.c: At top level:
foo.c:41:88: warning: ‘mod’ is static but used in inline function ‘mon_out’ which is not static
41 | {unsigned ret=((x+(unsigned long long)(unsigned(x)*r)*mod)>>32);return ret<mod?ret:ret-mod;}
| ^~~
foo.c:41:76: warning: ‘mod’ is static but used in inline function ‘mon_out’ which is not static
41 | {unsigned ret=((x+(unsigned long long)(unsigned(x)*r)*mod)>>32);return ret<mod?ret:ret-mod;}
| ^~~
foo.c:41:55: warning: ‘mod’ is static but used in inline function ‘mon_out’ which is not static
41 | {unsigned ret=((x+(unsigned long long)(unsigned(x)*r)*mod)>>32);return ret<mod?ret:ret-mod;}
| ^~~
foo.c:39:49: warning: ‘n2_’ is static but used in inline function ‘mon_in’ which is not static
39 | inline unsigned mon_in(unsigned x){return mul(x,n2_);}//进入蒙哥马利数域
| ^~~
foo.c:36:58: warning: ‘hi32’ is static but used in inline function ‘mul’ which is not static
36 | _num1=_mm256_and_si256(_mm256_add_epi64(_num1,_num2),hi32);//通过跟hi32做与取出低32位(偶数位)
| ^~~~
foo.c:35:58: warning: ‘mod1’ is static but used in inline function ‘mul’ which is not static
35 | _num1=_mm256_mul_epu32(_mm256_mul_epu32(_num2,R),mod1);
| ^~~~
foo.c:35:55: warning: ‘R’ is static but used in inline function ‘mul’ which is not static
35 | _num1=_mm256_mul_epu32(_mm256_mul_epu32(_num2,R),mod1);
| ^
foo.c:31:58: warning: ‘mod1’ is static but used in inline function ‘mul’ which is not static
31 | _num1=_mm256_mul_epu32(_mm256_mul_epu32(_num2,R),mod1);
| ^~~~
foo.c:31:55: warning: ‘R’ is static but used in inline function ‘mul’ which is not static
31 | _num1=_mm256_mul_epu32(_mm256_mul_epu32(_num2,R),mod1);
| ^
foo.c:24:34: warning: ‘mod1’ is static but used in inline function ‘add’ which is not static
24 | add=_mm256_and_si256(cmp,mod1);
| ^~~~
foo.c:23:40: warning: ‘a0’ is static but used in inline function ‘add’ which is not static
23 | __m256i cmp=_mm256_cmpgt_epi32(a0,ret),//得到答案内小于0的数
| ^~
foo.c:22:34: warning: ‘mod1’ is static but used in inline function ‘add’ which is not static
22 | ret=_mm256_sub_epi32(apb,mod1);//将答案减去mod
| ^~~~
foo.c:17:55: warning: ‘mod’ is static but used in inline function ‘mul’ which is not static
17 | return (z+(unsigned long long)(unsigned(z)*r)*mod)>>32;//对p取模
| ^~~
foo.c: In function ‘mon_in’:
foo.c:39:54: warning: control reaches end of non-void function [-Wreturn-type]
39 | inline unsigned mon_in(unsigned x){return mul(x,n2_);}//进入蒙哥马利数域
| ^