Код: Выделить всё
[...]
missed: not inlinable: auto funcB(int_fast16_t, int_fast16_t)/20 -> auto funcA(int_fast16_t, int_fast16_t)/19, call is unlikely and code size would grow
Unit growth for small function inlining: 0->0 (0%)
Inlined 3 calls, eliminated 0 functions
[...]
auto funcA(std::int_fast16_t a, std::int_fast16_t b)
{
Considering inline candidate ldiv_t std::div(long int, long int)/17.
Inlining ldiv_t std::div(long int, long int)/17 into auto funcA(int_fast16_t, int_fast16_t)/19.
auto div{std::div(a, b)};
return div.quot + !!div.rem;
}
auto funcB(std::int_fast16_t a, std::int_fast16_t b)
{
Considering inline candidate ldiv_t std::div(long int, long int)/17.
Inlining ldiv_t std::div(long int, long int)/17 into auto funcB(int_fast16_t, int_fast16_t)/20.
auto div{std::div(a, b)};
return div.quot + (div.rem != 0);
}
auto funcC(std::int_fast16_t a, std::int_fast16_t b)
{
Considering inline candidate ldiv_t std::div(long int, long int)/17.
Inlining ldiv_t std::div(long int, long int)/17 into auto funcC(int_fast16_t, int_fast16_t)/21.
auto div{std::div(a, b)};
auto repetitions{div.quot};
if (div.rem != 0)
++repetitions;
return repetitions;
}
Код: Выделить всё
"funcA(long, long)":
push rax
call "ldiv"
cmp rdx, 1
pop rdx
sbb rax, -1
ret
"funcB(long, long)":
jmp "funcA(long, long)"
"funcC(long, long)":
push rax
call "ldiv"
cmp rdx, 1
pop rdx
sbb rax, -1
ret
< /code>
Что, если что -то, я делаю здесь не так? Как я могу заставить два взгляда быть последовательными? DOT:
[list]
[*] вставленное код в файл test.cpp
[*] gccmmm = intel -fno -verbose-asmasm --s -s-fdiAgnostco -color = gccmm = intel -fno -verbose-asmasm --s -h -fopt -info -all = all.opt -Std = c ++ 2a -os -finline -functions test.cpp
[/list]
=> также утверждает, что встроенный в линии все три std :: div> gr/gc. работать?
Подробнее здесь: https://stackoverflow.com/questions/796 ... it-has-not