Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARM] MVE bitwise instruction patterns
This adds patterns for the simpler VAND, VORR and VEOR bitwise vector instructions. It also adjusts the top16Zero PatLeaf to not match on vector instructions, which can otherwise cause problems. Code written by David Sherwood. Differential Revision: https://reviews.llvm.org/D63867 llvm-svn: 365113
- Loading branch information
1 parent
c1ead0e
commit d2a9ec2
Showing
5 changed files
with
122 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+mve -verify-machineinstrs %s -o - | FileCheck %s | ||
|
||
define arm_aapcs_vfpcc <16 x i8> @and_int8_t(<16 x i8> %src1, <16 x i8> %src2) { | ||
; CHECK-LABEL: and_int8_t: | ||
; CHECK: @ %bb.0: @ %entry | ||
; CHECK-NEXT: vand q0, q0, q1 | ||
; CHECK-NEXT: bx lr | ||
entry: | ||
%0 = and <16 x i8> %src1, %src2 | ||
ret <16 x i8> %0 | ||
} | ||
|
||
define arm_aapcs_vfpcc <8 x i16> @and_int16_t(<8 x i16> %src1, <8 x i16> %src2) { | ||
; CHECK-LABEL: and_int16_t: | ||
; CHECK: @ %bb.0: @ %entry | ||
; CHECK-NEXT: vand q0, q0, q1 | ||
; CHECK-NEXT: bx lr | ||
entry: | ||
%0 = and <8 x i16> %src1, %src2 | ||
ret <8 x i16> %0 | ||
} | ||
|
||
define arm_aapcs_vfpcc <4 x i32> @and_int32_t(<4 x i32> %src1, <4 x i32> %src2) { | ||
; CHECK-LABEL: and_int32_t: | ||
; CHECK: @ %bb.0: @ %entry | ||
; CHECK-NEXT: vand q0, q0, q1 | ||
; CHECK-NEXT: bx lr | ||
entry: | ||
%0 = and <4 x i32> %src1, %src2 | ||
ret <4 x i32> %0 | ||
} | ||
|
||
|
||
define arm_aapcs_vfpcc <16 x i8> @or_int8_t(<16 x i8> %src1, <16 x i8> %src2) { | ||
; CHECK-LABEL: or_int8_t: | ||
; CHECK: @ %bb.0: @ %entry | ||
; CHECK-NEXT: vorr q0, q0, q1 | ||
; CHECK-NEXT: bx lr | ||
entry: | ||
%0 = or <16 x i8> %src1, %src2 | ||
ret <16 x i8> %0 | ||
} | ||
|
||
define arm_aapcs_vfpcc <8 x i16> @or_int16_t(<8 x i16> %src1, <8 x i16> %src2) { | ||
; CHECK-LABEL: or_int16_t: | ||
; CHECK: @ %bb.0: @ %entry | ||
; CHECK-NEXT: vorr q0, q0, q1 | ||
; CHECK-NEXT: bx lr | ||
entry: | ||
%0 = or <8 x i16> %src1, %src2 | ||
ret <8 x i16> %0 | ||
} | ||
|
||
define arm_aapcs_vfpcc <4 x i32> @or_int32_t(<4 x i32> %src1, <4 x i32> %src2) { | ||
; CHECK-LABEL: or_int32_t: | ||
; CHECK: @ %bb.0: @ %entry | ||
; CHECK-NEXT: vorr q0, q0, q1 | ||
; CHECK-NEXT: bx lr | ||
entry: | ||
%0 = or <4 x i32> %src1, %src2 | ||
ret <4 x i32> %0 | ||
} | ||
|
||
|
||
define arm_aapcs_vfpcc <16 x i8> @xor_int8_t(<16 x i8> %src1, <16 x i8> %src2) { | ||
; CHECK-LABEL: xor_int8_t: | ||
; CHECK: @ %bb.0: @ %entry | ||
; CHECK-NEXT: veor q0, q0, q1 | ||
; CHECK-NEXT: bx lr | ||
entry: | ||
%0 = xor <16 x i8> %src1, %src2 | ||
ret <16 x i8> %0 | ||
} | ||
|
||
define arm_aapcs_vfpcc <8 x i16> @xor_int16_t(<8 x i16> %src1, <8 x i16> %src2) { | ||
; CHECK-LABEL: xor_int16_t: | ||
; CHECK: @ %bb.0: @ %entry | ||
; CHECK-NEXT: veor q0, q0, q1 | ||
; CHECK-NEXT: bx lr | ||
entry: | ||
%0 = xor <8 x i16> %src1, %src2 | ||
ret <8 x i16> %0 | ||
} | ||
|
||
define arm_aapcs_vfpcc <4 x i32> @xor_int32_t(<4 x i32> %src1, <4 x i32> %src2) { | ||
; CHECK-LABEL: xor_int32_t: | ||
; CHECK: @ %bb.0: @ %entry | ||
; CHECK-NEXT: veor q0, q0, q1 | ||
; CHECK-NEXT: bx lr | ||
entry: | ||
%0 = xor <4 x i32> %src1, %src2 | ||
ret <4 x i32> %0 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters