3 ms·
Can you show your code for 8 bit case that fails to generate rol?
by vardump 8y ago
Can you show your code for 8 bit case that fails to generate rol?
- magicalhippo 8y agoSeems I must have messed something up in the initial testing. Now it outputs rol with uint8_t too. Well, that's good to know. For the record, here was what I was testing: #include <iostream> uint8_t rol(uint8_t x, uint8_t c) { return (x << c | x >> (sizeof(x) * 8 - c)); } int main() { volatile uint8_t a = 0b01010000; volatile uint8_t b = 3; uint8_t c = rol(a, b); std::cout << static_cast<unsigned int>(0b10000010) << std::endl; std::cout << static_cast<unsigned int>(c) << std::endl; return 0; }