Re: [libstdc++] Optimize std::vector::operator[]
On Fri, 27 Dec 2024 at 20:13, Jan Hubicka wrote: > > Hi, > the following testcase: > > bool f(const std::vector& v, std::size_t x) { > return v[x]; > } > > is compiled as: > > f(std::vector > const&, unsigned long): > testq %rsi, %rsi > leaq63(%rsi), %rax > mo
[libstdc++] Optimize std::vector::operator[]
Hi, the following testcase: bool f(const std::vector& v, std::size_t x) { return v[x]; } is compiled as: f(std::vector > const&, unsigned long): testq %rsi, %rsi leaq63(%rsi), %rax movq(%rdi), %rdx cmovns %rsi, %rax sarq$6, %rax