Forum Discussion
Altera_Forum
Honored Contributor
22 years agoSign Extend operation
Hi, Now I am worry about performance of Sign Extend operation. for example, char sc(unsgined char uc) { return (signed char) uc; } Nios II GCC will generates following cod...
Altera_Forum
Honored Contributor
22 years agoOppps thought you were doing shifting not sign extension.
To do sign extension you could look at the sign bit and OR the upper bits with a high mask if it was set (might be a bit faster). If that doesn't work let me know and I'll figure out what would slow those instructions down.