Gcc: why aren't literal sheets optimized?

I am coding a game for iphone in c, and faced with some performance issues, I decided to use tools to check where the bottlenecks are, and I found out that sheets of literals are not optimized.

For instance:

if(x == (float)3) {....}

works faster if I write it like this:

if(x == 3.0f) {....}

Why is this not optimized by the compiler?
I am using gcc in release mode.

+3
source share
1 answer

Soooorry, as the comments say, I looked at the object code and the same.
Xcode tools give you in turn the amount of time that I think is not 100% reliable.

+1
source

Source: https://habr.com/ru/post/1788727/


All Articles