• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=aarch64-none-linux-gnu < %s | FileCheck %s
2
3; Check that the eon instruction is generated instead of eor,movn
4define i64 @test1(i64 %a, i64 %b, i64 %c) {
5; CHECK-LABEL: test1:
6; CHECK: eon
7; CHECK: ret
8entry:
9  %shl = shl i64 %b, 4
10  %neg = xor i64 %a, -1
11  %xor = xor i64 %shl, %neg
12  ret i64 %xor
13}
14
15; Same check with mutliple uses of %neg
16define i64 @test2(i64 %a, i64 %b, i64 %c) {
17; CHECK-LABEL: test2:
18; CHECK: eon
19; CHECK: eon
20; CHECK: lsl
21; CHECK: ret
22entry:
23  %shl = shl i64 %b, 4
24  %neg = xor i64 %shl, -1
25  %xor = xor i64 %neg, %a
26  %xor1 = xor i64 %c, %neg
27  %shl2 = shl i64 %xor, %xor1
28  ret i64 %shl2
29}
30