54 lines · plain
1; RUN: llc -mtriple=aarch64-none-linux-gnu < %s | FileCheck %s2; RUN: llc %s -pass-remarks-missed=gisel* -mtriple=aarch64-none-linux-gnu -global-isel -o - 2>&1 | FileCheck %s3 4; CHECK-NOT: remark5 6; Check that the eon instruction is generated instead of eor,movn7define i64 @test1(i64 %a, i64 %b, i64 %c) {8; CHECK-LABEL: test1:9; CHECK: eon10; CHECK: ret11entry:12 %shl = shl i64 %b, 413 %neg = xor i64 %a, -114 %xor = xor i64 %shl, %neg15 ret i64 %xor16}17 18; Same check with multiple uses of %neg19define i64 @test2(i64 %a, i64 %b, i64 %c) {20; CHECK-LABEL: test2:21; CHECK: eon22; CHECK: eon23; CHECK: lsl24; CHECK: ret25entry:26 %shl = shl i64 %b, 427 %neg = xor i64 %shl, -128 %xor = xor i64 %neg, %a29 %xor1 = xor i64 %c, %neg30 %shl2 = shl i64 %xor, %xor131 ret i64 %shl232}33 34; Check that eon is generated if the xor is a disjoint or.35define i64 @disjoint_or(i64 %a, i64 %b) {36; CHECK-LABEL: disjoint_or:37; CHECK: eon38; CHECK: ret39 %or = or disjoint i64 %a, %b40 %eon = xor i64 %or, -141 ret i64 %eon42}43 44; Check that eon is *not* generated if the or is not disjoint.45define i64 @normal_or(i64 %a, i64 %b) {46; CHECK-LABEL: normal_or:47; CHECK: orr48; CHECK: mvn49; CHECK: ret50 %or = or i64 %a, %b51 %not = xor i64 %or, -152 ret i64 %not53}54