3 ms·
I posted a reply, but I think ultimately this is just a coincidence. There's a naïve reason that "mov S P" looks redundant ("just use S instead of P later"), bu
by pfedak 3y ago
I posted a reply, but I think ultimately this is just a coincidence. There's a naïve reason that "mov S P" looks redundant ("just use S instead of P later"), but in typical GPT fashion, this is specious, and can't actually be done. It's essentially trying to swap two variables without using a temporary. If x86 had a conditional swap instruction, it could, but it doesn't, and just doing "cmp,cmov,cmov" can't handle it.
Another giveaway is that removing that line in the real optimization changes the output of the provided snippet if C < B. It feels like a hard sell to say GPT picked this line for that subtle reason based on information not provided, but explained it with something only correct at surface level.
- pfedak 3y agoUh, I guess this got combined with the thread on https://twitter.com/DimitrisPapail/status/1666843952824168465 https://twitter.com/DimitrisPapail/status/166684395282416846.... The original result is legit, this GPT tweet has a number of issues