1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=aarch64-linux-gnu < %s | FileCheck %s
;
; SMULH
;
define <vscale x 16 x i8> @smulh_i8(<vscale x 16 x i8> %a, <vscale x 16 x i8> %b) #0 {
; CHECK-LABEL: smulh_i8:
; CHECK: // %bb.0:
; CHECK-NEXT: smulh z0.b, z0.b, z1.b
; CHECK-NEXT: ret
%insert = insertelement <vscale x 16 x i16> undef, i16 8, i64 0
%splat = shufflevector <vscale x 16 x i16> %insert, <vscale x 16 x i16> undef, <vscale x 16 x i32> zeroinitializer
%1 = sext <vscale x 16 x i8> %a to <vscale x 16 x i16>
%2 = sext <vscale x 16 x i8> %b to <vscale x 16 x i16>
%mul = mul <vscale x 16 x i16> %1, %2
%shr = lshr <vscale x 16 x i16> %mul, %splat
%tr = trunc <vscale x 16 x i16> %shr to <vscale x 16 x i8>
ret <vscale x 16 x i8> %tr
}
define <vscale x 8 x i16> @smulh_i16(<vscale x 8 x i16> %a, <vscale x 8 x i16> %b) #0 {
; CHECK-LABEL: smulh_i16:
; CHECK: // %bb.0:
; CHECK-NEXT: smulh z0.h, z0.h, z1.h
; CHECK-NEXT: ret
%insert = insertelement <vscale x 8 x i32> undef, i32 16, i64 0
%splat = shufflevector <vscale x 8 x i32> %insert, <vscale x 8 x i32> undef, <vscale x 8 x i32> zeroinitializer
%1 = sext <vscale x 8 x i16> %a to <vscale x 8 x i32>
%2 = sext <vscale x 8 x i16> %b to <vscale x 8 x i32>
%mul = mul <vscale x 8 x i32> %1, %2
%shr = lshr <vscale x 8 x i32> %mul, %splat
%tr = trunc <vscale x 8 x i32> %shr to <vscale x 8 x i16>
ret <vscale x 8 x i16> %tr
}
define <vscale x 4 x i32> @smulh_i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b) #0 {
; CHECK-LABEL: smulh_i32:
; CHECK: // %bb.0:
; CHECK-NEXT: smulh z0.s, z0.s, z1.s
; CHECK-NEXT: ret
%insert = insertelement <vscale x 4 x i64> undef, i64 32, i64 0
%splat = shufflevector <vscale x 4 x i64> %insert, <vscale x 4 x i64> undef, <vscale x 4 x i32> zeroinitializer
%1 = sext <vscale x 4 x i32> %a to <vscale x 4 x i64>
%2 = sext <vscale x 4 x i32> %b to <vscale x 4 x i64>
%mul = mul <vscale x 4 x i64> %1, %2
%shr = lshr <vscale x 4 x i64> %mul, %splat
%tr = trunc <vscale x 4 x i64> %shr to <vscale x 4 x i32>
ret <vscale x 4 x i32> %tr
}
define <vscale x 2 x i64> @smulh_i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %b) #0 {
; CHECK-LABEL: smulh_i64:
; CHECK: // %bb.0:
; CHECK-NEXT: smulh z0.d, z0.d, z1.d
; CHECK-NEXT: ret
%insert = insertelement <vscale x 2 x i128> undef, i128 64, i64 0
%splat = shufflevector <vscale x 2 x i128> %insert, <vscale x 2 x i128> undef, <vscale x 2 x i32> zeroinitializer
%1 = sext <vscale x 2 x i64> %a to <vscale x 2 x i128>
%2 = sext <vscale x 2 x i64> %b to <vscale x 2 x i128>
%mul = mul <vscale x 2 x i128> %1, %2
%shr = lshr <vscale x 2 x i128> %mul, %splat
%tr = trunc <vscale x 2 x i128> %shr to <vscale x 2 x i64>
ret <vscale x 2 x i64> %tr
}
;
; UMULH
;
define <vscale x 16 x i8> @umulh_i8(<vscale x 16 x i8> %a, <vscale x 16 x i8> %b) #0 {
; CHECK-LABEL: umulh_i8:
; CHECK: // %bb.0:
; CHECK-NEXT: umulh z0.b, z0.b, z1.b
; CHECK-NEXT: ret
%insert = insertelement <vscale x 16 x i16> undef, i16 8, i64 0
%splat = shufflevector <vscale x 16 x i16> %insert, <vscale x 16 x i16> undef, <vscale x 16 x i32> zeroinitializer
%1 = zext <vscale x 16 x i8> %a to <vscale x 16 x i16>
%2 = zext <vscale x 16 x i8> %b to <vscale x 16 x i16>
%mul = mul <vscale x 16 x i16> %1, %2
%shr = lshr <vscale x 16 x i16> %mul, %splat
%tr = trunc <vscale x 16 x i16> %shr to <vscale x 16 x i8>
ret <vscale x 16 x i8> %tr
}
define <vscale x 8 x i16> @umulh_i16(<vscale x 8 x i16> %a, <vscale x 8 x i16> %b) #0 {
; CHECK-LABEL: umulh_i16:
; CHECK: // %bb.0:
; CHECK-NEXT: umulh z0.h, z0.h, z1.h
; CHECK-NEXT: ret
%insert = insertelement <vscale x 8 x i32> undef, i32 16, i64 0
%splat = shufflevector <vscale x 8 x i32> %insert, <vscale x 8 x i32> undef, <vscale x 8 x i32> zeroinitializer
%1 = zext <vscale x 8 x i16> %a to <vscale x 8 x i32>
%2 = zext <vscale x 8 x i16> %b to <vscale x 8 x i32>
%mul = mul <vscale x 8 x i32> %1, %2
%shr = lshr <vscale x 8 x i32> %mul, %splat
%tr = trunc <vscale x 8 x i32> %shr to <vscale x 8 x i16>
ret <vscale x 8 x i16> %tr
}
define <vscale x 4 x i32> @umulh_i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b) #0 {
; CHECK-LABEL: umulh_i32:
; CHECK: // %bb.0:
; CHECK-NEXT: umulh z0.s, z0.s, z1.s
; CHECK-NEXT: ret
%insert = insertelement <vscale x 4 x i64> undef, i64 32, i64 0
%splat = shufflevector <vscale x 4 x i64> %insert, <vscale x 4 x i64> undef, <vscale x 4 x i32> zeroinitializer
%1 = zext <vscale x 4 x i32> %a to <vscale x 4 x i64>
%2 = zext <vscale x 4 x i32> %b to <vscale x 4 x i64>
%mul = mul <vscale x 4 x i64> %1, %2
%shr = lshr <vscale x 4 x i64> %mul, %splat
%tr = trunc <vscale x 4 x i64> %shr to <vscale x 4 x i32>
ret <vscale x 4 x i32> %tr
}
define <vscale x 2 x i64> @umulh_i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %b) #0 {
; CHECK-LABEL: umulh_i64:
; CHECK: // %bb.0:
; CHECK-NEXT: umulh z0.d, z0.d, z1.d
; CHECK-NEXT: ret
%insert = insertelement <vscale x 2 x i128> undef, i128 64, i64 0
%splat = shufflevector <vscale x 2 x i128> %insert, <vscale x 2 x i128> undef, <vscale x 2 x i32> zeroinitializer
%1 = zext <vscale x 2 x i64> %a to <vscale x 2 x i128>
%2 = zext <vscale x 2 x i64> %b to <vscale x 2 x i128>
%mul = mul <vscale x 2 x i128> %1, %2
%shr = lshr <vscale x 2 x i128> %mul, %splat
%tr = trunc <vscale x 2 x i128> %shr to <vscale x 2 x i64>
ret <vscale x 2 x i64> %tr
}
attributes #0 = { "target-features"="+sve2" }
|