Home > other >  Would like to ask a question on the neon
Would like to ask a question on the neon

Time:10-31

Hello, would like to ask a question about neon,
I define a function in C, the participation of his request is int32, like this: the convert (SRC, DST, int32 b)
But I need use inside the function instruction vqrshrun_n_s32 (int32x4_t a, const int n) shift instruction, initialized directly with b const int n=b instruction calls again, compile error number n is not always immediately, but int c=2, and then assigned to the n is no problem, would like to ask is why, thank you.

CodePudding user response:

Reference
compile error number n is not always immediately
an error, and submitted to the number of b is not always immediately; Or can try const int n=(const int) b. Conduct casts?

CodePudding user response:

reference 1/f, zara's reply:
reference
compile error number n is not always immediately
an error, and submitted to the number of b is not always immediately; Or can try const int n=(const int) b. Conduct casts?


An error as shown in figure, will direct the second parameter error instructions,

Casts are tried, the same error, I don't understand the instructions, what is the problem,

CodePudding user response:

At the same time, vshr_n_s32 instruction can be normal use, but with other prefix with same complains a suffix, such as vrshr_n_s32 instructions,

CodePudding user response:

Mistake # 2 don't mean that ah, the error message is the second parameter or temp requirement must be a constant number immediately, such as 2 or 5, can't be other variables, and whether the int or const int has nothing to do; Should be the parameters corresponding to the last instructions is asking for is number immediately, can't be a register or memory,

CodePudding user response:

Zara
refer to 4th floor response:
mistake # 2 don't mean that ah, the error message is the second parameter or temp requirement must be a constant number immediately, such as 2 or 5, can't be other variables, and whether the int or const int has nothing to do; Should be the parameters corresponding to the last instructions is asking for is number immediately, can't be a register or memory,

That is there any way to change it for me?

CodePudding user response:

Zara
refer to 4th floor response:
mistake # 2 don't mean that ah, the error message is the second parameter or temp requirement must be a constant number immediately, such as 2 or 5, can't be other variables, and whether the int or const int has nothing to do; Should be the parameters corresponding to the last instructions is asking for is number immediately, can't be a register or memory,

And why can int a=2 and n=a...
I'm not too good of computer master

CodePudding user response:

You put n as the function of the second parameter is ok? Or is it just these two statements can be? If the former, you should not probably, though I didn't contact with for this, but look at the screenshot of the message and online search related function (I think I should not function but the macro definition) that are mentioned the immediate value, is the number immediately, unlike ordinary function parameters,
So try, you can directly use a numerical value in the parameter, see if we can pass, if can, it should be the problem, if it still need to use variables, may through the value of the variable may write a bunch of function calls, if there are problems, relevant variables definition and use of complete content posted?

CodePudding user response:

Vqrshrun_n_s32 (int32x4_t a, const int n) this can determine the value of n must be a compile time, not a variable

CodePudding user response:

Zara
reference 7 floor response:
you n as the function of the second parameter is ok? Or is it just these two statements can be? If the former, you should not probably, though I didn't contact with for this, but look at the screenshot of the message and online search related function (I think I should not function but the macro definition) that are mentioned the immediate value, is the number immediately, unlike ordinary function parameters,
So try, you can directly use a numerical value in the parameter, see if we can pass, if can, it should be the problem, if it still need to use variables, may through the value of the variable may write a bunch of function calls, if there are problems, relevant variables definition and use of complete content posted?

With a value can be directly, but int a=2 n=a, reoccupy n as parameters can also pass so I don't quite understand what the problem now

CodePudding user response:

refer to eight floor early play play nuclear response:
vqrshrun_n_s32 (int32x4_t a, const int n) this can determine the value of n must be a compile time, not is a variable

That's ok with that why I said on the first floor? I didn't

CodePudding user response:

# 9 if only the two sentences could be compiler optimization into n as a fixed value, 2 a, use the scanf () function assignment again n=a, then calls the function? If can, it's strange; If not, probably just in front of the reason,
  • Related