Re: TI compiler
William Westfield <[email protected]> Fri, 24 Mar 2017 15:39:40 -0700
| Newsgroups | gmane.comp.hardware.texas-instruments.msp430.gcc.user |
|---|---|
| Message-ID | <[email protected]> |
On Mar 23, 2017, at 3:45 AM, David W. Schultz <[email protected]>= wrote: > Making TXByte a signed int makes this go away. (The MSP430 doesn't have > a single instruction to do the unsigned right shift.) You don't need for > it to be unsigned because you don't care about those bits. Why does it need to be a =93single instruction=94 for the compiler to creat= e inline code for the shift (two instruction: "clrc; rrc", right) instead of pulling in (apparently) a = library that includes code for every possible shift count and size? Also: https://www.securecoding.cert.org/confluence/display/c/INT13-C.+Use+b= itwise+operators+only+on+unsigned+operands BillW ---------------------------------------------------------------------------= --- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot