1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/CodeGen/X86/GlobalISel/xor-scalar.ll
Simon Pilgrim bdca5e26c8 Fix line-endings. NFCI.
llvm-svn: 342639
2018-09-20 10:59:08 +00:00

61 lines
1.5 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL
define i32 @test_xor_i1(i32 %arg1, i32 %arg2) {
; ALL-LABEL: test_xor_i1:
; ALL: # %bb.0:
; ALL-NEXT: cmpl %esi, %edi
; ALL-NEXT: sete %al
; ALL-NEXT: xorb %al, %al
; ALL-NEXT: movzbl %al, %eax
; ALL-NEXT: andl $1, %eax
; ALL-NEXT: retq
%c = icmp eq i32 %arg1, %arg2
%x = xor i1 %c , %c
%ret = zext i1 %x to i32
ret i32 %ret
}
define i8 @test_xor_i8(i8 %arg1, i8 %arg2) {
; ALL-LABEL: test_xor_i8:
; ALL: # %bb.0:
; ALL-NEXT: movl %esi, %eax
; ALL-NEXT: xorb %dil, %al
; ALL-NEXT: # kill: def $al killed $al killed $eax
; ALL-NEXT: retq
%ret = xor i8 %arg1, %arg2
ret i8 %ret
}
define i16 @test_xor_i16(i16 %arg1, i16 %arg2) {
; ALL-LABEL: test_xor_i16:
; ALL: # %bb.0:
; ALL-NEXT: movl %esi, %eax
; ALL-NEXT: xorw %di, %ax
; ALL-NEXT: # kill: def $ax killed $ax killed $eax
; ALL-NEXT: retq
%ret = xor i16 %arg1, %arg2
ret i16 %ret
}
define i32 @test_xor_i32(i32 %arg1, i32 %arg2) {
; ALL-LABEL: test_xor_i32:
; ALL: # %bb.0:
; ALL-NEXT: movl %esi, %eax
; ALL-NEXT: xorl %edi, %eax
; ALL-NEXT: retq
%ret = xor i32 %arg1, %arg2
ret i32 %ret
}
define i64 @test_xor_i64(i64 %arg1, i64 %arg2) {
; ALL-LABEL: test_xor_i64:
; ALL: # %bb.0:
; ALL-NEXT: movq %rsi, %rax
; ALL-NEXT: xorq %rdi, %rax
; ALL-NEXT: retq
%ret = xor i64 %arg1, %arg2
ret i64 %ret
}