)]}'
{
  "commit": "40c2f0369cc19251696b882ea41381b2c35708cd",
  "tree": "9740fc01eb38bf694f4ed3d9f1ee625ac7e8aca0",
  "parents": [
    "3c22c9f398e4b2fd1abe48af408578c847f81d51"
  ],
  "author": {
    "name": "Kyrylo Tkachov",
    "email": "ktkachov@nvidia.com",
    "time": "Mon Aug 03 09:10:26 2026 -0700"
  },
  "committer": {
    "name": "Kyrylo Tkachov",
    "email": "ktkachov@nvidia.com",
    "time": "Wed Aug 19 18:14:40 2026 +0200"
  },
  "message": "aarch64: name the saturating narrow patterns after the sstrunc and ustrunc optabs\n\nvect_recog_sat_trunc_pattern only forms .SAT_TRUNC when the target has the\nsstrunc or ustrunc optab for the mode pair, and the backend had neither, even\nthough aarch64_\u003csu\u003eqmovn\u003cmode\u003e already matches exactly the RTL those optabs\ndescribe.  A saturating narrowing loop was therefore vectorised as a pair of\nclamps and a permute:\n\n  static inline unsigned char clip (unsigned short x)\n  { return x \u0026 ~255 ? 255 : x; }\n  for (i) r[i] \u003d clip (x[i]);\n\n  before\t\t\t\tafter\n\n  movi\tv29.8h, 0xff\t\t\tldp\tq30, q31, [x1], 32\n  ldp\tq31, q30, [x1], 32\t\tuqxtn\tv30.8b, v30.8h\n  umin\tv31.8h, v31.8h, v29.8h\t\tuqxtn\tv31.8b, v31.8h\n  umin\tv30.8h, v30.8h, v29.8h\t\tstp\td30, d31, [x0], 16\n  uzp1\tv31.16b, v31.16b, v30.16b\n  str\tq31, [x0], 16\n\nand the signed form was worse still, needing two constants and a pair of\ncompares per half.  Only the standard names were missing, so this adds the\nexpander and leaves the existing insn to match it.\n\nBootstrapped and tested on aarch64-none-linux-gnu.\n\ngcc/ChangeLog:\n\n\t* config/aarch64/iterators.md (vnarrowq): New mode attribute.\n\t(sat_trunc_op): New code attribute.\n\t* config/aarch64/aarch64-simd.md (\u003csat_trunc_op\u003etrunc\u003cmode\u003e\u003cvnarrowq\u003e2):\n\tNew expander.\n\ngcc/testsuite/ChangeLog:\n\n\t* gcc.target/aarch64/vect-sat-trunc-1.c: New test.\n\t* gcc.target/aarch64/vect-sat-trunc-2.c: New test.\n\nSigned-off-by: Kyrylo Tkachov \u003cktkachov@nvidia.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ae562ae5b6bcbf4ff53309e189bdc55e0cf4943e",
      "old_mode": 33188,
      "old_path": "gcc/config/aarch64/aarch64-simd.md",
      "new_id": "66369a5075a6d7dc5d6666ed213a65eaf1ff683f",
      "new_mode": 33188,
      "new_path": "gcc/config/aarch64/aarch64-simd.md"
    },
    {
      "type": "modify",
      "old_id": "8bfa642902656a1714fe4afa2dac5f9a4642d365",
      "old_mode": 33188,
      "old_path": "gcc/config/aarch64/iterators.md",
      "new_id": "1bc20d6151c9a7dc8262b35a712e9bc3542fd089",
      "new_mode": 33188,
      "new_path": "gcc/config/aarch64/iterators.md"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b31289713564834bb2caf9b626df365926c47547",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.target/aarch64/vect-sat-trunc-1.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "76d5d6e632f83526dc562ed56c2b4a0913d1a014",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.target/aarch64/vect-sat-trunc-2.c"
    }
  ]
}
