As Dan pointed out, movzbl, movsbl, and friends are nicer than their alias
[oota-llvm.git] / test / CodeGen / X86 / cmov.ll
index d96babb447344161f398122aa2b3cc9be4d892b0..39d9d1e9ec0e211cdc64383dc605cc04da4dc3e8 100644 (file)
@@ -6,7 +6,7 @@ entry:
 ; CHECK: test1:
 ; CHECK: btl
 ; CHECK-NEXT: movl     $12, %eax
-; CHECK-NEXT: cmovae   (%rcx), %eax
+; CHECK-NEXT: cmovael  (%rcx), %eax
 ; CHECK-NEXT: ret
 
        %0 = lshr i32 %x, %n            ; <i32> [#uses=1]
@@ -21,7 +21,7 @@ entry:
 ; CHECK: test2:
 ; CHECK: btl
 ; CHECK-NEXT: movl     $12, %eax
-; CHECK-NEXT: cmovb    (%rcx), %eax
+; CHECK-NEXT: cmovbl   (%rcx), %eax
 ; CHECK-NEXT: ret
 
        %0 = lshr i32 %x, %n            ; <i32> [#uses=1]
@@ -33,11 +33,15 @@ entry:
 }
 
 
+; x86's 32-bit cmov doesn't clobber the high 32 bits of the destination
+; if the condition is false. An explicit zero-extend (movl) is needed
+; after the cmov.
+
 declare void @bar(i64) nounwind
 
 define void @test3(i64 %a, i64 %b, i1 %p) nounwind {
 ; CHECK: test3:
-; CHECK:      cmovne  %edi, %esi
+; CHECK:      cmovnel %edi, %esi
 ; CHECK-NEXT: movl    %esi, %edi
 
   %c = trunc i64 %a to i32