]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/X86/GlobalISel/xor-scalar.ll
Vendor import of llvm trunk r321017:
[FreeBSD/FreeBSD.git] / test / CodeGen / X86 / GlobalISel / xor-scalar.ll
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL
3
4 define i32 @test_xor_i1(i32 %arg1, i32 %arg2) {
5 ; ALL-LABEL: test_xor_i1:
6 ; ALL:       # %bb.0:
7 ; ALL-NEXT:    cmpl %esi, %edi
8 ; ALL-NEXT:    sete %al
9 ; ALL-NEXT:    xorb %al, %al
10 ; ALL-NEXT:    movzbl %al, %eax
11 ; ALL-NEXT:    andl $1, %eax
12 ; ALL-NEXT:    retq
13   %c = icmp eq i32 %arg1, %arg2
14   %x = xor i1 %c , %c
15   %ret = zext i1 %x to i32
16   ret i32 %ret
17 }
18
19 define i8 @test_xor_i8(i8 %arg1, i8 %arg2) {
20 ; ALL-LABEL: test_xor_i8:
21 ; ALL:       # %bb.0:
22 ; ALL-NEXT:    xorb %dil, %sil
23 ; ALL-NEXT:    movl %esi, %eax
24 ; ALL-NEXT:    retq
25   %ret = xor i8 %arg1, %arg2
26   ret i8 %ret
27 }
28
29 define i16 @test_xor_i16(i16 %arg1, i16 %arg2) {
30 ; ALL-LABEL: test_xor_i16:
31 ; ALL:       # %bb.0:
32 ; ALL-NEXT:    xorw %di, %si
33 ; ALL-NEXT:    movl %esi, %eax
34 ; ALL-NEXT:    retq
35   %ret = xor i16 %arg1, %arg2
36   ret i16 %ret
37 }
38
39 define i32 @test_xor_i32(i32 %arg1, i32 %arg2) {
40 ; ALL-LABEL: test_xor_i32:
41 ; ALL:       # %bb.0:
42 ; ALL-NEXT:    xorl %edi, %esi
43 ; ALL-NEXT:    movl %esi, %eax
44 ; ALL-NEXT:    retq
45   %ret = xor i32 %arg1, %arg2
46   ret i32 %ret
47 }
48
49 define i64 @test_xor_i64(i64 %arg1, i64 %arg2) {
50 ; ALL-LABEL: test_xor_i64:
51 ; ALL:       # %bb.0:
52 ; ALL-NEXT:    xorq %rdi, %rsi
53 ; ALL-NEXT:    movq %rsi, %rax
54 ; ALL-NEXT:    retq
55   %ret = xor i64 %arg1, %arg2
56   ret i64 %ret
57 }
58