diff --git a/llvm/test/CodeGen/X86/cmp.ll b/llvm/test/CodeGen/X86/cmp.ll --- a/llvm/test/CodeGen/X86/cmp.ll +++ b/llvm/test/CodeGen/X86/cmp.ll @@ -530,6 +530,45 @@ ret i32 %ret } +define i1 @shifted_mask_testb(i64 %a) { +; CHECK-LABEL: shifted_mask_testb: +; CHECK: # %bb.0: +; CHECK-NEXT: movabsq $287104476244869120, %rax # encoding: [0x48,0xb8,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x03] +; CHECK-NEXT: # imm = 0x3FC000000000000 +; CHECK-NEXT: testq %rax, %rdi # encoding: [0x48,0x85,0xc7] +; CHECK-NEXT: setne %al # encoding: [0x0f,0x95,0xc0] +; CHECK-NEXT: retq # encoding: [0xc3] + %v0 = and i64 %a, 287104476244869120 ; 0xff << 50 + %v1 = icmp ne i64 %v0, 0 + ret i1 %v1 +} + +define i1 @shifted_mask_testw(i64 %a) { +; CHECK-LABEL: shifted_mask_testw: +; CHECK: # %bb.0: +; CHECK-NEXT: movabsq $562941363486720, %rax # encoding: [0x48,0xb8,0x00,0x00,0x00,0x00,0xfe,0xff,0x01,0x00] +; CHECK-NEXT: # imm = 0x1FFFE00000000 +; CHECK-NEXT: testq %rax, %rdi # encoding: [0x48,0x85,0xc7] +; CHECK-NEXT: setne %al # encoding: [0x0f,0x95,0xc0] +; CHECK-NEXT: retq # encoding: [0xc3] + %v0 = and i64 %a, 562941363486720 ; 0xffff << 33 + %v1 = icmp ne i64 %v0, 0 + ret i1 %v1 +} + +define i1 @shifted_mask_testl(i64 %a) { +; CHECK-LABEL: shifted_mask_testl: +; CHECK: # %bb.0: +; CHECK-NEXT: movabsq $549755813760, %rax # encoding: [0x48,0xb8,0x80,0xff,0xff,0xff,0x7f,0x00,0x00,0x00] +; CHECK-NEXT: # imm = 0x7FFFFFFF80 +; CHECK-NEXT: testq %rax, %rdi # encoding: [0x48,0x85,0xc7] +; CHECK-NEXT: sete %al # encoding: [0x0f,0x94,0xc0] +; CHECK-NEXT: retq # encoding: [0xc3] + %v0 = and i64 %a, 549755813760 ; 0xffffffff << 7 + %v1 = icmp eq i64 %v0, 0 + ret i1 %v1 +} + define { i64, i64 } @pr39968(i64, i64, i32) { ; CHECK-LABEL: pr39968: ; CHECK: # %bb.0: @@ -555,13 +594,13 @@ ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: cmpl $32767, %edi # encoding: [0x81,0xff,0xff,0x7f,0x00,0x00] ; CHECK-NEXT: # imm = 0x7FFF -; CHECK-NEXT: jne .LBB33_2 # encoding: [0x75,A] -; CHECK-NEXT: # fixup A - offset: 1, value: .LBB33_2-1, kind: FK_PCRel_1 +; CHECK-NEXT: jne .LBB36_2 # encoding: [0x75,A] +; CHECK-NEXT: # fixup A - offset: 1, value: .LBB36_2-1, kind: FK_PCRel_1 ; CHECK-NEXT: # %bb.1: # %if.then ; CHECK-NEXT: jmp g@PLT # TAILCALL ; CHECK-NEXT: # encoding: [0xeb,A] ; CHECK-NEXT: # fixup A - offset: 1, value: g@PLT-1, kind: FK_PCRel_1 -; CHECK-NEXT: .LBB33_2: # %if.end +; CHECK-NEXT: .LBB36_2: # %if.end ; CHECK-NEXT: jmp f@PLT # TAILCALL ; CHECK-NEXT: # encoding: [0xeb,A] ; CHECK-NEXT: # fixup A - offset: 1, value: f@PLT-1, kind: FK_PCRel_1