Yes, that's right, unless the two operands have no side effects. In that case the compiler is free to use a select because the difference is not observable.
On Wed, Nov 13, 2019 at 11:18 AM Stéphane Letz <[email protected]> wrote: > So, It means the (cond ? then : else) kind of semantic has to be > implemented using "if" right ? > > Le mercredi 13 novembre 2019 20:10:20 UTC+1, Thomas Lively a écrit : >> >> No, it unconditionally evaluates all arguments. >> >> On Wed, Nov 13, 2019 at 11:09 AM Stéphane Letz <[email protected]> wrote: >> >>> Does WebAssembly "select" instruction behaves like C/C++ (cond ? then : >>> else), that is compute *only* one of the two branches depending of the >>> "cond" value? >>> >>> Thanks. >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "emscripten-discuss" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/emscripten-discuss/06055c34-5186-4f6b-92f7-eb6a9580f893%40googlegroups.com >>> <https://groups.google.com/d/msgid/emscripten-discuss/06055c34-5186-4f6b-92f7-eb6a9580f893%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/972b55b8-2508-464e-830e-def000c485c2%40googlegroups.com > <https://groups.google.com/d/msgid/emscripten-discuss/972b55b8-2508-464e-830e-def000c485c2%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAJZD_EUvd8H5cWU_dXc65Kt84XRuhmWpCVcavOWVxEkVQYw80w%40mail.gmail.com.
