)]}'
{
  "commit": "aa65cd8c8d69a344cffa3c63f21776d458de9914",
  "tree": "452009551da799e3ca0cc858dc8d5357d17e3ebf",
  "parents": [
    "0621cf67366ffa2215cdd081b1ca1c3c577e8b70"
  ],
  "author": {
    "name": "Matt Turner",
    "email": "mattst88@gmail.com",
    "time": "Sun Aug 09 16:06:29 2026 -0600"
  },
  "committer": {
    "name": "Jeff Law",
    "email": "jeffrey.law@oss.qualcomm.com",
    "time": "Sun Aug 09 16:06:29 2026 -0600"
  },
  "message": "[PATCH] alpha: round to odd before narrowing TFmode to SFmode\n\nAlpha has no instruction converting TFmode to SFmode, so trunctfsf2 goes\nthrough DFmode and has to avoid rounding twice.\n\nIt tried to, by setting a sticky bit at fraction bit 48 when the low word\nof the TFmode value was nonzero: a DFmode value with that bit set cannot\nsit exactly halfway between two SFmode values, leaving the second\nrounding nothing to break a tie on.  But the bit is set before the\nconversion to DFmode, and the carry out of the bits that conversion\ndiscards can propagate up through bit 48 and clear it, landing on the\nhalfway value it was there to avoid.\n\nRound to odd at the last fraction bit DFmode keeps instead.  The value is\nthen exactly representable in DFmode, so that conversion does not round\nand the one to SFmode is the only rounding.\n\nOver values constructed around SFmode halfway points the old sequence is\nwrong for about a quarter of them and the new one for none.  Uniformly\nrandom values do not reach it: that needs the conversion to DFmode to\ncarry all the way to a halfway value.\n\nRounding twice also loses the underflow flag when the result is subnormal.\nglibc\u0027s narrowing functions compute a round-to-odd value in the wider type\nand convert it once, and that single conversion is what is meant to raise\nunderflow; splitting it in two can leave the intermediate DFmode value\nexactly representable in SFmode, so the final step raises nothing.\n\nFound through glibc\u0027s math testsuite, where three of the narrowing fma\ntests returned a wrong result.  Retested there on an EV67 with a glibc\nbuilt by a compiler carrying this patch: the wrong results are gone, every\ntest now reporting a maximum error of 0 ulp, and the six narrowing add and\nsubtract tests that had been failing on the lost underflow flag pass.  The\nnarrowing tests that still fail there do so for an unrelated reason, Alpha\ndetermining tininess from the delivered result rather than as IEEE 754\ndescribes, which no change to the compiler can address.\n\ngcc/\n\t* config/alpha/alpha.md (trunctfsf2): Adjust sequence to avoid\n\tconversion step landing at a halfway value.\n\ngcc/testsuite/\n\n\t* gcc.target/alpha/trunctfsf2-1.c: New test.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "30a9f613e3787c5cfe80cdcbf0a6e84f73ce9242",
      "old_mode": 33188,
      "old_path": "gcc/config/alpha/alpha.md",
      "new_id": "2ca9dd65835d509b8ccde3da791a1ca4f1c2ff8b",
      "new_mode": 33188,
      "new_path": "gcc/config/alpha/alpha.md"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "14cb126d6eb5f920c0ea97344cfd07668dd6c34f",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.target/alpha/trunctfsf2-1.c"
    }
  ]
}
