)]}'
{
  "commit": "fa271afb58423014e2feef9f15c1a87428e64ddc",
  "tree": "15c51f88c30653991ae0bd1d4a3747e08d660cb4",
  "parents": [
    "ee86bdd1d367bc174d7b50bd2ffa5622c4766322"
  ],
  "author": {
    "name": "Jakub Jelinek",
    "email": "jakub@redhat.com",
    "time": "Tue Nov 08 12:21:55 2022 +0100"
  },
  "committer": {
    "name": "Jakub Jelinek",
    "email": "jakub@redhat.com",
    "time": "Tue Nov 08 12:21:55 2022 +0100"
  },
  "message": "i386: Improve vector [GL]E{,U} comparison against vector constants [PR107546]\n\nFor integer vector comparisons without XOP before AVX512{F,VL} we are\nconstrained by only GT and EQ being supported in HW.\nFor GTU we play tricks to implement it using GT or unsigned saturating\nsubtraction, for LT/LTU we swap the operands and thus turn it into\nGT/GTU.  For LE/LEU we handle it by using GT/GTU and negating the\nresult and for GE/GEU by using GT/GTU on swapped operands and negating\nthe result.\nIf the second operand is a CONST_VECTOR, we can usually do better though,\nwe can avoid the negation.  For LE/LEU cst by doing LT/LTU cst+1 (and\nthen cst+1 GT/GTU x) and for GE/GEU cst by doing GT/GTU cst-1, provided\nthere is no wrap-around on those cst+1 or cst-1.\nGIMPLE canonicalizes x \u003c cst to x \u003c\u003d cst-1 etc. (the rule is smaller\nabsolute value on constant), but only for scalars or uniform vectors,\nso in some cases this undoes that canonicalization in order to avoid\nthe extra negation, but it handles also non-uniform constants.\nE.g. with -mavx2 the testcase assembly difference is:\n-       movl    $47, %eax\n+       movl    $48, %eax\n        vmovdqa %xmm0, %xmm1\n        vmovd   %eax, %xmm0\n        vpbroadcastb    %xmm0, %xmm0\n-       vpminsb %xmm0, %xmm1, %xmm0\n-       vpcmpeqb        %xmm1, %xmm0, %xmm0\n+       vpcmpgtb        %xmm1, %xmm0, %xmm0\nand\n-       vmovdqa %xmm0, %xmm1\n-       vmovdqa .LC1(%rip), %xmm0\n-       vpminsb %xmm1, %xmm0, %xmm1\n-       vpcmpeqb        %xmm1, %xmm0, %xmm0\n+       vpcmpgtb        .LC1(%rip), %xmm0, %xmm0\nwhile with just SSE2:\n-       pcmpgtb .LC0(%rip), %xmm0\n-       pxor    %xmm1, %xmm1\n-       pcmpeqb %xmm1, %xmm0\n+       movdqa  %xmm0, %xmm1\n+       movdqa  .LC0(%rip), %xmm0\n+       pcmpgtb %xmm1, %xmm0\nand\n-       movdqa  %xmm0, %xmm1\n-       movdqa  .LC1(%rip), %xmm0\n-       pcmpgtb %xmm1, %xmm0\n-       pxor    %xmm1, %xmm1\n-       pcmpeqb %xmm1, %xmm0\n+       pcmpgtb .LC1(%rip), %xmm0\n\n2022-11-08  Jakub Jelinek  \u003cjakub@redhat.com\u003e\n\n\tPR target/107546\n\t* config/i386/predicates.md (vector_or_const_vector_operand): New\n\tpredicate.\n\t* config/i386/sse.md (vec_cmp\u003cmode\u003e\u003csseintvecmodelower\u003e,\n\tvec_cmpv2div2di, vec_cmpu\u003cmode\u003e\u003csseintvecmodelower\u003e,\n\tvec_cmpuv2div2di): Use nonimmediate_or_const_vector_operand\n\tpredicate instead of nonimmediate_operand and\n\tvector_or_const_vector_operand instead of vector_operand.\n\t* config/i386/i386-expand.cc (ix86_expand_int_sse_cmp): For\n\tLE/LEU or GE/GEU with CONST_VECTOR cop1 try to transform those\n\tinto LE/LEU or GT/GTU with larger or smaller by one cop1 if\n\tthere is no wrap-around.  Force CONST_VECTOR cop0 or cop1 into\n\tREG.  Formatting fix.\n\n\t* gcc.target/i386/pr107546.c: New test.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2e0d12c010881e45ff9c7ed41aef484acaf66b0d",
      "old_mode": 33188,
      "old_path": "gcc/config/i386/i386-expand.cc",
      "new_id": "9c92b07d5cd84c64611eb66aa0ee0136ea526085",
      "new_mode": 33188,
      "new_path": "gcc/config/i386/i386-expand.cc"
    },
    {
      "type": "modify",
      "old_id": "2a3f07224cc8155b803eda5331975c38336f5315",
      "old_mode": 33188,
      "old_path": "gcc/config/i386/predicates.md",
      "new_id": "f995503838654969b5fa7508bc0d2c412a8b5e0b",
      "new_mode": 33188,
      "new_path": "gcc/config/i386/predicates.md"
    },
    {
      "type": "modify",
      "old_id": "fa93ae7bf21574f862133f16b7ac3aa544a69f8e",
      "old_mode": 33188,
      "old_path": "gcc/config/i386/sse.md",
      "new_id": "9a4fc01856dd6c2f889021a1dfbc82206bb1791d",
      "new_mode": 33188,
      "new_path": "gcc/config/i386/sse.md"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e5cf56d762058448871bfc64688088322fc230f0",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.target/i386/pr107546.c"
    }
  ]
}
