brintos

brintos / llvm-project-archived public Read only

0
0
Text · 10.7 KiB · 4604465 Raw
306 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 62; RUN: llc < %s -mtriple=wasm32-unknown-unknown -mattr=+simd128,+relaxed-simd | FileCheck %s3 4; Test that fminnum and fminimumnum get transformed to relaxed_min5 6target triple = "wasm32"7 8define <4 x float> @test_minnum_f32x4(<4 x float> %a, <4 x float> %b) {9; CHECK-LABEL: test_minnum_f32x4:10; CHECK:         .functype test_minnum_f32x4 (v128, v128) -> (v128)11; CHECK-NEXT:  # %bb.0:12; CHECK-NEXT:    local.get 013; CHECK-NEXT:    local.get 114; CHECK-NEXT:    f32x4.relaxed_min15; CHECK-NEXT:    # fallthrough-return16  %result = call <4 x float> @llvm.minnum.v4f32(<4 x float> %a, <4 x float> %b)17  ret <4 x float> %result18}19 20define <4 x float> @test_minimumnum_f32x4(<4 x float> %a, <4 x float> %b) {21; CHECK-LABEL: test_minimumnum_f32x4:22; CHECK:         .functype test_minimumnum_f32x4 (v128, v128) -> (v128)23; CHECK-NEXT:  # %bb.0:24; CHECK-NEXT:    local.get 025; CHECK-NEXT:    local.get 126; CHECK-NEXT:    f32x4.relaxed_min27; CHECK-NEXT:    # fallthrough-return28  %result = call <4 x float> @llvm.minimumnum.v4f32(<4 x float> %a, <4 x float> %b)29  ret <4 x float> %result30}31 32define <2 x double> @test_minnum_f64x2(<2 x double> %a, <2 x double> %b) {33; CHECK-LABEL: test_minnum_f64x2:34; CHECK:         .functype test_minnum_f64x2 (v128, v128) -> (v128)35; CHECK-NEXT:  # %bb.0:36; CHECK-NEXT:    local.get 037; CHECK-NEXT:    local.get 138; CHECK-NEXT:    f64x2.relaxed_min39; CHECK-NEXT:    # fallthrough-return40  %result = call <2 x double> @llvm.minnum.v2f64(<2 x double> %a, <2 x double> %b)41  ret <2 x double> %result42}43 44define <2 x double> @test_minimumnum_f64x2(<2 x double> %a, <2 x double> %b) {45; CHECK-LABEL: test_minimumnum_f64x2:46; CHECK:         .functype test_minimumnum_f64x2 (v128, v128) -> (v128)47; CHECK-NEXT:  # %bb.0:48; CHECK-NEXT:    local.get 049; CHECK-NEXT:    local.get 150; CHECK-NEXT:    f64x2.relaxed_min51; CHECK-NEXT:    # fallthrough-return52  %result = call <2 x double> @llvm.minimumnum.v2f64(<2 x double> %a, <2 x double> %b)53  ret <2 x double> %result54}55 56define <4 x float> @test_pmin_v4f32_olt(<4 x float> %x, <4 x float> %y) {57; CHECK-LABEL: test_pmin_v4f32_olt:58; CHECK:         .functype test_pmin_v4f32_olt (v128, v128) -> (v128)59; CHECK-NEXT:  # %bb.0:60; CHECK-NEXT:    local.get 061; CHECK-NEXT:    local.get 162; CHECK-NEXT:    f32x4.relaxed_min63; CHECK-NEXT:    # fallthrough-return64  %c = fcmp olt <4 x float> %y, %x65  %a = select <4 x i1> %c, <4 x float> %y, <4 x float> %x66  ret <4 x float> %a67}68 69define <4 x float> @test_pmin_v4f32_ole(<4 x float> %x, <4 x float> %y) {70; CHECK-LABEL: test_pmin_v4f32_ole:71; CHECK:         .functype test_pmin_v4f32_ole (v128, v128) -> (v128)72; CHECK-NEXT:  # %bb.0:73; CHECK-NEXT:    local.get 074; CHECK-NEXT:    local.get 175; CHECK-NEXT:    f32x4.relaxed_min76; CHECK-NEXT:    # fallthrough-return77  %c = fcmp ole <4 x float> %y, %x78  %a = select <4 x i1> %c, <4 x float> %y, <4 x float> %x79  ret <4 x float> %a80}81 82define <4 x float> @test_pmin_v4f32_ogt(<4 x float> %x, <4 x float> %y) {83; CHECK-LABEL: test_pmin_v4f32_ogt:84; CHECK:         .functype test_pmin_v4f32_ogt (v128, v128) -> (v128)85; CHECK-NEXT:  # %bb.0:86; CHECK-NEXT:    local.get 087; CHECK-NEXT:    local.get 188; CHECK-NEXT:    f32x4.relaxed_min89; CHECK-NEXT:    # fallthrough-return90  %c = fcmp ogt <4 x float> %x, %y91  %a = select <4 x i1> %c, <4 x float> %y, <4 x float> %x92  ret <4 x float> %a93}94 95define <4 x float> @test_pmin_v4f32_oge(<4 x float> %x, <4 x float> %y) {96; CHECK-LABEL: test_pmin_v4f32_oge:97; CHECK:         .functype test_pmin_v4f32_oge (v128, v128) -> (v128)98; CHECK-NEXT:  # %bb.0:99; CHECK-NEXT:    local.get 0100; CHECK-NEXT:    local.get 1101; CHECK-NEXT:    f32x4.relaxed_min102; CHECK-NEXT:    # fallthrough-return103  %c = fcmp oge <4 x float> %x, %y104  %a = select <4 x i1> %c, <4 x float> %y, <4 x float> %x105  ret <4 x float> %a106}107 108; For setlt109define <4 x float> @pmin_v4f32_fast_olt(<4 x float> %x, <4 x float> %y) {110; CHECK-LABEL: pmin_v4f32_fast_olt:111; CHECK:         .functype pmin_v4f32_fast_olt (v128, v128) -> (v128)112; CHECK-NEXT:  # %bb.0:113; CHECK-NEXT:    local.get 1114; CHECK-NEXT:    local.get 0115; CHECK-NEXT:    f32x4.relaxed_min116; CHECK-NEXT:    # fallthrough-return117  %c = fcmp fast olt <4 x float> %y, %x118  %a = select <4 x i1> %c, <4 x float> %y, <4 x float> %x119  ret <4 x float> %a120}121 122; For setle123define <4 x float> @test_pmin_v4f32_fast_ole(<4 x float> %x, <4 x float> %y) {124; CHECK-LABEL: test_pmin_v4f32_fast_ole:125; CHECK:         .functype test_pmin_v4f32_fast_ole (v128, v128) -> (v128)126; CHECK-NEXT:  # %bb.0:127; CHECK-NEXT:    local.get 1128; CHECK-NEXT:    local.get 0129; CHECK-NEXT:    f32x4.relaxed_min130; CHECK-NEXT:    # fallthrough-return131  %c = fcmp fast ole <4 x float> %y, %x132  %a = select <4 x i1> %c, <4 x float> %y, <4 x float> %x133  ret <4 x float> %a134}135 136; For setgt137define <4 x float> @test_pmin_v4f32_fast_ogt(<4 x float> %x, <4 x float> %y) {138; CHECK-LABEL: test_pmin_v4f32_fast_ogt:139; CHECK:         .functype test_pmin_v4f32_fast_ogt (v128, v128) -> (v128)140; CHECK-NEXT:  # %bb.0:141; CHECK-NEXT:    local.get 0142; CHECK-NEXT:    local.get 1143; CHECK-NEXT:    f32x4.relaxed_min144; CHECK-NEXT:    # fallthrough-return145  %c = fcmp fast ogt <4 x float> %x, %y146  %a = select <4 x i1> %c, <4 x float> %y, <4 x float> %x147  ret <4 x float> %a148}149 150; For setge151define <4 x float> @test_pmin_v4f32_fast_oge(<4 x float> %x, <4 x float> %y) {152; CHECK-LABEL: test_pmin_v4f32_fast_oge:153; CHECK:         .functype test_pmin_v4f32_fast_oge (v128, v128) -> (v128)154; CHECK-NEXT:  # %bb.0:155; CHECK-NEXT:    local.get 0156; CHECK-NEXT:    local.get 1157; CHECK-NEXT:    f32x4.relaxed_min158; CHECK-NEXT:    # fallthrough-return159  %c = fcmp fast oge <4 x float> %x, %y160  %a = select <4 x i1> %c, <4 x float> %y, <4 x float> %x161  ret <4 x float> %a162}163 164define <4 x i32> @test_pmin_int_v4f32(<4 x i32> %x, <4 x i32> %y) {165; CHECK-LABEL: test_pmin_int_v4f32:166; CHECK:         .functype test_pmin_int_v4f32 (v128, v128) -> (v128)167; CHECK-NEXT:  # %bb.0:168; CHECK-NEXT:    local.get 0169; CHECK-NEXT:    local.get 1170; CHECK-NEXT:    f32x4.relaxed_min171; CHECK-NEXT:    # fallthrough-return172  %fx = bitcast <4 x i32> %x to <4 x float>173  %fy = bitcast <4 x i32> %y to <4 x float>174  %c = fcmp olt <4 x float> %fy, %fx175  %a = select <4 x i1> %c, <4 x i32> %y, <4 x i32> %x176  ret <4 x i32> %a177}178 179define <2 x double> @test_pmin_v2f64_olt(<2 x double> %x, <2 x double> %y) {180; CHECK-LABEL: test_pmin_v2f64_olt:181; CHECK:         .functype test_pmin_v2f64_olt (v128, v128) -> (v128)182; CHECK-NEXT:  # %bb.0:183; CHECK-NEXT:    local.get 0184; CHECK-NEXT:    local.get 1185; CHECK-NEXT:    f64x2.relaxed_min186; CHECK-NEXT:    # fallthrough-return187  %c = fcmp olt <2 x double> %y, %x188  %a = select <2 x i1> %c, <2 x double> %y, <2 x double> %x189  ret <2 x double> %a190}191 192define <2 x double> @test_pmin_v2f64_ole(<2 x double> %x, <2 x double> %y) {193; CHECK-LABEL: test_pmin_v2f64_ole:194; CHECK:         .functype test_pmin_v2f64_ole (v128, v128) -> (v128)195; CHECK-NEXT:  # %bb.0:196; CHECK-NEXT:    local.get 0197; CHECK-NEXT:    local.get 1198; CHECK-NEXT:    f64x2.relaxed_min199; CHECK-NEXT:    # fallthrough-return200  %c = fcmp ole <2 x double> %y, %x201  %a = select <2 x i1> %c, <2 x double> %y, <2 x double> %x202  ret <2 x double> %a203}204 205define <2 x double> @test_pmin_v2f64_ogt(<2 x double> %x, <2 x double> %y) {206; CHECK-LABEL: test_pmin_v2f64_ogt:207; CHECK:         .functype test_pmin_v2f64_ogt (v128, v128) -> (v128)208; CHECK-NEXT:  # %bb.0:209; CHECK-NEXT:    local.get 0210; CHECK-NEXT:    local.get 1211; CHECK-NEXT:    f64x2.relaxed_min212; CHECK-NEXT:    # fallthrough-return213  %c = fcmp ogt <2 x double> %x, %y214  %a = select <2 x i1> %c, <2 x double> %y, <2 x double> %x215  ret <2 x double> %a216}217 218define <2 x double> @test_pmin_v2f64_oge(<2 x double> %x, <2 x double> %y) {219; CHECK-LABEL: test_pmin_v2f64_oge:220; CHECK:         .functype test_pmin_v2f64_oge (v128, v128) -> (v128)221; CHECK-NEXT:  # %bb.0:222; CHECK-NEXT:    local.get 0223; CHECK-NEXT:    local.get 1224; CHECK-NEXT:    f64x2.relaxed_min225; CHECK-NEXT:    # fallthrough-return226  %c = fcmp oge <2 x double> %x, %y227  %a = select <2 x i1> %c, <2 x double> %y, <2 x double> %x228  ret <2 x double> %a229}230 231; For setlt232define <2 x double> @pmin_v2f64_fast_olt(<2 x double> %x, <2 x double> %y) {233; CHECK-LABEL: pmin_v2f64_fast_olt:234; CHECK:         .functype pmin_v2f64_fast_olt (v128, v128) -> (v128)235; CHECK-NEXT:  # %bb.0:236; CHECK-NEXT:    local.get 1237; CHECK-NEXT:    local.get 0238; CHECK-NEXT:    f64x2.relaxed_min239; CHECK-NEXT:    # fallthrough-return240  %c = fcmp fast olt <2 x double> %y, %x241  %a = select <2 x i1> %c, <2 x double> %y, <2 x double> %x242  ret <2 x double> %a243}244 245; For setle246define <2 x double> @test_pmin_v2f64_fast_ole(<2 x double> %x, <2 x double> %y) {247; CHECK-LABEL: test_pmin_v2f64_fast_ole:248; CHECK:         .functype test_pmin_v2f64_fast_ole (v128, v128) -> (v128)249; CHECK-NEXT:  # %bb.0:250; CHECK-NEXT:    local.get 1251; CHECK-NEXT:    local.get 0252; CHECK-NEXT:    f64x2.relaxed_min253; CHECK-NEXT:    # fallthrough-return254  %c = fcmp fast ole <2 x double> %y, %x255  %a = select <2 x i1> %c, <2 x double> %y, <2 x double> %x256  ret <2 x double> %a257}258 259; For setgt260define <2 x double> @test_pmin_v2f64_fast_ogt(<2 x double> %x, <2 x double> %y) {261; CHECK-LABEL: test_pmin_v2f64_fast_ogt:262; CHECK:         .functype test_pmin_v2f64_fast_ogt (v128, v128) -> (v128)263; CHECK-NEXT:  # %bb.0:264; CHECK-NEXT:    local.get 0265; CHECK-NEXT:    local.get 1266; CHECK-NEXT:    f64x2.relaxed_min267; CHECK-NEXT:    # fallthrough-return268  %c = fcmp fast ogt <2 x double> %x, %y269  %a = select <2 x i1> %c, <2 x double> %y, <2 x double> %x270  ret <2 x double> %a271}272 273; For setge274define <2 x double> @test_pmin_v2f64_fast_oge(<2 x double> %x, <2 x double> %y) {275; CHECK-LABEL: test_pmin_v2f64_fast_oge:276; CHECK:         .functype test_pmin_v2f64_fast_oge (v128, v128) -> (v128)277; CHECK-NEXT:  # %bb.0:278; CHECK-NEXT:    local.get 0279; CHECK-NEXT:    local.get 1280; CHECK-NEXT:    f64x2.relaxed_min281; CHECK-NEXT:    # fallthrough-return282  %c = fcmp fast oge <2 x double> %x, %y283  %a = select <2 x i1> %c, <2 x double> %y, <2 x double> %x284  ret <2 x double> %a285}286 287define <2 x i64> @test_pmin_int_v2f64(<2 x i64> %x, <2 x i64> %y) {288; CHECK-LABEL: test_pmin_int_v2f64:289; CHECK:         .functype test_pmin_int_v2f64 (v128, v128) -> (v128)290; CHECK-NEXT:  # %bb.0:291; CHECK-NEXT:    local.get 0292; CHECK-NEXT:    local.get 1293; CHECK-NEXT:    f64x2.relaxed_min294; CHECK-NEXT:    # fallthrough-return295  %fx = bitcast <2 x i64> %x to <2 x double>296  %fy = bitcast <2 x i64> %y to <2 x double>297  %c = fcmp olt <2 x double> %fy, %fx298  %a = select <2 x i1> %c, <2 x i64> %y, <2 x i64> %x299  ret <2 x i64> %a300}301 302declare <4 x float> @llvm.minnum.v4f32(<4 x float>, <4 x float>)303declare <4 x float> @llvm.fminimumnum.v4f32(<4 x float>, <4 x float>)304declare <2 x double> @llvm.minnum.v2f64(<2 x double>, <2 x double>)305declare <2 x double> @llvm.fminimumnum.v2f64(<2 x double>, <2 x double>)306