[PATCH] D16907: [X86] Don't zero/sign-extend i1 or i8 return values to 32 bits (PR22532)

James Y Knight via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 14:59:14 PST 2016


jyknight added a comment.

Why do you say GCC extends 16-bit numbers?

Given:

  short global1, global2;
  short bar() {
    return global1 + global2;
  }

$ gcc -march=i386 -O2 -S -o - -m32

Results in:

  bar:
        movw    global2, %ax
        addw    global1, %ax
        ret

If you use -march=i686, then it results in:

  bar:
        movzwl  global2, %eax
        addw    global1, %ax
        ret


http://reviews.llvm.org/D16907





More information about the llvm-commits mailing list