Hardware implementation: support long long

2 views (last 30 days)
Hello,
I'm using an infineon C166 target (HW). This exist in the pre define HW configuration in matlab.
The "support long long" option is not checked and in fact, my compilator doesn't support long long. So that is correct.
But the advisor still wants me to check the "support long long" option (because of my objectives).
The results is that my generation in not "all green checked" just for this warning.
Of course I can't accept this modification (The compilation of generated code failed as long long is not supported in reality).
How can I indicate to the advisor that this can not be done and in the same time conserve the same objectives?
  2 Comments
John D'Errico
John D'Errico on 16 Nov 2018
MATLAB offers no support at all for long long arithmetic. At best you could use tools like the symbolic toolbox for higher precision, or my own HPF toolbox. But either of those options will be very slow compared to MATLAB computations done using doubles.
Walter Roberson
Walter Roberson on 16 Nov 2018
long long is matlab's int64 except for saturation behavior .

Sign in to comment.

Accepted Answer

Yohann GOYER
Yohann GOYER on 16 Nov 2018
What I didn't anderstand is that this option "Support Long long" is: Me as developper indicate to Matlab that my compiler doesn't support long long (or yes it is supported).
I give here the option description (2018a):
"Specify whether the C compiler for production hardware supports long long.
Most C99 compilers support long long."
How can the advisor say that for efficiency the generated code shall use long long? => Hey, use long long, it will not work as you say your compiler doesn't support it but YOLO!
I think matlab belives that my compiler is C99 (I got a warning for simulation advisor that suggest me to select C99 instead of C90). But in fact my compiler is C90 (without long long introduced in C99).
It is in fact a bug in the algorithm for this advise. This shall be reported, and I hope fixed.
I don't know the way to do that.
  2 Comments
Walter Roberson
Walter Roberson on 19 Nov 2018
Were you able to find a way to deal with the situation?
Yohann GOYER
Yohann GOYER on 19 Nov 2018
I juste hope that Mathworks will fix the bug.
until the fix, I will just continue to ignor the warning and have repport of generated code with warning (not completly green => need to add more documentation to explain why).
Wait and see.

Sign in to comment.

More Answers (1)

Yohann GOYER
Yohann GOYER on 16 Nov 2018
In fact when the option is checked, the generated code use long long variables that are not recognized by my compilator (2018a).
The problem is more that the code advisor want me to check the option (even if the generated code doesn't work) and that create a warn in the advisor log (and make the advisor panel stay open at the end of the code generation that is a problem for my script).
My question is how to indicate to the code advisor that the proposition is not correct and that it shalls ignor this option?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!