Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8358315

Question about parameter swaps in JDK-8351994

XMLWordPrintable

      JDK-8351994 introduced Assembler::emit_eevex_or_demote, which has:

        if (is_demotable(no_flags, dst_enc, nds_enc)) {
          int encode = is_prefixq ? prefixq_and_encode(src_enc, dst_enc, is_map1) : prefix_and_encode(src_enc, dst_enc, is_map1);

      The `src_enc` and `dst_enc` seem to be swapped here. prefixq_and_encode is:

        int prefixq_and_encode(int dst_enc, int src_enc, bool is_map1 = false);

      There are other patterns in the same file, like:

          if (swap) {
            encode = is_prefixq ? prefixq_and_encode(dst_enc, src_enc, is_map1) : prefix_and_encode(dst_enc, src_enc, is_map1);
          } else {
            encode = is_prefixq ? prefixq_and_encode(src_enc, dst_enc, is_map1) : prefix_and_encode(src_enc, dst_enc, is_map1);
          }

      ...which are also questionable. The "original" order is `dst_enc, src_enc`, yet we do it when `swap == true`?

      Please check if this makes sense.

            sparasa Srinivas Parasa
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: