4 ms·
Moving the constant to file or anonymous namespace scope solves the issue. It's too bad that intrinsics are not `constexpr` because I have a powerful urge to ha
by jeffbee 4y ago
Moving the constant to file or anonymous namespace scope solves the issue. It's too bad that intrinsics are not `constexpr` because I have a powerful urge to hang a `constinit` in front of this line.
- gumby 4y agoDisturbing that this works, as it shouldn't do the reload even if the constant is passed in as a parameter.
- leni536 4y agoIn this particular case the broadcasting instruction can be replaced with builtin operations, allowing constexpr. https://godbolt.org/z/Td6vG9cqG https://godbolt.org/z/Td6vG9cqG edit: uh, the constant requires some hand adjustment edit2: fixed version https://godbolt.org/z/4Px5Mbsx4 https://godbolt.org/z/4Px5Mbsx4, and I just don't get this. gcc really just wants to load that constant twice.
- mzs 4y agoAre you sure? I see this twice in the dis on the right: mov eax, 10001 vpbroadcastd ymm1, eax