1228 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 42; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme2 -mattr=+sve-b16b16 -force-streaming -verify-machineinstrs < %s | FileCheck %s3 4; SMAX (Single, x2)5 6define { <vscale x 16 x i8>, <vscale x 16 x i8> } @multi_vec_max_single_x2_s8(<vscale x 16 x i8> %unused, <vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zm) {7; CHECK-LABEL: multi_vec_max_single_x2_s8:8; CHECK: // %bb.0:9; CHECK-NEXT: mov z5.d, z2.d10; CHECK-NEXT: mov z4.d, z1.d11; CHECK-NEXT: smax { z4.b, z5.b }, { z4.b, z5.b }, z3.b12; CHECK-NEXT: mov z0.d, z4.d13; CHECK-NEXT: mov z1.d, z5.d14; CHECK-NEXT: ret15 %res = call { <vscale x 16 x i8>, <vscale x 16 x i8> } @llvm.aarch64.sve.smax.single.x2.nxv16i8(<vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zm)16 ret { <vscale x 16 x i8>, <vscale x 16 x i8> } %res17}18 19define { <vscale x 8 x i16>, <vscale x 8 x i16> } @multi_vec_max_single_x2_s16(<vscale x 8 x i16> %unused, <vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zm) {20; CHECK-LABEL: multi_vec_max_single_x2_s16:21; CHECK: // %bb.0:22; CHECK-NEXT: mov z5.d, z2.d23; CHECK-NEXT: mov z4.d, z1.d24; CHECK-NEXT: smax { z4.h, z5.h }, { z4.h, z5.h }, z3.h25; CHECK-NEXT: mov z0.d, z4.d26; CHECK-NEXT: mov z1.d, z5.d27; CHECK-NEXT: ret28 %res = call { <vscale x 8 x i16>, <vscale x 8 x i16> } @llvm.aarch64.sve.smax.single.x2.nxv8i16(<vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zm)29 ret { <vscale x 8 x i16>, <vscale x 8 x i16> } %res30}31 32define { <vscale x 4 x i32>, <vscale x 4 x i32> } @multi_vec_max_single_x2_s32(<vscale x 4 x i32> %unused, <vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zm) {33; CHECK-LABEL: multi_vec_max_single_x2_s32:34; CHECK: // %bb.0:35; CHECK-NEXT: mov z5.d, z2.d36; CHECK-NEXT: mov z4.d, z1.d37; CHECK-NEXT: smax { z4.s, z5.s }, { z4.s, z5.s }, z3.s38; CHECK-NEXT: mov z0.d, z4.d39; CHECK-NEXT: mov z1.d, z5.d40; CHECK-NEXT: ret41 %res = call { <vscale x 4 x i32>, <vscale x 4 x i32> } @llvm.aarch64.sve.smax.single.x2.nxv4i32(<vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zm)42 ret { <vscale x 4 x i32>, <vscale x 4 x i32> } %res43}44 45define { <vscale x 2 x i64>, <vscale x 2 x i64> } @multi_vec_max_single_x2_s64(<vscale x 2 x i64> %unused, <vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zm) {46; CHECK-LABEL: multi_vec_max_single_x2_s64:47; CHECK: // %bb.0:48; CHECK-NEXT: mov z5.d, z2.d49; CHECK-NEXT: mov z4.d, z1.d50; CHECK-NEXT: smax { z4.d, z5.d }, { z4.d, z5.d }, z3.d51; CHECK-NEXT: mov z0.d, z4.d52; CHECK-NEXT: mov z1.d, z5.d53; CHECK-NEXT: ret54 %res = call { <vscale x 2 x i64>, <vscale x 2 x i64> } @llvm.aarch64.sve.smax.single.x2.nxv2i64(<vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zm)55 ret { <vscale x 2 x i64>, <vscale x 2 x i64> } %res56}57 58; UMAX (Single, x2)59 60define { <vscale x 16 x i8>, <vscale x 16 x i8> } @multi_vec_max_single_x2_u8(<vscale x 16 x i8> %unused, <vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zm) {61; CHECK-LABEL: multi_vec_max_single_x2_u8:62; CHECK: // %bb.0:63; CHECK-NEXT: mov z5.d, z2.d64; CHECK-NEXT: mov z4.d, z1.d65; CHECK-NEXT: umax { z4.b, z5.b }, { z4.b, z5.b }, z3.b66; CHECK-NEXT: mov z0.d, z4.d67; CHECK-NEXT: mov z1.d, z5.d68; CHECK-NEXT: ret69 %res = call { <vscale x 16 x i8>, <vscale x 16 x i8> } @llvm.aarch64.sve.umax.single.x2.nxv16i8(<vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zm)70 ret { <vscale x 16 x i8>, <vscale x 16 x i8> } %res71}72 73define { <vscale x 8 x i16>, <vscale x 8 x i16> } @multi_vec_max_single_x2_u16(<vscale x 8 x i16> %unused, <vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zm) {74; CHECK-LABEL: multi_vec_max_single_x2_u16:75; CHECK: // %bb.0:76; CHECK-NEXT: mov z5.d, z2.d77; CHECK-NEXT: mov z4.d, z1.d78; CHECK-NEXT: umax { z4.h, z5.h }, { z4.h, z5.h }, z3.h79; CHECK-NEXT: mov z0.d, z4.d80; CHECK-NEXT: mov z1.d, z5.d81; CHECK-NEXT: ret82 %res = call { <vscale x 8 x i16>, <vscale x 8 x i16> } @llvm.aarch64.sve.umax.single.x2.nxv8i16(<vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zm)83 ret { <vscale x 8 x i16>, <vscale x 8 x i16> } %res84}85 86define { <vscale x 4 x i32>, <vscale x 4 x i32> } @multi_vec_max_single_x2_u32(<vscale x 4 x i32> %unused, <vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zm) {87; CHECK-LABEL: multi_vec_max_single_x2_u32:88; CHECK: // %bb.0:89; CHECK-NEXT: mov z5.d, z2.d90; CHECK-NEXT: mov z4.d, z1.d91; CHECK-NEXT: umax { z4.s, z5.s }, { z4.s, z5.s }, z3.s92; CHECK-NEXT: mov z0.d, z4.d93; CHECK-NEXT: mov z1.d, z5.d94; CHECK-NEXT: ret95 %res = call { <vscale x 4 x i32>, <vscale x 4 x i32> } @llvm.aarch64.sve.umax.single.x2.nxv4i32(<vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zm)96 ret { <vscale x 4 x i32>, <vscale x 4 x i32> } %res97}98 99define { <vscale x 2 x i64>, <vscale x 2 x i64> } @multi_vec_max_single_x2_u64(<vscale x 2 x i64> %unused, <vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zm) {100; CHECK-LABEL: multi_vec_max_single_x2_u64:101; CHECK: // %bb.0:102; CHECK-NEXT: mov z5.d, z2.d103; CHECK-NEXT: mov z4.d, z1.d104; CHECK-NEXT: umax { z4.d, z5.d }, { z4.d, z5.d }, z3.d105; CHECK-NEXT: mov z0.d, z4.d106; CHECK-NEXT: mov z1.d, z5.d107; CHECK-NEXT: ret108 %res = call { <vscale x 2 x i64>, <vscale x 2 x i64> } @llvm.aarch64.sve.umax.single.x2.nxv2i64(<vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zm)109 ret { <vscale x 2 x i64>, <vscale x 2 x i64> } %res110}111 112; BFMAX (Single, x2)113 114define { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @multi_vec_max_single_x2_bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zm) {115; CHECK-LABEL: multi_vec_max_single_x2_bf16:116; CHECK: // %bb.0:117; CHECK-NEXT: // kill: def $z1 killed $z1 killed $z0_z1 def $z0_z1118; CHECK-NEXT: // kill: def $z0 killed $z0 killed $z0_z1 def $z0_z1119; CHECK-NEXT: bfmax { z0.h, z1.h }, { z0.h, z1.h }, z2.h120; CHECK-NEXT: ret121 %res = call { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @llvm.aarch64.sve.fmax.single.x2.nxv8bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zm)122 ret { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } %res123}124 125; FMAX (Single, x2)126 127define { <vscale x 8 x half>, <vscale x 8 x half> } @multi_vec_max_single_x2_f16(<vscale x 8 x half> %unused, <vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zm) {128; CHECK-LABEL: multi_vec_max_single_x2_f16:129; CHECK: // %bb.0:130; CHECK-NEXT: mov z5.d, z2.d131; CHECK-NEXT: mov z4.d, z1.d132; CHECK-NEXT: fmax { z4.h, z5.h }, { z4.h, z5.h }, z3.h133; CHECK-NEXT: mov z0.d, z4.d134; CHECK-NEXT: mov z1.d, z5.d135; CHECK-NEXT: ret136 %res = call { <vscale x 8 x half>, <vscale x 8 x half> } @llvm.aarch64.sve.fmax.single.x2.nxv8f16(<vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zm)137 ret { <vscale x 8 x half>, <vscale x 8 x half> } %res138}139 140define { <vscale x 4 x float>, <vscale x 4 x float> } @multi_vec_max_single_x2_f32(<vscale x 4 x float> %unused, <vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zm) {141; CHECK-LABEL: multi_vec_max_single_x2_f32:142; CHECK: // %bb.0:143; CHECK-NEXT: mov z5.d, z2.d144; CHECK-NEXT: mov z4.d, z1.d145; CHECK-NEXT: fmax { z4.s, z5.s }, { z4.s, z5.s }, z3.s146; CHECK-NEXT: mov z0.d, z4.d147; CHECK-NEXT: mov z1.d, z5.d148; CHECK-NEXT: ret149 %res = call { <vscale x 4 x float>, <vscale x 4 x float> } @llvm.aarch64.sve.fmax.single.x2.nxv4f32(<vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zm)150 ret { <vscale x 4 x float>, <vscale x 4 x float> } %res151}152 153define { <vscale x 2 x double>, <vscale x 2 x double> } @multi_vec_max_single_x2_f64(<vscale x 2 x double> %unused, <vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zm) {154; CHECK-LABEL: multi_vec_max_single_x2_f64:155; CHECK: // %bb.0:156; CHECK-NEXT: mov z5.d, z2.d157; CHECK-NEXT: mov z4.d, z1.d158; CHECK-NEXT: fmax { z4.d, z5.d }, { z4.d, z5.d }, z3.d159; CHECK-NEXT: mov z0.d, z4.d160; CHECK-NEXT: mov z1.d, z5.d161; CHECK-NEXT: ret162 %res = call { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.aarch64.sve.fmax.single.x2.nxv2f64(<vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zm)163 ret { <vscale x 2 x double>, <vscale x 2 x double> } %res164}165 166; SMAX (Single, x4)167 168define { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> } @multi_vec_max_single_x4_s8(<vscale x 16 x i8> %unused, <vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zdn3, <vscale x 16 x i8> %zdn4, <vscale x 16 x i8> %zm) {169; CHECK-LABEL: multi_vec_max_single_x4_s8:170; CHECK: // %bb.0:171; CHECK-NEXT: mov z27.d, z4.d172; CHECK-NEXT: mov z26.d, z3.d173; CHECK-NEXT: mov z25.d, z2.d174; CHECK-NEXT: mov z24.d, z1.d175; CHECK-NEXT: smax { z24.b - z27.b }, { z24.b - z27.b }, z5.b176; CHECK-NEXT: mov z0.d, z24.d177; CHECK-NEXT: mov z1.d, z25.d178; CHECK-NEXT: mov z2.d, z26.d179; CHECK-NEXT: mov z3.d, z27.d180; CHECK-NEXT: ret181 %res = call { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> }182 @llvm.aarch64.sve.smax.single.x4.nxv16i8(<vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zdn3, <vscale x 16 x i8> %zdn4, <vscale x 16 x i8> %zm)183 ret { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> } %res184}185 186define { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> } @multi_vec_max_single_x4_s16(<vscale x 8 x i16> %unused, <vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zdn3, <vscale x 8 x i16> %zdn4, <vscale x 8 x i16> %zm) {187; CHECK-LABEL: multi_vec_max_single_x4_s16:188; CHECK: // %bb.0:189; CHECK-NEXT: mov z27.d, z4.d190; CHECK-NEXT: mov z26.d, z3.d191; CHECK-NEXT: mov z25.d, z2.d192; CHECK-NEXT: mov z24.d, z1.d193; CHECK-NEXT: smax { z24.h - z27.h }, { z24.h - z27.h }, z5.h194; CHECK-NEXT: mov z0.d, z24.d195; CHECK-NEXT: mov z1.d, z25.d196; CHECK-NEXT: mov z2.d, z26.d197; CHECK-NEXT: mov z3.d, z27.d198; CHECK-NEXT: ret199 %res = call { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> }200 @llvm.aarch64.sve.smax.single.x4.nxv8i16(<vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zdn3, <vscale x 8 x i16> %zdn4, <vscale x 8 x i16> %zm)201 ret { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> } %res202}203 204define { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> } @multi_vec_max_single_x4_s32(<vscale x 4 x i32> %unused, <vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zdn3, <vscale x 4 x i32> %zdn4, <vscale x 4 x i32> %zm) {205; CHECK-LABEL: multi_vec_max_single_x4_s32:206; CHECK: // %bb.0:207; CHECK-NEXT: mov z27.d, z4.d208; CHECK-NEXT: mov z26.d, z3.d209; CHECK-NEXT: mov z25.d, z2.d210; CHECK-NEXT: mov z24.d, z1.d211; CHECK-NEXT: smax { z24.s - z27.s }, { z24.s - z27.s }, z5.s212; CHECK-NEXT: mov z0.d, z24.d213; CHECK-NEXT: mov z1.d, z25.d214; CHECK-NEXT: mov z2.d, z26.d215; CHECK-NEXT: mov z3.d, z27.d216; CHECK-NEXT: ret217 %res = call { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> }218 @llvm.aarch64.sve.smax.single.x4.nxv4i32(<vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zdn3, <vscale x 4 x i32> %zdn4, <vscale x 4 x i32> %zm)219 ret { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> } %res220}221 222define { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> } @multi_vec_max_single_x4_s64(<vscale x 2 x i64> %unused, <vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zdn3, <vscale x 2 x i64> %zdn4, <vscale x 2 x i64> %zm) {223; CHECK-LABEL: multi_vec_max_single_x4_s64:224; CHECK: // %bb.0:225; CHECK-NEXT: mov z27.d, z4.d226; CHECK-NEXT: mov z26.d, z3.d227; CHECK-NEXT: mov z25.d, z2.d228; CHECK-NEXT: mov z24.d, z1.d229; CHECK-NEXT: smax { z24.d - z27.d }, { z24.d - z27.d }, z5.d230; CHECK-NEXT: mov z0.d, z24.d231; CHECK-NEXT: mov z1.d, z25.d232; CHECK-NEXT: mov z2.d, z26.d233; CHECK-NEXT: mov z3.d, z27.d234; CHECK-NEXT: ret235 %res = call { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> }236 @llvm.aarch64.sve.smax.single.x4.nxv2i64(<vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zdn3, <vscale x 2 x i64> %zdn4, <vscale x 2 x i64> %zm)237 ret { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> } %res238}239 240; UMAX (Single, x4)241 242define { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> } @multi_vec_max_single_x4_u8(<vscale x 16 x i8> %unused, <vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zdn3, <vscale x 16 x i8> %zdn4, <vscale x 16 x i8> %zm) {243; CHECK-LABEL: multi_vec_max_single_x4_u8:244; CHECK: // %bb.0:245; CHECK-NEXT: mov z27.d, z4.d246; CHECK-NEXT: mov z26.d, z3.d247; CHECK-NEXT: mov z25.d, z2.d248; CHECK-NEXT: mov z24.d, z1.d249; CHECK-NEXT: umax { z24.b - z27.b }, { z24.b - z27.b }, z5.b250; CHECK-NEXT: mov z0.d, z24.d251; CHECK-NEXT: mov z1.d, z25.d252; CHECK-NEXT: mov z2.d, z26.d253; CHECK-NEXT: mov z3.d, z27.d254; CHECK-NEXT: ret255 %res = call { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> }256 @llvm.aarch64.sve.umax.single.x4.nxv16i8(<vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zdn3, <vscale x 16 x i8> %zdn4, <vscale x 16 x i8> %zm)257 ret { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> } %res258}259 260define { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> } @multi_vec_max_single_x4_u16(<vscale x 8 x i16> %unused, <vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zdn3, <vscale x 8 x i16> %zdn4, <vscale x 8 x i16> %zm) {261; CHECK-LABEL: multi_vec_max_single_x4_u16:262; CHECK: // %bb.0:263; CHECK-NEXT: mov z27.d, z4.d264; CHECK-NEXT: mov z26.d, z3.d265; CHECK-NEXT: mov z25.d, z2.d266; CHECK-NEXT: mov z24.d, z1.d267; CHECK-NEXT: umax { z24.h - z27.h }, { z24.h - z27.h }, z5.h268; CHECK-NEXT: mov z0.d, z24.d269; CHECK-NEXT: mov z1.d, z25.d270; CHECK-NEXT: mov z2.d, z26.d271; CHECK-NEXT: mov z3.d, z27.d272; CHECK-NEXT: ret273 %res = call { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> }274 @llvm.aarch64.sve.umax.single.x4.nxv8i16(<vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zdn3, <vscale x 8 x i16> %zdn4, <vscale x 8 x i16> %zm)275 ret { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> } %res276}277 278define { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> } @multi_vec_max_single_x4_u32(<vscale x 4 x i32> %unused, <vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zdn3, <vscale x 4 x i32> %zdn4, <vscale x 4 x i32> %zm) {279; CHECK-LABEL: multi_vec_max_single_x4_u32:280; CHECK: // %bb.0:281; CHECK-NEXT: mov z27.d, z4.d282; CHECK-NEXT: mov z26.d, z3.d283; CHECK-NEXT: mov z25.d, z2.d284; CHECK-NEXT: mov z24.d, z1.d285; CHECK-NEXT: umax { z24.s - z27.s }, { z24.s - z27.s }, z5.s286; CHECK-NEXT: mov z0.d, z24.d287; CHECK-NEXT: mov z1.d, z25.d288; CHECK-NEXT: mov z2.d, z26.d289; CHECK-NEXT: mov z3.d, z27.d290; CHECK-NEXT: ret291 %res = call { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> }292 @llvm.aarch64.sve.umax.single.x4.nxv4i32(<vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zdn3, <vscale x 4 x i32> %zdn4, <vscale x 4 x i32> %zm)293 ret { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> } %res294}295 296define { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> } @multi_vec_max_single_x4_u64(<vscale x 2 x i64> %unused, <vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zdn3, <vscale x 2 x i64> %zdn4, <vscale x 2 x i64> %zm) {297; CHECK-LABEL: multi_vec_max_single_x4_u64:298; CHECK: // %bb.0:299; CHECK-NEXT: mov z27.d, z4.d300; CHECK-NEXT: mov z26.d, z3.d301; CHECK-NEXT: mov z25.d, z2.d302; CHECK-NEXT: mov z24.d, z1.d303; CHECK-NEXT: umax { z24.d - z27.d }, { z24.d - z27.d }, z5.d304; CHECK-NEXT: mov z0.d, z24.d305; CHECK-NEXT: mov z1.d, z25.d306; CHECK-NEXT: mov z2.d, z26.d307; CHECK-NEXT: mov z3.d, z27.d308; CHECK-NEXT: ret309 %res = call { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> }310 @llvm.aarch64.sve.umax.single.x4.nxv2i64(<vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zdn3, <vscale x 2 x i64> %zdn4, <vscale x 2 x i64> %zm)311 ret { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> } %res312}313 314; BFMAX (Single, x4)315 316define { <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @multi_vec_max_single_x4_bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zdn3, <vscale x 8 x bfloat> %zdn4, <vscale x 8 x bfloat> %zm) {317; CHECK-LABEL: multi_vec_max_single_x4_bf16:318; CHECK: // %bb.0:319; CHECK-NEXT: // kill: def $z3 killed $z3 killed $z0_z1_z2_z3 def $z0_z1_z2_z3320; CHECK-NEXT: // kill: def $z2 killed $z2 killed $z0_z1_z2_z3 def $z0_z1_z2_z3321; CHECK-NEXT: // kill: def $z1 killed $z1 killed $z0_z1_z2_z3 def $z0_z1_z2_z3322; CHECK-NEXT: // kill: def $z0 killed $z0 killed $z0_z1_z2_z3 def $z0_z1_z2_z3323; CHECK-NEXT: bfmax { z0.h - z3.h }, { z0.h - z3.h }, z4.h324; CHECK-NEXT: ret325 %res = call { <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @llvm.aarch64.sve.fmax.single.x4.nxv8bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zdn3, <vscale x 8 x bfloat> %zdn4, <vscale x 8 x bfloat> %zm)326 ret { <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } %res327}328 329; FMAX (SINGLE, x4)330 331define { <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half> } @multi_vec_max_single_x4_f16(<vscale x 8 x half> %unused, <vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zdn3, <vscale x 8 x half> %zdn4, <vscale x 8 x half> %zm) {332; CHECK-LABEL: multi_vec_max_single_x4_f16:333; CHECK: // %bb.0:334; CHECK-NEXT: mov z27.d, z4.d335; CHECK-NEXT: mov z26.d, z3.d336; CHECK-NEXT: mov z25.d, z2.d337; CHECK-NEXT: mov z24.d, z1.d338; CHECK-NEXT: fmax { z24.h - z27.h }, { z24.h - z27.h }, z5.h339; CHECK-NEXT: mov z0.d, z24.d340; CHECK-NEXT: mov z1.d, z25.d341; CHECK-NEXT: mov z2.d, z26.d342; CHECK-NEXT: mov z3.d, z27.d343; CHECK-NEXT: ret344 %res = call { <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half> }345 @llvm.aarch64.sve.fmax.single.x4.nxv8f16(<vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zdn3, <vscale x 8 x half> %zdn4, <vscale x 8 x half> %zm)346 ret { <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half> } %res347}348 349define { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> } @multi_vec_max_single_x4_f32(<vscale x 4 x float> %unused, <vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zdn3, <vscale x 4 x float> %zdn4, <vscale x 4 x float> %zm) {350; CHECK-LABEL: multi_vec_max_single_x4_f32:351; CHECK: // %bb.0:352; CHECK-NEXT: mov z27.d, z4.d353; CHECK-NEXT: mov z26.d, z3.d354; CHECK-NEXT: mov z25.d, z2.d355; CHECK-NEXT: mov z24.d, z1.d356; CHECK-NEXT: fmax { z24.s - z27.s }, { z24.s - z27.s }, z5.s357; CHECK-NEXT: mov z0.d, z24.d358; CHECK-NEXT: mov z1.d, z25.d359; CHECK-NEXT: mov z2.d, z26.d360; CHECK-NEXT: mov z3.d, z27.d361; CHECK-NEXT: ret362 %res = call { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> }363 @llvm.aarch64.sve.fmax.single.x4.nxv4f32(<vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zdn3, <vscale x 4 x float> %zdn4, <vscale x 4 x float> %zm)364 ret { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> } %res365}366 367define { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> } @multi_vec_max_single_x4_f64(<vscale x 2 x double> %unused, <vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zdn3, <vscale x 2 x double> %zdn4, <vscale x 2 x double> %zm) {368; CHECK-LABEL: multi_vec_max_single_x4_f64:369; CHECK: // %bb.0:370; CHECK-NEXT: mov z27.d, z4.d371; CHECK-NEXT: mov z26.d, z3.d372; CHECK-NEXT: mov z25.d, z2.d373; CHECK-NEXT: mov z24.d, z1.d374; CHECK-NEXT: fmax { z24.d - z27.d }, { z24.d - z27.d }, z5.d375; CHECK-NEXT: mov z0.d, z24.d376; CHECK-NEXT: mov z1.d, z25.d377; CHECK-NEXT: mov z2.d, z26.d378; CHECK-NEXT: mov z3.d, z27.d379; CHECK-NEXT: ret380 %res = call { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> }381 @llvm.aarch64.sve.fmax.single.x4.nxv2f64(<vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zdn3, <vscale x 2 x double> %zdn4, <vscale x 2 x double> %zm)382 ret { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> } %res383}384 385; SMAX (Multi, x2)386 387define { <vscale x 16 x i8>, <vscale x 16 x i8> } @multi_vec_max_multi_x2_s8(<vscale x 16 x i8> %unused, <vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zm1, <vscale x 16 x i8> %zm2) {388; CHECK-LABEL: multi_vec_max_multi_x2_s8:389; CHECK: // %bb.0:390; CHECK-NEXT: mov z7.d, z4.d391; CHECK-NEXT: mov z5.d, z2.d392; CHECK-NEXT: mov z6.d, z3.d393; CHECK-NEXT: mov z4.d, z1.d394; CHECK-NEXT: smax { z4.b, z5.b }, { z4.b, z5.b }, { z6.b, z7.b }395; CHECK-NEXT: mov z0.d, z4.d396; CHECK-NEXT: mov z1.d, z5.d397; CHECK-NEXT: ret398 %res = call { <vscale x 16 x i8>, <vscale x 16 x i8> } @llvm.aarch64.sve.smax.x2.nxv16i8(<vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zm1, <vscale x 16 x i8> %zm2)399 ret { <vscale x 16 x i8>, <vscale x 16 x i8> } %res400}401 402define { <vscale x 8 x i16>, <vscale x 8 x i16> } @multi_vec_max_multi_x2_s16(<vscale x 8 x i16> %unused, <vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zm1, <vscale x 8 x i16> %zm2) {403; CHECK-LABEL: multi_vec_max_multi_x2_s16:404; CHECK: // %bb.0:405; CHECK-NEXT: mov z7.d, z4.d406; CHECK-NEXT: mov z5.d, z2.d407; CHECK-NEXT: mov z6.d, z3.d408; CHECK-NEXT: mov z4.d, z1.d409; CHECK-NEXT: smax { z4.h, z5.h }, { z4.h, z5.h }, { z6.h, z7.h }410; CHECK-NEXT: mov z0.d, z4.d411; CHECK-NEXT: mov z1.d, z5.d412; CHECK-NEXT: ret413 %res = call { <vscale x 8 x i16>, <vscale x 8 x i16> } @llvm.aarch64.sve.smax.x2.nxv8i16(<vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zm1, <vscale x 8 x i16> %zm2)414 ret { <vscale x 8 x i16>, <vscale x 8 x i16> } %res415}416 417define { <vscale x 4 x i32>, <vscale x 4 x i32> } @multi_vec_max_multi_x2_s32(<vscale x 4 x i32> %unused, <vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zm1, <vscale x 4 x i32> %zm2) {418; CHECK-LABEL: multi_vec_max_multi_x2_s32:419; CHECK: // %bb.0:420; CHECK-NEXT: mov z7.d, z4.d421; CHECK-NEXT: mov z5.d, z2.d422; CHECK-NEXT: mov z6.d, z3.d423; CHECK-NEXT: mov z4.d, z1.d424; CHECK-NEXT: smax { z4.s, z5.s }, { z4.s, z5.s }, { z6.s, z7.s }425; CHECK-NEXT: mov z0.d, z4.d426; CHECK-NEXT: mov z1.d, z5.d427; CHECK-NEXT: ret428 %res = call { <vscale x 4 x i32>, <vscale x 4 x i32> } @llvm.aarch64.sve.smax.x2.nxv4i32(<vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zm1, <vscale x 4 x i32> %zm2)429 ret { <vscale x 4 x i32>, <vscale x 4 x i32> } %res430}431 432define { <vscale x 2 x i64>, <vscale x 2 x i64> } @multi_vec_max_multi_x2_s64(<vscale x 2 x i64> %unused, <vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zm1, <vscale x 2 x i64> %zm2) {433; CHECK-LABEL: multi_vec_max_multi_x2_s64:434; CHECK: // %bb.0:435; CHECK-NEXT: mov z7.d, z4.d436; CHECK-NEXT: mov z5.d, z2.d437; CHECK-NEXT: mov z6.d, z3.d438; CHECK-NEXT: mov z4.d, z1.d439; CHECK-NEXT: smax { z4.d, z5.d }, { z4.d, z5.d }, { z6.d, z7.d }440; CHECK-NEXT: mov z0.d, z4.d441; CHECK-NEXT: mov z1.d, z5.d442; CHECK-NEXT: ret443 %res = call { <vscale x 2 x i64>, <vscale x 2 x i64> } @llvm.aarch64.sve.smax.x2.nxv2i64(<vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zm1, <vscale x 2 x i64> %zm2)444 ret { <vscale x 2 x i64>, <vscale x 2 x i64> } %res445}446 447; UMAX (Multi, x2)448 449define { <vscale x 16 x i8>, <vscale x 16 x i8> } @multi_vec_max_multi_x2_u8(<vscale x 16 x i8> %unused, <vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zm1, <vscale x 16 x i8> %zm2) {450; CHECK-LABEL: multi_vec_max_multi_x2_u8:451; CHECK: // %bb.0:452; CHECK-NEXT: mov z7.d, z4.d453; CHECK-NEXT: mov z5.d, z2.d454; CHECK-NEXT: mov z6.d, z3.d455; CHECK-NEXT: mov z4.d, z1.d456; CHECK-NEXT: umax { z4.b, z5.b }, { z4.b, z5.b }, { z6.b, z7.b }457; CHECK-NEXT: mov z0.d, z4.d458; CHECK-NEXT: mov z1.d, z5.d459; CHECK-NEXT: ret460 %res = call { <vscale x 16 x i8>, <vscale x 16 x i8> } @llvm.aarch64.sve.umax.x2.nxv16i8(<vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zm1, <vscale x 16 x i8> %zm2)461 ret { <vscale x 16 x i8>, <vscale x 16 x i8> } %res462}463 464define { <vscale x 8 x i16>, <vscale x 8 x i16> } @multi_vec_max_multi_x2_u16(<vscale x 8 x i16> %unused, <vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zm1, <vscale x 8 x i16> %zm2) {465; CHECK-LABEL: multi_vec_max_multi_x2_u16:466; CHECK: // %bb.0:467; CHECK-NEXT: mov z7.d, z4.d468; CHECK-NEXT: mov z5.d, z2.d469; CHECK-NEXT: mov z6.d, z3.d470; CHECK-NEXT: mov z4.d, z1.d471; CHECK-NEXT: umax { z4.h, z5.h }, { z4.h, z5.h }, { z6.h, z7.h }472; CHECK-NEXT: mov z0.d, z4.d473; CHECK-NEXT: mov z1.d, z5.d474; CHECK-NEXT: ret475 %res = call { <vscale x 8 x i16>, <vscale x 8 x i16> } @llvm.aarch64.sve.umax.x2.nxv8i16(<vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zm1, <vscale x 8 x i16> %zm2)476 ret { <vscale x 8 x i16>, <vscale x 8 x i16> } %res477}478 479define { <vscale x 4 x i32>, <vscale x 4 x i32> } @multi_vec_max_multi_x2_u32(<vscale x 4 x i32> %unused, <vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zm1, <vscale x 4 x i32> %zm2) {480; CHECK-LABEL: multi_vec_max_multi_x2_u32:481; CHECK: // %bb.0:482; CHECK-NEXT: mov z7.d, z4.d483; CHECK-NEXT: mov z5.d, z2.d484; CHECK-NEXT: mov z6.d, z3.d485; CHECK-NEXT: mov z4.d, z1.d486; CHECK-NEXT: umax { z4.s, z5.s }, { z4.s, z5.s }, { z6.s, z7.s }487; CHECK-NEXT: mov z0.d, z4.d488; CHECK-NEXT: mov z1.d, z5.d489; CHECK-NEXT: ret490 %res = call { <vscale x 4 x i32>, <vscale x 4 x i32> } @llvm.aarch64.sve.umax.x2.nxv4i32(<vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zm1, <vscale x 4 x i32> %zm2)491 ret { <vscale x 4 x i32>, <vscale x 4 x i32> } %res492}493 494define { <vscale x 2 x i64>, <vscale x 2 x i64> } @multi_vec_max_multi_x2_u64(<vscale x 2 x i64> %unused, <vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zm1, <vscale x 2 x i64> %zm2) {495; CHECK-LABEL: multi_vec_max_multi_x2_u64:496; CHECK: // %bb.0:497; CHECK-NEXT: mov z7.d, z4.d498; CHECK-NEXT: mov z5.d, z2.d499; CHECK-NEXT: mov z6.d, z3.d500; CHECK-NEXT: mov z4.d, z1.d501; CHECK-NEXT: umax { z4.d, z5.d }, { z4.d, z5.d }, { z6.d, z7.d }502; CHECK-NEXT: mov z0.d, z4.d503; CHECK-NEXT: mov z1.d, z5.d504; CHECK-NEXT: ret505 %res = call { <vscale x 2 x i64>, <vscale x 2 x i64> } @llvm.aarch64.sve.umax.x2.nxv2i64(<vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zm1, <vscale x 2 x i64> %zm2)506 ret { <vscale x 2 x i64>, <vscale x 2 x i64> } %res507}508 509; BFMAX (Multi, x2)510 511define { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @multi_vec_max_x2_bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zm1, <vscale x 8 x bfloat> %zm2) {512; CHECK-LABEL: multi_vec_max_x2_bf16:513; CHECK: // %bb.0:514; CHECK-NEXT: // kill: def $z1 killed $z1 killed $z0_z1 def $z0_z1515; CHECK-NEXT: // kill: def $z3 killed $z3 killed $z2_z3 def $z2_z3516; CHECK-NEXT: // kill: def $z0 killed $z0 killed $z0_z1 def $z0_z1517; CHECK-NEXT: // kill: def $z2 killed $z2 killed $z2_z3 def $z2_z3518; CHECK-NEXT: bfmax { z0.h, z1.h }, { z0.h, z1.h }, { z2.h, z3.h }519; CHECK-NEXT: ret520 %res = call { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @llvm.aarch64.sve.fmax.x2.nxv8bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zm1, <vscale x 8 x bfloat> %zm2)521 ret { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } %res522}523 524; FMAX (Multi, x2)525 526define { <vscale x 8 x half>, <vscale x 8 x half> } @multi_vec_max_multi_x2_f16(<vscale x 8 x half> %unused, <vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zm1, <vscale x 8 x half> %zm2) {527; CHECK-LABEL: multi_vec_max_multi_x2_f16:528; CHECK: // %bb.0:529; CHECK-NEXT: mov z7.d, z4.d530; CHECK-NEXT: mov z5.d, z2.d531; CHECK-NEXT: mov z6.d, z3.d532; CHECK-NEXT: mov z4.d, z1.d533; CHECK-NEXT: fmax { z4.h, z5.h }, { z4.h, z5.h }, { z6.h, z7.h }534; CHECK-NEXT: mov z0.d, z4.d535; CHECK-NEXT: mov z1.d, z5.d536; CHECK-NEXT: ret537 %res = call { <vscale x 8 x half>, <vscale x 8 x half> } @llvm.aarch64.sve.fmax.x2.nxv8f16(<vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zm1, <vscale x 8 x half> %zm2)538 ret { <vscale x 8 x half>, <vscale x 8 x half> } %res539}540 541define { <vscale x 4 x float>, <vscale x 4 x float> } @multi_vec_max_multi_x2_f32(<vscale x 4 x float> %unused, <vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zm1, <vscale x 4 x float> %zm2) {542; CHECK-LABEL: multi_vec_max_multi_x2_f32:543; CHECK: // %bb.0:544; CHECK-NEXT: mov z7.d, z4.d545; CHECK-NEXT: mov z5.d, z2.d546; CHECK-NEXT: mov z6.d, z3.d547; CHECK-NEXT: mov z4.d, z1.d548; CHECK-NEXT: fmax { z4.s, z5.s }, { z4.s, z5.s }, { z6.s, z7.s }549; CHECK-NEXT: mov z0.d, z4.d550; CHECK-NEXT: mov z1.d, z5.d551; CHECK-NEXT: ret552 %res = call { <vscale x 4 x float>, <vscale x 4 x float> } @llvm.aarch64.sve.fmax.x2.nxv4f32(<vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zm1, <vscale x 4 x float> %zm2)553 ret { <vscale x 4 x float>, <vscale x 4 x float> } %res554}555 556define { <vscale x 2 x double>, <vscale x 2 x double> } @multi_vec_max_multi_x2_f64(<vscale x 2 x double> %unused, <vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zm1, <vscale x 2 x double> %zm2) {557; CHECK-LABEL: multi_vec_max_multi_x2_f64:558; CHECK: // %bb.0:559; CHECK-NEXT: mov z7.d, z4.d560; CHECK-NEXT: mov z5.d, z2.d561; CHECK-NEXT: mov z6.d, z3.d562; CHECK-NEXT: mov z4.d, z1.d563; CHECK-NEXT: fmax { z4.d, z5.d }, { z4.d, z5.d }, { z6.d, z7.d }564; CHECK-NEXT: mov z0.d, z4.d565; CHECK-NEXT: mov z1.d, z5.d566; CHECK-NEXT: ret567 %res = call { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.aarch64.sve.fmax.x2.nxv2f64(<vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zm1, <vscale x 2 x double> %zm2)568 ret { <vscale x 2 x double>, <vscale x 2 x double> } %res569}570 571; SMAX (Multi, x4)572 573define { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> } @multi_vec_max_multi_x4_s8(<vscale x 16 x i8> %unused, <vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zdn3, <vscale x 16 x i8> %zdn4,574; CHECK-LABEL: multi_vec_max_multi_x4_s8:575; CHECK: // %bb.0:576; CHECK-NEXT: mov z30.d, z7.d577; CHECK-NEXT: mov z27.d, z4.d578; CHECK-NEXT: mov z29.d, z6.d579; CHECK-NEXT: mov z26.d, z3.d580; CHECK-NEXT: mov z28.d, z5.d581; CHECK-NEXT: mov z25.d, z2.d582; CHECK-NEXT: ldr z31, [x0]583; CHECK-NEXT: mov z24.d, z1.d584; CHECK-NEXT: smax { z24.b - z27.b }, { z24.b - z27.b }, { z28.b - z31.b }585; CHECK-NEXT: mov z0.d, z24.d586; CHECK-NEXT: mov z1.d, z25.d587; CHECK-NEXT: mov z2.d, z26.d588; CHECK-NEXT: mov z3.d, z27.d589; CHECK-NEXT: ret590 <vscale x 16 x i8> %zm1, <vscale x 16 x i8> %zm2, <vscale x 16 x i8> %zm3, <vscale x 16 x i8> %zm4) {591 %res = call { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> }592 @llvm.aarch64.sve.smax.x4.nxv16i8(<vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zdn3, <vscale x 16 x i8> %zdn4,593 <vscale x 16 x i8> %zm1, <vscale x 16 x i8> %zm2, <vscale x 16 x i8> %zm3, <vscale x 16 x i8> %zm4)594 ret { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> } %res595}596 597define { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> } @multi_vec_max_multi_x4_s16(<vscale x 8 x i16> %unused, <vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zdn3, <vscale x 8 x i16> %zdn4,598; CHECK-LABEL: multi_vec_max_multi_x4_s16:599; CHECK: // %bb.0:600; CHECK-NEXT: mov z30.d, z7.d601; CHECK-NEXT: mov z27.d, z4.d602; CHECK-NEXT: mov z29.d, z6.d603; CHECK-NEXT: mov z26.d, z3.d604; CHECK-NEXT: mov z28.d, z5.d605; CHECK-NEXT: mov z25.d, z2.d606; CHECK-NEXT: ldr z31, [x0]607; CHECK-NEXT: mov z24.d, z1.d608; CHECK-NEXT: smax { z24.h - z27.h }, { z24.h - z27.h }, { z28.h - z31.h }609; CHECK-NEXT: mov z0.d, z24.d610; CHECK-NEXT: mov z1.d, z25.d611; CHECK-NEXT: mov z2.d, z26.d612; CHECK-NEXT: mov z3.d, z27.d613; CHECK-NEXT: ret614 <vscale x 8 x i16> %zm1, <vscale x 8 x i16> %zm2, <vscale x 8 x i16> %zm3, <vscale x 8 x i16> %zm4) {615 %res = call { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> }616 @llvm.aarch64.sve.smax.x4.nxv8i16(<vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zdn3, <vscale x 8 x i16> %zdn4,617 <vscale x 8 x i16> %zm1, <vscale x 8 x i16> %zm2, <vscale x 8 x i16> %zm3, <vscale x 8 x i16> %zm4)618 ret { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> } %res619}620 621define { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> } @multi_vec_max_multi_x4_s32(<vscale x 4 x i32> %unused, <vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zdn3, <vscale x 4 x i32> %zdn4,622; CHECK-LABEL: multi_vec_max_multi_x4_s32:623; CHECK: // %bb.0:624; CHECK-NEXT: mov z30.d, z7.d625; CHECK-NEXT: mov z27.d, z4.d626; CHECK-NEXT: mov z29.d, z6.d627; CHECK-NEXT: mov z26.d, z3.d628; CHECK-NEXT: mov z28.d, z5.d629; CHECK-NEXT: mov z25.d, z2.d630; CHECK-NEXT: ldr z31, [x0]631; CHECK-NEXT: mov z24.d, z1.d632; CHECK-NEXT: smax { z24.s - z27.s }, { z24.s - z27.s }, { z28.s - z31.s }633; CHECK-NEXT: mov z0.d, z24.d634; CHECK-NEXT: mov z1.d, z25.d635; CHECK-NEXT: mov z2.d, z26.d636; CHECK-NEXT: mov z3.d, z27.d637; CHECK-NEXT: ret638 <vscale x 4 x i32> %zm1, <vscale x 4 x i32> %zm2, <vscale x 4 x i32> %zm3, <vscale x 4 x i32> %zm4) {639 %res = call { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> }640 @llvm.aarch64.sve.smax.x4.nxv4i32(<vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zdn3, <vscale x 4 x i32> %zdn4,641 <vscale x 4 x i32> %zm1, <vscale x 4 x i32> %zm2, <vscale x 4 x i32> %zm3, <vscale x 4 x i32> %zm4)642 ret { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> } %res643}644 645define { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> } @multi_vec_max_multi_x4_s64(<vscale x 2 x i64> %unused, <vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zdn3, <vscale x 2 x i64> %zdn4,646; CHECK-LABEL: multi_vec_max_multi_x4_s64:647; CHECK: // %bb.0:648; CHECK-NEXT: mov z30.d, z7.d649; CHECK-NEXT: mov z27.d, z4.d650; CHECK-NEXT: mov z29.d, z6.d651; CHECK-NEXT: mov z26.d, z3.d652; CHECK-NEXT: mov z28.d, z5.d653; CHECK-NEXT: mov z25.d, z2.d654; CHECK-NEXT: ldr z31, [x0]655; CHECK-NEXT: mov z24.d, z1.d656; CHECK-NEXT: smax { z24.d - z27.d }, { z24.d - z27.d }, { z28.d - z31.d }657; CHECK-NEXT: mov z0.d, z24.d658; CHECK-NEXT: mov z1.d, z25.d659; CHECK-NEXT: mov z2.d, z26.d660; CHECK-NEXT: mov z3.d, z27.d661; CHECK-NEXT: ret662 <vscale x 2 x i64> %zm1, <vscale x 2 x i64> %zm2, <vscale x 2 x i64> %zm3, <vscale x 2 x i64> %zm4) {663 %res = call { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> }664 @llvm.aarch64.sve.smax.x4.nxv2i64(<vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zdn3, <vscale x 2 x i64> %zdn4,665 <vscale x 2 x i64> %zm1, <vscale x 2 x i64> %zm2, <vscale x 2 x i64> %zm3, <vscale x 2 x i64> %zm4)666 ret { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> } %res667}668 669; UMAX (Multi, x4)670 671define { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> } @multi_vec_max_multi_x4_u8(<vscale x 16 x i8> %unused, <vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zdn3, <vscale x 16 x i8> %zdn4,672; CHECK-LABEL: multi_vec_max_multi_x4_u8:673; CHECK: // %bb.0:674; CHECK-NEXT: mov z30.d, z7.d675; CHECK-NEXT: mov z27.d, z4.d676; CHECK-NEXT: mov z29.d, z6.d677; CHECK-NEXT: mov z26.d, z3.d678; CHECK-NEXT: mov z28.d, z5.d679; CHECK-NEXT: mov z25.d, z2.d680; CHECK-NEXT: ldr z31, [x0]681; CHECK-NEXT: mov z24.d, z1.d682; CHECK-NEXT: umax { z24.b - z27.b }, { z24.b - z27.b }, { z28.b - z31.b }683; CHECK-NEXT: mov z0.d, z24.d684; CHECK-NEXT: mov z1.d, z25.d685; CHECK-NEXT: mov z2.d, z26.d686; CHECK-NEXT: mov z3.d, z27.d687; CHECK-NEXT: ret688 <vscale x 16 x i8> %zm1, <vscale x 16 x i8> %zm2, <vscale x 16 x i8> %zm3, <vscale x 16 x i8> %zm4) {689 %res = call { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> }690 @llvm.aarch64.sve.umax.x4.nxv16i8(<vscale x 16 x i8> %zdn1, <vscale x 16 x i8> %zdn2, <vscale x 16 x i8> %zdn3, <vscale x 16 x i8> %zdn4,691 <vscale x 16 x i8> %zm1, <vscale x 16 x i8> %zm2, <vscale x 16 x i8> %zm3, <vscale x 16 x i8> %zm4)692 ret { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> } %res693}694 695define { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> } @multi_vec_max_multi_x4_u16(<vscale x 8 x i16> %unused, <vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zdn3, <vscale x 8 x i16> %zdn4,696; CHECK-LABEL: multi_vec_max_multi_x4_u16:697; CHECK: // %bb.0:698; CHECK-NEXT: mov z30.d, z7.d699; CHECK-NEXT: mov z27.d, z4.d700; CHECK-NEXT: mov z29.d, z6.d701; CHECK-NEXT: mov z26.d, z3.d702; CHECK-NEXT: mov z28.d, z5.d703; CHECK-NEXT: mov z25.d, z2.d704; CHECK-NEXT: ldr z31, [x0]705; CHECK-NEXT: mov z24.d, z1.d706; CHECK-NEXT: umax { z24.h - z27.h }, { z24.h - z27.h }, { z28.h - z31.h }707; CHECK-NEXT: mov z0.d, z24.d708; CHECK-NEXT: mov z1.d, z25.d709; CHECK-NEXT: mov z2.d, z26.d710; CHECK-NEXT: mov z3.d, z27.d711; CHECK-NEXT: ret712 <vscale x 8 x i16> %zm1, <vscale x 8 x i16> %zm2, <vscale x 8 x i16> %zm3, <vscale x 8 x i16> %zm4) {713 %res = call { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> }714 @llvm.aarch64.sve.umax.x4.nxv8i16(<vscale x 8 x i16> %zdn1, <vscale x 8 x i16> %zdn2, <vscale x 8 x i16> %zdn3, <vscale x 8 x i16> %zdn4,715 <vscale x 8 x i16> %zm1, <vscale x 8 x i16> %zm2, <vscale x 8 x i16> %zm3, <vscale x 8 x i16> %zm4)716 ret { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> } %res717}718 719define { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> } @multi_vec_max_multi_x4_u32(<vscale x 4 x i32> %unused, <vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zdn3, <vscale x 4 x i32> %zdn4,720; CHECK-LABEL: multi_vec_max_multi_x4_u32:721; CHECK: // %bb.0:722; CHECK-NEXT: mov z30.d, z7.d723; CHECK-NEXT: mov z27.d, z4.d724; CHECK-NEXT: mov z29.d, z6.d725; CHECK-NEXT: mov z26.d, z3.d726; CHECK-NEXT: mov z28.d, z5.d727; CHECK-NEXT: mov z25.d, z2.d728; CHECK-NEXT: ldr z31, [x0]729; CHECK-NEXT: mov z24.d, z1.d730; CHECK-NEXT: umax { z24.s - z27.s }, { z24.s - z27.s }, { z28.s - z31.s }731; CHECK-NEXT: mov z0.d, z24.d732; CHECK-NEXT: mov z1.d, z25.d733; CHECK-NEXT: mov z2.d, z26.d734; CHECK-NEXT: mov z3.d, z27.d735; CHECK-NEXT: ret736 <vscale x 4 x i32> %zm1, <vscale x 4 x i32> %zm2, <vscale x 4 x i32> %zm3, <vscale x 4 x i32> %zm4) {737 %res = call { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> }738 @llvm.aarch64.sve.umax.x4.nxv4i32(<vscale x 4 x i32> %zdn1, <vscale x 4 x i32> %zdn2, <vscale x 4 x i32> %zdn3, <vscale x 4 x i32> %zdn4,739 <vscale x 4 x i32> %zm1, <vscale x 4 x i32> %zm2, <vscale x 4 x i32> %zm3, <vscale x 4 x i32> %zm4)740 ret { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> } %res741}742 743define { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> } @multi_vec_max_multi_x4_u64(<vscale x 2 x i64> %unused, <vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zdn3, <vscale x 2 x i64> %zdn4,744; CHECK-LABEL: multi_vec_max_multi_x4_u64:745; CHECK: // %bb.0:746; CHECK-NEXT: mov z30.d, z7.d747; CHECK-NEXT: mov z27.d, z4.d748; CHECK-NEXT: mov z29.d, z6.d749; CHECK-NEXT: mov z26.d, z3.d750; CHECK-NEXT: mov z28.d, z5.d751; CHECK-NEXT: mov z25.d, z2.d752; CHECK-NEXT: ldr z31, [x0]753; CHECK-NEXT: mov z24.d, z1.d754; CHECK-NEXT: umax { z24.d - z27.d }, { z24.d - z27.d }, { z28.d - z31.d }755; CHECK-NEXT: mov z0.d, z24.d756; CHECK-NEXT: mov z1.d, z25.d757; CHECK-NEXT: mov z2.d, z26.d758; CHECK-NEXT: mov z3.d, z27.d759; CHECK-NEXT: ret760 <vscale x 2 x i64> %zm1, <vscale x 2 x i64> %zm2, <vscale x 2 x i64> %zm3, <vscale x 2 x i64> %zm4) {761 %res = call { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> }762 @llvm.aarch64.sve.umax.x4.nxv2i64(<vscale x 2 x i64> %zdn1, <vscale x 2 x i64> %zdn2, <vscale x 2 x i64> %zdn3, <vscale x 2 x i64> %zdn4,763 <vscale x 2 x i64> %zm1, <vscale x 2 x i64> %zm2, <vscale x 2 x i64> %zm3, <vscale x 2 x i64> %zm4)764 ret { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> } %res765}766 767; BFMAX (Multi, x4)768 769define { <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @multi_vec_max_x4_bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zdn3, <vscale x 8 x bfloat> %zdn4, <vscale x 8 x bfloat> %zm1, <vscale x 8 x bfloat> %zm2, <vscale x 8 x bfloat> %zm3, <vscale x 8 x bfloat> %zm4) {770; CHECK-LABEL: multi_vec_max_x4_bf16:771; CHECK: // %bb.0:772; CHECK-NEXT: // kill: def $z3 killed $z3 killed $z0_z1_z2_z3 def $z0_z1_z2_z3773; CHECK-NEXT: // kill: def $z7 killed $z7 killed $z4_z5_z6_z7 def $z4_z5_z6_z7774; CHECK-NEXT: // kill: def $z2 killed $z2 killed $z0_z1_z2_z3 def $z0_z1_z2_z3775; CHECK-NEXT: // kill: def $z6 killed $z6 killed $z4_z5_z6_z7 def $z4_z5_z6_z7776; CHECK-NEXT: // kill: def $z1 killed $z1 killed $z0_z1_z2_z3 def $z0_z1_z2_z3777; CHECK-NEXT: // kill: def $z5 killed $z5 killed $z4_z5_z6_z7 def $z4_z5_z6_z7778; CHECK-NEXT: // kill: def $z0 killed $z0 killed $z0_z1_z2_z3 def $z0_z1_z2_z3779; CHECK-NEXT: // kill: def $z4 killed $z4 killed $z4_z5_z6_z7 def $z4_z5_z6_z7780; CHECK-NEXT: bfmax { z0.h - z3.h }, { z0.h - z3.h }, { z4.h - z7.h }781; CHECK-NEXT: ret782 %res = call { <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @llvm.aarch64.sve.fmax.x4.nxv8bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zdn3, <vscale x 8 x bfloat> %zdn4, <vscale x 8 x bfloat> %zm1, <vscale x 8 x bfloat> %zm2, <vscale x 8 x bfloat> %zm3, <vscale x 8 x bfloat> %zm4)783 ret { <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } %res784}785 786; FMAX (Multi, x4)787 788define { <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half> } @multi_vec_max_multi_x4_f16(<vscale x 8 x half> %unused, <vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zdn3, <vscale x 8 x half> %zdn4,789; CHECK-LABEL: multi_vec_max_multi_x4_f16:790; CHECK: // %bb.0:791; CHECK-NEXT: mov z30.d, z7.d792; CHECK-NEXT: mov z27.d, z4.d793; CHECK-NEXT: mov z29.d, z6.d794; CHECK-NEXT: mov z26.d, z3.d795; CHECK-NEXT: mov z28.d, z5.d796; CHECK-NEXT: mov z25.d, z2.d797; CHECK-NEXT: ldr z31, [x0]798; CHECK-NEXT: mov z24.d, z1.d799; CHECK-NEXT: fmax { z24.h - z27.h }, { z24.h - z27.h }, { z28.h - z31.h }800; CHECK-NEXT: mov z0.d, z24.d801; CHECK-NEXT: mov z1.d, z25.d802; CHECK-NEXT: mov z2.d, z26.d803; CHECK-NEXT: mov z3.d, z27.d804; CHECK-NEXT: ret805 <vscale x 8 x half> %zm1, <vscale x 8 x half> %zm2, <vscale x 8 x half> %zm3, <vscale x 8 x half> %zm4) {806 %res = call { <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half> }807 @llvm.aarch64.sve.fmax.x4.nxv8f16(<vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zdn3, <vscale x 8 x half> %zdn4,808 <vscale x 8 x half> %zm1, <vscale x 8 x half> %zm2, <vscale x 8 x half> %zm3, <vscale x 8 x half> %zm4)809 ret { <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half> } %res810}811 812define { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> } @multi_vec_max_multi_x4_f32(<vscale x 4 x float> %unused, <vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zdn3, <vscale x 4 x float> %zdn4,813; CHECK-LABEL: multi_vec_max_multi_x4_f32:814; CHECK: // %bb.0:815; CHECK-NEXT: mov z30.d, z7.d816; CHECK-NEXT: mov z27.d, z4.d817; CHECK-NEXT: mov z29.d, z6.d818; CHECK-NEXT: mov z26.d, z3.d819; CHECK-NEXT: mov z28.d, z5.d820; CHECK-NEXT: mov z25.d, z2.d821; CHECK-NEXT: ldr z31, [x0]822; CHECK-NEXT: mov z24.d, z1.d823; CHECK-NEXT: fmax { z24.s - z27.s }, { z24.s - z27.s }, { z28.s - z31.s }824; CHECK-NEXT: mov z0.d, z24.d825; CHECK-NEXT: mov z1.d, z25.d826; CHECK-NEXT: mov z2.d, z26.d827; CHECK-NEXT: mov z3.d, z27.d828; CHECK-NEXT: ret829 <vscale x 4 x float> %zm1, <vscale x 4 x float> %zm2, <vscale x 4 x float> %zm3, <vscale x 4 x float> %zm4) {830 %res = call { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> }831 @llvm.aarch64.sve.fmax.x4.nxv4f32(<vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zdn3, <vscale x 4 x float> %zdn4,832 <vscale x 4 x float> %zm1, <vscale x 4 x float> %zm2, <vscale x 4 x float> %zm3, <vscale x 4 x float> %zm4)833 ret { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> } %res834}835 836define { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> } @multi_vec_max_multi_x4_f64(<vscale x 2 x double> %unused, <vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zdn3, <vscale x 2 x double> %zdn4,837; CHECK-LABEL: multi_vec_max_multi_x4_f64:838; CHECK: // %bb.0:839; CHECK-NEXT: mov z30.d, z7.d840; CHECK-NEXT: mov z27.d, z4.d841; CHECK-NEXT: mov z29.d, z6.d842; CHECK-NEXT: mov z26.d, z3.d843; CHECK-NEXT: mov z28.d, z5.d844; CHECK-NEXT: mov z25.d, z2.d845; CHECK-NEXT: ldr z31, [x0]846; CHECK-NEXT: mov z24.d, z1.d847; CHECK-NEXT: fmax { z24.d - z27.d }, { z24.d - z27.d }, { z28.d - z31.d }848; CHECK-NEXT: mov z0.d, z24.d849; CHECK-NEXT: mov z1.d, z25.d850; CHECK-NEXT: mov z2.d, z26.d851; CHECK-NEXT: mov z3.d, z27.d852; CHECK-NEXT: ret853 <vscale x 2 x double> %zm1, <vscale x 2 x double> %zm2, <vscale x 2 x double> %zm3, <vscale x 2 x double> %zm4) {854 %res = call { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> }855 @llvm.aarch64.sve.fmax.x4.nxv2f64(<vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zdn3, <vscale x 2 x double> %zdn4,856 <vscale x 2 x double> %zm1, <vscale x 2 x double> %zm2, <vscale x 2 x double> %zm3, <vscale x 2 x double> %zm4)857 ret { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> } %res858}859 860; BFMAXNM (Single, x2)861 862define { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @multi_vec_maxnm_single_x2_bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zm) {863; CHECK-LABEL: multi_vec_maxnm_single_x2_bf16:864; CHECK: // %bb.0:865; CHECK-NEXT: // kill: def $z1 killed $z1 killed $z0_z1 def $z0_z1866; CHECK-NEXT: // kill: def $z0 killed $z0 killed $z0_z1 def $z0_z1867; CHECK-NEXT: bfmaxnm { z0.h, z1.h }, { z0.h, z1.h }, z2.h868; CHECK-NEXT: ret869 %res = call { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @llvm.aarch64.sve.fmaxnm.single.x2.nxv8bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zm)870 ret { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } %res871}872 873; FMAXNM (Single, x2)874 875define { <vscale x 8 x half>, <vscale x 8 x half> } @multi_vec_maxnm_single_x2_f16(<vscale x 8 x half> %dummy, <vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zm) {876; CHECK-LABEL: multi_vec_maxnm_single_x2_f16:877; CHECK: // %bb.0:878; CHECK-NEXT: mov z5.d, z2.d879; CHECK-NEXT: mov z4.d, z1.d880; CHECK-NEXT: fmaxnm { z4.h, z5.h }, { z4.h, z5.h }, z3.h881; CHECK-NEXT: mov z0.d, z4.d882; CHECK-NEXT: mov z1.d, z5.d883; CHECK-NEXT: ret884 %res = call { <vscale x 8 x half>, <vscale x 8 x half> } @llvm.aarch64.sve.fmaxnm.single.x2.nxv8f16(<vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zm)885 ret { <vscale x 8 x half>, <vscale x 8 x half> } %res886}887 888define { <vscale x 4 x float>, <vscale x 4 x float> } @multi_vec_maxnm_single_x2_f32(<vscale x 8 x half> %dummy, <vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zm) {889; CHECK-LABEL: multi_vec_maxnm_single_x2_f32:890; CHECK: // %bb.0:891; CHECK-NEXT: mov z5.d, z2.d892; CHECK-NEXT: mov z4.d, z1.d893; CHECK-NEXT: fmaxnm { z4.s, z5.s }, { z4.s, z5.s }, z3.s894; CHECK-NEXT: mov z0.d, z4.d895; CHECK-NEXT: mov z1.d, z5.d896; CHECK-NEXT: ret897 %res = call { <vscale x 4 x float>, <vscale x 4 x float> } @llvm.aarch64.sve.fmaxnm.single.x2.nxv4f32(<vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zm)898 ret { <vscale x 4 x float>, <vscale x 4 x float> } %res899}900 901define { <vscale x 2 x double>, <vscale x 2 x double> } @multi_vec_maxnm_single_x2_f64(<vscale x 8 x half> %dummy, <vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zm) {902; CHECK-LABEL: multi_vec_maxnm_single_x2_f64:903; CHECK: // %bb.0:904; CHECK-NEXT: mov z5.d, z2.d905; CHECK-NEXT: mov z4.d, z1.d906; CHECK-NEXT: fmaxnm { z4.d, z5.d }, { z4.d, z5.d }, z3.d907; CHECK-NEXT: mov z0.d, z4.d908; CHECK-NEXT: mov z1.d, z5.d909; CHECK-NEXT: ret910 %res = call { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.aarch64.sve.fmaxnm.single.x2.nxv2f64(<vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zm)911 ret { <vscale x 2 x double>, <vscale x 2 x double> } %res912}913 914; BFMAXNM (Single, x4)915 916define { <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @multi_vec_maxnm_single_x4_bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zdn3, <vscale x 8 x bfloat> %zdn4, <vscale x 8 x bfloat> %zm) {917; CHECK-LABEL: multi_vec_maxnm_single_x4_bf16:918; CHECK: // %bb.0:919; CHECK-NEXT: // kill: def $z3 killed $z3 killed $z0_z1_z2_z3 def $z0_z1_z2_z3920; CHECK-NEXT: // kill: def $z2 killed $z2 killed $z0_z1_z2_z3 def $z0_z1_z2_z3921; CHECK-NEXT: // kill: def $z1 killed $z1 killed $z0_z1_z2_z3 def $z0_z1_z2_z3922; CHECK-NEXT: // kill: def $z0 killed $z0 killed $z0_z1_z2_z3 def $z0_z1_z2_z3923; CHECK-NEXT: bfmaxnm { z0.h - z3.h }, { z0.h - z3.h }, z4.h924; CHECK-NEXT: ret925 %res = call { <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @llvm.aarch64.sve.fmaxnm.single.x4.nxv8bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zdn3, <vscale x 8 x bfloat> %zdn4, <vscale x 8 x bfloat> %zm)926 ret { <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } %res927}928 929; FMAXNM (Single, x4)930 931define { <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half> } @multi_vec_maxnm_single_x4_f16(<vscale x 8 x half> %dummy, <vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zdn3, <vscale x 8 x half> %zdn4, <vscale x 8 x half> %zm) {932; CHECK-LABEL: multi_vec_maxnm_single_x4_f16:933; CHECK: // %bb.0:934; CHECK-NEXT: mov z27.d, z4.d935; CHECK-NEXT: mov z26.d, z3.d936; CHECK-NEXT: mov z25.d, z2.d937; CHECK-NEXT: mov z24.d, z1.d938; CHECK-NEXT: fmaxnm { z24.h - z27.h }, { z24.h - z27.h }, z5.h939; CHECK-NEXT: mov z0.d, z24.d940; CHECK-NEXT: mov z1.d, z25.d941; CHECK-NEXT: mov z2.d, z26.d942; CHECK-NEXT: mov z3.d, z27.d943; CHECK-NEXT: ret944 %res = call { <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half> }945 @llvm.aarch64.sve.fmaxnm.single.x4.nxv8f16(<vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zdn3, <vscale x 8 x half> %zdn4, <vscale x 8 x half> %zm)946 ret { <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half> } %res947}948 949define { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> } @multi_vec_maxnm_single_x4_f32(<vscale x 8 x half> %dummy, <vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zdn3, <vscale x 4 x float> %zdn4, <vscale x 4 x float> %zm) {950; CHECK-LABEL: multi_vec_maxnm_single_x4_f32:951; CHECK: // %bb.0:952; CHECK-NEXT: mov z27.d, z4.d953; CHECK-NEXT: mov z26.d, z3.d954; CHECK-NEXT: mov z25.d, z2.d955; CHECK-NEXT: mov z24.d, z1.d956; CHECK-NEXT: fmaxnm { z24.s - z27.s }, { z24.s - z27.s }, z5.s957; CHECK-NEXT: mov z0.d, z24.d958; CHECK-NEXT: mov z1.d, z25.d959; CHECK-NEXT: mov z2.d, z26.d960; CHECK-NEXT: mov z3.d, z27.d961; CHECK-NEXT: ret962 %res = call { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> }963 @llvm.aarch64.sve.fmaxnm.single.x4.nxv4f32(<vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zdn3, <vscale x 4 x float> %zdn4, <vscale x 4 x float> %zm)964 ret { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> } %res965}966 967define { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> } @multi_vec_maxnm_single_x4_f64(<vscale x 8 x half> %dummy, <vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zdn3, <vscale x 2 x double> %zdn4, <vscale x 2 x double> %zm) {968; CHECK-LABEL: multi_vec_maxnm_single_x4_f64:969; CHECK: // %bb.0:970; CHECK-NEXT: mov z27.d, z4.d971; CHECK-NEXT: mov z26.d, z3.d972; CHECK-NEXT: mov z25.d, z2.d973; CHECK-NEXT: mov z24.d, z1.d974; CHECK-NEXT: fmaxnm { z24.d - z27.d }, { z24.d - z27.d }, z5.d975; CHECK-NEXT: mov z0.d, z24.d976; CHECK-NEXT: mov z1.d, z25.d977; CHECK-NEXT: mov z2.d, z26.d978; CHECK-NEXT: mov z3.d, z27.d979; CHECK-NEXT: ret980 %res = call { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> }981 @llvm.aarch64.sve.fmaxnm.single.x4.nxv2f64(<vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zdn3, <vscale x 2 x double> %zdn4, <vscale x 2 x double> %zm)982 ret { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> } %res983}984 985; BFMAXNM (Multi, x2)986 987define { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @multi_vec_maxnm_x2_bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zm1, <vscale x 8 x bfloat> %zm2) {988; CHECK-LABEL: multi_vec_maxnm_x2_bf16:989; CHECK: // %bb.0:990; CHECK-NEXT: // kill: def $z1 killed $z1 killed $z0_z1 def $z0_z1991; CHECK-NEXT: // kill: def $z3 killed $z3 killed $z2_z3 def $z2_z3992; CHECK-NEXT: // kill: def $z0 killed $z0 killed $z0_z1 def $z0_z1993; CHECK-NEXT: // kill: def $z2 killed $z2 killed $z2_z3 def $z2_z3994; CHECK-NEXT: bfmaxnm { z0.h, z1.h }, { z0.h, z1.h }, { z2.h, z3.h }995; CHECK-NEXT: ret996 %res = call { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @llvm.aarch64.sve.fmaxnm.x2.nxv8bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zm1, <vscale x 8 x bfloat> %zm2)997 ret { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } %res998}999 1000; FMAXNM (Multi, x2)1001 1002define { <vscale x 8 x half>, <vscale x 8 x half> } @multi_vec_maxnm_x2_f16(<vscale x 8 x half> %dummy, <vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zm1, <vscale x 8 x half> %zm2) {1003; CHECK-LABEL: multi_vec_maxnm_x2_f16:1004; CHECK: // %bb.0:1005; CHECK-NEXT: mov z7.d, z4.d1006; CHECK-NEXT: mov z5.d, z2.d1007; CHECK-NEXT: mov z6.d, z3.d1008; CHECK-NEXT: mov z4.d, z1.d1009; CHECK-NEXT: fmaxnm { z4.h, z5.h }, { z4.h, z5.h }, { z6.h, z7.h }1010; CHECK-NEXT: mov z0.d, z4.d1011; CHECK-NEXT: mov z1.d, z5.d1012; CHECK-NEXT: ret1013 %res = call { <vscale x 8 x half>, <vscale x 8 x half> } @llvm.aarch64.sve.fmaxnm.x2.nxv8f16(<vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zm1, <vscale x 8 x half> %zm2)1014 ret { <vscale x 8 x half>, <vscale x 8 x half> } %res1015}1016 1017define { <vscale x 4 x float>, <vscale x 4 x float> } @multi_vec_maxnm_x2_f32(<vscale x 8 x half> %dummy, <vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zm1, <vscale x 4 x float> %zm2) {1018; CHECK-LABEL: multi_vec_maxnm_x2_f32:1019; CHECK: // %bb.0:1020; CHECK-NEXT: mov z7.d, z4.d1021; CHECK-NEXT: mov z5.d, z2.d1022; CHECK-NEXT: mov z6.d, z3.d1023; CHECK-NEXT: mov z4.d, z1.d1024; CHECK-NEXT: fmaxnm { z4.s, z5.s }, { z4.s, z5.s }, { z6.s, z7.s }1025; CHECK-NEXT: mov z0.d, z4.d1026; CHECK-NEXT: mov z1.d, z5.d1027; CHECK-NEXT: ret1028 %res = call { <vscale x 4 x float>, <vscale x 4 x float> } @llvm.aarch64.sve.fmaxnm.x2.nxv4f32(<vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zm1, <vscale x 4 x float> %zm2)1029 ret { <vscale x 4 x float>, <vscale x 4 x float> } %res1030}1031 1032define { <vscale x 2 x double>, <vscale x 2 x double> } @multi_vec_maxnm_x2_f64(<vscale x 8 x half> %dummy, <vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zm1, <vscale x 2 x double> %zm2) {1033; CHECK-LABEL: multi_vec_maxnm_x2_f64:1034; CHECK: // %bb.0:1035; CHECK-NEXT: mov z7.d, z4.d1036; CHECK-NEXT: mov z5.d, z2.d1037; CHECK-NEXT: mov z6.d, z3.d1038; CHECK-NEXT: mov z4.d, z1.d1039; CHECK-NEXT: fmaxnm { z4.d, z5.d }, { z4.d, z5.d }, { z6.d, z7.d }1040; CHECK-NEXT: mov z0.d, z4.d1041; CHECK-NEXT: mov z1.d, z5.d1042; CHECK-NEXT: ret1043 %res = call { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.aarch64.sve.fmaxnm.x2.nxv2f64(<vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zm1, <vscale x 2 x double> %zm2)1044 ret { <vscale x 2 x double>, <vscale x 2 x double> } %res1045}1046 1047; BFMAXNM (Multi, x4)1048 1049define { <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @multi_vec_maxnm_x4_bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zdn3, <vscale x 8 x bfloat> %zdn4, <vscale x 8 x bfloat> %zm1, <vscale x 8 x bfloat> %zm2, <vscale x 8 x bfloat> %zm3, <vscale x 8 x bfloat> %zm4) {1050; CHECK-LABEL: multi_vec_maxnm_x4_bf16:1051; CHECK: // %bb.0:1052; CHECK-NEXT: // kill: def $z3 killed $z3 killed $z0_z1_z2_z3 def $z0_z1_z2_z31053; CHECK-NEXT: // kill: def $z7 killed $z7 killed $z4_z5_z6_z7 def $z4_z5_z6_z71054; CHECK-NEXT: // kill: def $z2 killed $z2 killed $z0_z1_z2_z3 def $z0_z1_z2_z31055; CHECK-NEXT: // kill: def $z6 killed $z6 killed $z4_z5_z6_z7 def $z4_z5_z6_z71056; CHECK-NEXT: // kill: def $z1 killed $z1 killed $z0_z1_z2_z3 def $z0_z1_z2_z31057; CHECK-NEXT: // kill: def $z5 killed $z5 killed $z4_z5_z6_z7 def $z4_z5_z6_z71058; CHECK-NEXT: // kill: def $z0 killed $z0 killed $z0_z1_z2_z3 def $z0_z1_z2_z31059; CHECK-NEXT: // kill: def $z4 killed $z4 killed $z4_z5_z6_z7 def $z4_z5_z6_z71060; CHECK-NEXT: bfmaxnm { z0.h - z3.h }, { z0.h - z3.h }, { z4.h - z7.h }1061; CHECK-NEXT: ret1062 %res = call { <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @llvm.aarch64.sve.fmaxnm.x4.nxv8bf16(<vscale x 8 x bfloat> %zdn1, <vscale x 8 x bfloat> %zdn2, <vscale x 8 x bfloat> %zdn3, <vscale x 8 x bfloat> %zdn4, <vscale x 8 x bfloat> %zm1, <vscale x 8 x bfloat> %zm2, <vscale x 8 x bfloat> %zm3, <vscale x 8 x bfloat> %zm4)1063 ret { <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } %res1064}1065 1066; FMAXNM (Multi, x4)1067 1068define { <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half> } @multi_vec_maxnm_x4_f16(<vscale x 8 x half> %dummy, <vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zdn3, <vscale x 8 x half> %zdn4, <vscale x 8 x half> %zm1, <vscale x 8 x half> %zm2, <vscale x 8 x half> %zm3, <vscale x 8 x half> %zm4) {1069; CHECK-LABEL: multi_vec_maxnm_x4_f16:1070; CHECK: // %bb.0:1071; CHECK-NEXT: mov z30.d, z7.d1072; CHECK-NEXT: mov z27.d, z4.d1073; CHECK-NEXT: mov z29.d, z6.d1074; CHECK-NEXT: mov z26.d, z3.d1075; CHECK-NEXT: mov z28.d, z5.d1076; CHECK-NEXT: mov z25.d, z2.d1077; CHECK-NEXT: ldr z31, [x0]1078; CHECK-NEXT: mov z24.d, z1.d1079; CHECK-NEXT: fmaxnm { z24.h - z27.h }, { z24.h - z27.h }, { z28.h - z31.h }1080; CHECK-NEXT: mov z0.d, z24.d1081; CHECK-NEXT: mov z1.d, z25.d1082; CHECK-NEXT: mov z2.d, z26.d1083; CHECK-NEXT: mov z3.d, z27.d1084; CHECK-NEXT: ret1085 %res = call { <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half> }1086 @llvm.aarch64.sve.fmaxnm.x4.nxv8f16(<vscale x 8 x half> %zdn1, <vscale x 8 x half> %zdn2, <vscale x 8 x half> %zdn3, <vscale x 8 x half> %zdn4,1087 <vscale x 8 x half> %zm1, <vscale x 8 x half> %zm2, <vscale x 8 x half> %zm3, <vscale x 8 x half> %zm4)1088 ret { <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half> } %res1089}1090 1091define { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> } @multi_vec_maxnm_x4_f32(<vscale x 8 x half> %dummy, <vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zdn3, <vscale x 4 x float> %zdn4, <vscale x 4 x float> %zm1, <vscale x 4 x float> %zm2, <vscale x 4 x float> %zm3, <vscale x 4 x float> %zm4) {1092; CHECK-LABEL: multi_vec_maxnm_x4_f32:1093; CHECK: // %bb.0:1094; CHECK-NEXT: mov z30.d, z7.d1095; CHECK-NEXT: mov z27.d, z4.d1096; CHECK-NEXT: mov z29.d, z6.d1097; CHECK-NEXT: mov z26.d, z3.d1098; CHECK-NEXT: mov z28.d, z5.d1099; CHECK-NEXT: mov z25.d, z2.d1100; CHECK-NEXT: ldr z31, [x0]1101; CHECK-NEXT: mov z24.d, z1.d1102; CHECK-NEXT: fmaxnm { z24.s - z27.s }, { z24.s - z27.s }, { z28.s - z31.s }1103; CHECK-NEXT: mov z0.d, z24.d1104; CHECK-NEXT: mov z1.d, z25.d1105; CHECK-NEXT: mov z2.d, z26.d1106; CHECK-NEXT: mov z3.d, z27.d1107; CHECK-NEXT: ret1108 %res = call { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> }1109 @llvm.aarch64.sve.fmaxnm.x4.nxv4f32(<vscale x 4 x float> %zdn1, <vscale x 4 x float> %zdn2, <vscale x 4 x float> %zdn3, <vscale x 4 x float> %zdn4,1110 <vscale x 4 x float> %zm1, <vscale x 4 x float> %zm2, <vscale x 4 x float> %zm3, <vscale x 4 x float> %zm4)1111 ret { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> } %res1112}1113 1114define { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> } @multi_vec_maxnm_x4_f64(<vscale x 8 x half> %dummy, <vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zdn3, <vscale x 2 x double> %zdn4, <vscale x 2 x double> %zm1, <vscale x 2 x double> %zm2, <vscale x 2 x double> %zm3, <vscale x 2 x double> %zm4) {1115; CHECK-LABEL: multi_vec_maxnm_x4_f64:1116; CHECK: // %bb.0:1117; CHECK-NEXT: mov z30.d, z7.d1118; CHECK-NEXT: mov z27.d, z4.d1119; CHECK-NEXT: mov z29.d, z6.d1120; CHECK-NEXT: mov z26.d, z3.d1121; CHECK-NEXT: mov z28.d, z5.d1122; CHECK-NEXT: mov z25.d, z2.d1123; CHECK-NEXT: ldr z31, [x0]1124; CHECK-NEXT: mov z24.d, z1.d1125; CHECK-NEXT: fmaxnm { z24.d - z27.d }, { z24.d - z27.d }, { z28.d - z31.d }1126; CHECK-NEXT: mov z0.d, z24.d1127; CHECK-NEXT: mov z1.d, z25.d1128; CHECK-NEXT: mov z2.d, z26.d1129; CHECK-NEXT: mov z3.d, z27.d1130; CHECK-NEXT: ret1131 %res = call { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> }1132 @llvm.aarch64.sve.fmaxnm.x4.nxv2f64(<vscale x 2 x double> %zdn1, <vscale x 2 x double> %zdn2, <vscale x 2 x double> %zdn3, <vscale x 2 x double> %zdn4,1133 <vscale x 2 x double> %zm1, <vscale x 2 x double> %zm2, <vscale x 2 x double> %zm3, <vscale x 2 x double> %zm4)1134 ret { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> } %res1135}1136 1137declare { <vscale x 16 x i8>, <vscale x 16 x i8> } @llvm.aarch64.sve.smax.single.x2.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>)1138declare { <vscale x 8 x i16>, <vscale x 8 x i16> } @llvm.aarch64.sve.smax.single.x2.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>)1139declare { <vscale x 4 x i32>, <vscale x 4 x i32> } @llvm.aarch64.sve.smax.single.x2.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>)1140declare { <vscale x 2 x i64>, <vscale x 2 x i64> } @llvm.aarch64.sve.smax.single.x2.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>)1141 1142declare { <vscale x 16 x i8>, <vscale x 16 x i8> } @llvm.aarch64.sve.umax.single.x2.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>)1143declare { <vscale x 8 x i16>, <vscale x 8 x i16> } @llvm.aarch64.sve.umax.single.x2.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>)1144declare { <vscale x 4 x i32>, <vscale x 4 x i32> } @llvm.aarch64.sve.umax.single.x2.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>)1145declare { <vscale x 2 x i64>, <vscale x 2 x i64> } @llvm.aarch64.sve.umax.single.x2.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>)1146 1147declare { <vscale x 8 x half>, <vscale x 8 x half> } @llvm.aarch64.sve.fmax.single.x2.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>)1148declare { <vscale x 4 x float>, <vscale x 4 x float> } @llvm.aarch64.sve.fmax.single.x2.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>)1149declare { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.aarch64.sve.fmax.single.x2.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>)1150 1151declare { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> } @llvm.aarch64.sve.smax.single.x4.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>)1152declare { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> } @llvm.aarch64.sve.smax.single.x4.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>)1153declare { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> } @llvm.aarch64.sve.smax.single.x4.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>)1154declare { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> } @llvm.aarch64.sve.smax.single.x4.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>)1155 1156declare { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> } @llvm.aarch64.sve.umax.single.x4.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>)1157declare { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> } @llvm.aarch64.sve.umax.single.x4.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>)1158declare { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> } @llvm.aarch64.sve.umax.single.x4.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>)1159declare { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> } @llvm.aarch64.sve.umax.single.x4.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>)1160 1161declare { <vscale x 8 x half>, <vscale x 8 x half> , <vscale x 8 x half>, <vscale x 8 x half> }1162 @llvm.aarch64.sve.fmax.single.x4.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>)1163declare { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> }1164 @llvm.aarch64.sve.fmax.single.x4.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>)1165declare { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> }1166 @llvm.aarch64.sve.fmax.single.x4.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>)1167 1168declare { <vscale x 16 x i8>, <vscale x 16 x i8> } @llvm.aarch64.sve.smax.x2.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>)1169declare { <vscale x 8 x i16>, <vscale x 8 x i16> } @llvm.aarch64.sve.smax.x2.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> )1170declare { <vscale x 4 x i32>, <vscale x 4 x i32> } @llvm.aarch64.sve.smax.x2.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>)1171declare { <vscale x 2 x i64>, <vscale x 2 x i64> } @llvm.aarch64.sve.smax.x2.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>)1172 1173declare { <vscale x 16 x i8>, <vscale x 16 x i8> } @llvm.aarch64.sve.umax.x2.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>)1174declare { <vscale x 8 x i16>, <vscale x 8 x i16> } @llvm.aarch64.sve.umax.x2.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> )1175declare { <vscale x 4 x i32>, <vscale x 4 x i32> } @llvm.aarch64.sve.umax.x2.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>)1176declare { <vscale x 2 x i64>, <vscale x 2 x i64> } @llvm.aarch64.sve.umax.x2.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>)1177 1178declare { <vscale x 8 x half>, <vscale x 8 x half> } @llvm.aarch64.sve.fmax.x2.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>)1179declare { <vscale x 4 x float>, <vscale x 4 x float> } @llvm.aarch64.sve.fmax.x2.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>)1180declare { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.aarch64.sve.fmax.x2.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>)1181 1182declare { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> }1183 @llvm.aarch64.sve.smax.x4.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>)1184declare { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> }1185 @llvm.aarch64.sve.smax.x4.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>)1186declare { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> }1187 @llvm.aarch64.sve.smax.x4.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>)1188declare { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> }1189 @llvm.aarch64.sve.smax.x4.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>)1190 1191declare { <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8> }1192 @llvm.aarch64.sve.umax.x4.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i8>)1193declare { <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16> }1194 @llvm.aarch64.sve.umax.x4.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i16>)1195declare { <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32> }1196 @llvm.aarch64.sve.umax.x4.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i32>)1197declare { <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64> }1198 @llvm.aarch64.sve.umax.x4.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i64>)1199 1200declare { <vscale x 8 x half>, <vscale x 8 x half> , <vscale x 8 x half>, <vscale x 8 x half> }1201 @llvm.aarch64.sve.fmax.x4.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>)1202declare { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> }1203 @llvm.aarch64.sve.fmax.x4.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>)1204declare { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> }1205 @llvm.aarch64.sve.fmax.x4.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>)1206 1207declare { <vscale x 8 x half>, <vscale x 8 x half> } @llvm.aarch64.sve.fmaxnm.single.x2.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>)1208declare { <vscale x 4 x float>, <vscale x 4 x float> } @llvm.aarch64.sve.fmaxnm.single.x2.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>)1209declare { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.aarch64.sve.fmaxnm.single.x2.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>)1210 1211declare { <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half> }1212 @llvm.aarch64.sve.fmaxnm.single.x4.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>)1213declare { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> }1214 @llvm.aarch64.sve.fmaxnm.single.x4.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>)1215declare { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> }1216 @llvm.aarch64.sve.fmaxnm.single.x4.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>)1217 1218declare { <vscale x 8 x half>, <vscale x 8 x half> } @llvm.aarch64.sve.fmaxnm.x2.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>)1219declare { <vscale x 4 x float>, <vscale x 4 x float> } @llvm.aarch64.sve.fmaxnm.x2.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>)1220declare { <vscale x 2 x double>, <vscale x 2 x double> } @llvm.aarch64.sve.fmaxnm.x2.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>)1221 1222declare { <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half> }1223 @llvm.aarch64.sve.fmaxnm.x4.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>)1224declare { <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float> }1225 @llvm.aarch64.sve.fmaxnm.x4.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>)1226declare { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> }1227 @llvm.aarch64.sve.fmaxnm.x4.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>)1228