4 ms·
I don't see anything on that page referencing C++20. Am I missing something? On a related note, I always find the official docs for GCC inline assembly are ins
by haberman 7y ago
I don't see anything on that page referencing C++20. Am I missing something?
On a related note, I always find the official docs for GCC inline assembly are insufficient for figuring out what I am trying to do. I nearly always have to resort to dumb trial and error. I was just recently planning to write some docs of my own on the subject. Not tutorial docs, but reference docs.
- ____Sash---701_ 7y agoI believe it was discussed in Cologne, 'Enabling Constexpr Intrinsics......' - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1668r0.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p166... Quite a meaty document, should provide you with help for material on the subject.
- paulirwin 7y agoEven as a C++ amateur I didn't find it as a meaty or intimidating proposal, rather it was refreshingly brief. If you understand that constexpr functions can be evaluated at either run time or compile time, it makes sense that asm isn't allowed in a compile-time context (it could get really trippy if it was!). This allows for flow analysis to permit asm when evaluating at runtime within a constexpr function, as long as there's a non-asm constexpr alternative path available at compile time. If I'm misunderstanding or missing some subtleties, as a novice I'd appreciate any corrections.
- stevekemp 7y agoTrial and error is valuable, but if you go to github and search for "movq", "ld a,(hl)", or similar string you can often find examples of code that is presumably working. I'm reminding myself of Z80 assembly at the moment, building a simple computer and I've done a bit of that.