News for hackers. Stuff that matters.
Re:Why C Is Not Assembly by jedbrown on Tuesday September 14, 2010 @07:21AM (#1690165)
I suspect this guy never compiled the code he posted. Not that his claim was completely wrong, but gcc-4.4.4, gcc-4.5.1, and clang-1.1 (LLVM-2.7) all fail to vectorize that snippet, with `gcc-4.5.1 -O3 -ftree-vectorize -ftree-vectorizer-verbose=9`, I get

    note: not vectorized: number of iterations cannot be computed.
    note: bad loop form.
    note: vectorized 0 loops in function.
However, gcc-4.5.1 and gcc-4.4.4 vectorize it when the operation is written as a standard `for` loop. Clang never vectorizes it.
Re:Why C Is Not Assembly by nova on Tuesday September 14, 2010 @02:07PM (#1691584)
Try -march=<cpu>
Re:Why C Is Not Assembly by jedbrown on Tuesday September 14, 2010 @04:40PM (#1692223)
Makes no difference because it's not the issue.