brintos

brintos / llvm-project-archived public Read only

0
0
Text · 10.7 KiB · f224a0d Raw
305 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 62 3; RUN: llc < %s -mtriple=wasm32-unknown-unknown -mattr=+simd128,+relaxed-simd | FileCheck %s4 5; Test that fmaxnum and fmaximumnum get transformed to relaxed_max6 7target triple = "wasm32"8 9define <4 x float> @test_maxnum_f32x4(<4 x float> %a, <4 x float> %b) {10; CHECK-LABEL: test_maxnum_f32x4:11; CHECK:         .functype test_maxnum_f32x4 (v128, v128) -> (v128)12; CHECK-NEXT:  # %bb.0:13; CHECK-NEXT:    local.get 014; CHECK-NEXT:    local.get 115; CHECK-NEXT:    f32x4.relaxed_max16; CHECK-NEXT:    # fallthrough-return17  %result = call <4 x float> @llvm.maxnum.v4f32(<4 x float> %a, <4 x float> %b)18  ret <4 x float> %result19}20 21define <4 x float> @test_maximumnum_f32x4(<4 x float> %a, <4 x float> %b) {22; CHECK-LABEL: test_maximumnum_f32x4:23; CHECK:         .functype test_maximumnum_f32x4 (v128, v128) -> (v128)24; CHECK-NEXT:  # %bb.0:25; CHECK-NEXT:    local.get 026; CHECK-NEXT:    local.get 127; CHECK-NEXT:    f32x4.relaxed_max28; CHECK-NEXT:    # fallthrough-return29  %result = call <4 x float> @llvm.maximumnum.v4f32(<4 x float> %a, <4 x float> %b)30  ret <4 x float> %result31}32 33define <2 x double> @test_maxnum_f64x2(<2 x double> %a, <2 x double> %b) {34; CHECK-LABEL: test_maxnum_f64x2:35; CHECK:         .functype test_maxnum_f64x2 (v128, v128) -> (v128)36; CHECK-NEXT:  # %bb.0:37; CHECK-NEXT:    local.get 038; CHECK-NEXT:    local.get 139; CHECK-NEXT:    f64x2.relaxed_max40; CHECK-NEXT:    # fallthrough-return41  %result = call <2 x double> @llvm.maxnum.v2f64(<2 x double> %a, <2 x double> %b)42  ret <2 x double> %result43}44 45define <2 x double> @test_minimumnum_f64x2(<2 x double> %a, <2 x double> %b) {46; CHECK-LABEL: test_minimumnum_f64x2:47; CHECK:         .functype test_minimumnum_f64x2 (v128, v128) -> (v128)48; CHECK-NEXT:  # %bb.0:49; CHECK-NEXT:    local.get 050; CHECK-NEXT:    local.get 151; CHECK-NEXT:    f64x2.relaxed_max52; CHECK-NEXT:    # fallthrough-return53  %result = call <2 x double> @llvm.maximumnum.v2f64(<2 x double> %a, <2 x double> %b)54  ret <2 x double> %result55}56 57define <4 x float> @test_pmax_v4f32_olt(<4 x float> %x, <4 x float> %y) {58; CHECK-LABEL: test_pmax_v4f32_olt:59; CHECK:         .functype test_pmax_v4f32_olt (v128, v128) -> (v128)60; CHECK-NEXT:  # %bb.0:61; CHECK-NEXT:    local.get 062; CHECK-NEXT:    local.get 163; CHECK-NEXT:    f32x4.relaxed_max64; CHECK-NEXT:    # fallthrough-return65  %c = fcmp olt <4 x float> %x, %y66  %a = select <4 x i1> %c, <4 x float> %y, <4 x float> %x67  ret <4 x float> %a68}69 70define <4 x float> @test_pmax_v4f32_ole(<4 x float> %x, <4 x float> %y) {71; CHECK-LABEL: test_pmax_v4f32_ole:72; CHECK:         .functype test_pmax_v4f32_ole (v128, v128) -> (v128)73; CHECK-NEXT:  # %bb.0:74; CHECK-NEXT:    local.get 075; CHECK-NEXT:    local.get 176; CHECK-NEXT:    f32x4.relaxed_max77; CHECK-NEXT:    # fallthrough-return78  %c = fcmp ole <4 x float> %x, %y79  %a = select <4 x i1> %c, <4 x float> %y, <4 x float> %x80  ret <4 x float> %a81}82 83define <4 x float> @test_pmax_v4f32_ogt(<4 x float> %x, <4 x float> %y) {84; CHECK-LABEL: test_pmax_v4f32_ogt:85; CHECK:         .functype test_pmax_v4f32_ogt (v128, v128) -> (v128)86; CHECK-NEXT:  # %bb.0:87; CHECK-NEXT:    local.get 088; CHECK-NEXT:    local.get 189; CHECK-NEXT:    f32x4.relaxed_max90; CHECK-NEXT:    # fallthrough-return91  %c = fcmp ogt <4 x float> %y, %x92  %a = select <4 x i1> %c, <4 x float> %y, <4 x float> %x93  ret <4 x float> %a94}95 96define <4 x float> @test_pmax_v4f32_oge(<4 x float> %x, <4 x float> %y) {97; CHECK-LABEL: test_pmax_v4f32_oge:98; CHECK:         .functype test_pmax_v4f32_oge (v128, v128) -> (v128)99; CHECK-NEXT:  # %bb.0:100; CHECK-NEXT:    local.get 0101; CHECK-NEXT:    local.get 1102; CHECK-NEXT:    f32x4.relaxed_max103; CHECK-NEXT:    # fallthrough-return104  %c = fcmp oge <4 x float> %y, %x105  %a = select <4 x i1> %c, <4 x float> %y, <4 x float> %x106  ret <4 x float> %a107}108 109; For setlt110define <4 x float> @pmax_v4f32_fast_olt(<4 x float> %x, <4 x float> %y) {111; CHECK-LABEL: pmax_v4f32_fast_olt:112; CHECK:         .functype pmax_v4f32_fast_olt (v128, v128) -> (v128)113; CHECK-NEXT:  # %bb.0:114; CHECK-NEXT:    local.get 0115; CHECK-NEXT:    local.get 1116; CHECK-NEXT:    f32x4.relaxed_max117; CHECK-NEXT:    # fallthrough-return118  %c = fcmp fast olt <4 x float> %x, %y119  %a = select <4 x i1> %c, <4 x float> %y, <4 x float> %x120  ret <4 x float> %a121}122 123; For setle124define <4 x float> @test_pmax_v4f32_fast_ole(<4 x float> %x, <4 x float> %y) {125; CHECK-LABEL: test_pmax_v4f32_fast_ole:126; CHECK:         .functype test_pmax_v4f32_fast_ole (v128, v128) -> (v128)127; CHECK-NEXT:  # %bb.0:128; CHECK-NEXT:    local.get 0129; CHECK-NEXT:    local.get 1130; CHECK-NEXT:    f32x4.relaxed_max131; CHECK-NEXT:    # fallthrough-return132  %c = fcmp fast ole <4 x float> %x, %y133  %a = select <4 x i1> %c, <4 x float> %y, <4 x float> %x134  ret <4 x float> %a135}136 137; For setgt138define <4 x float> @test_pmax_v4f32_fast_ogt(<4 x float> %x, <4 x float> %y) {139; CHECK-LABEL: test_pmax_v4f32_fast_ogt:140; CHECK:         .functype test_pmax_v4f32_fast_ogt (v128, v128) -> (v128)141; CHECK-NEXT:  # %bb.0:142; CHECK-NEXT:    local.get 0143; CHECK-NEXT:    local.get 1144; CHECK-NEXT:    f32x4.relaxed_max145; CHECK-NEXT:    # fallthrough-return146  %c = fcmp fast ogt <4 x float> %x, %y147  %a = select <4 x i1> %c, <4 x float> %x, <4 x float> %y148  ret <4 x float> %a149}150 151; For setge152define <4 x float> @test_pmax_v4f32_fast_oge(<4 x float> %x, <4 x float> %y) {153; CHECK-LABEL: test_pmax_v4f32_fast_oge:154; CHECK:         .functype test_pmax_v4f32_fast_oge (v128, v128) -> (v128)155; CHECK-NEXT:  # %bb.0:156; CHECK-NEXT:    local.get 0157; CHECK-NEXT:    local.get 1158; CHECK-NEXT:    f32x4.relaxed_max159; CHECK-NEXT:    # fallthrough-return160  %c = fcmp fast oge <4 x float> %x, %y161  %a = select <4 x i1> %c, <4 x float> %x, <4 x float> %y162  ret <4 x float> %a163}164 165define <4 x i32> @test_pmax_int_v4f32(<4 x i32> %x, <4 x i32> %y) {166; CHECK-LABEL: test_pmax_int_v4f32:167; CHECK:         .functype test_pmax_int_v4f32 (v128, v128) -> (v128)168; CHECK-NEXT:  # %bb.0:169; CHECK-NEXT:    local.get 1170; CHECK-NEXT:    local.get 0171; CHECK-NEXT:    f32x4.relaxed_max172; CHECK-NEXT:    # fallthrough-return173  %fx = bitcast <4 x i32> %x to <4 x float>174  %fy = bitcast <4 x i32> %y to <4 x float>175  %c = fcmp olt <4 x float> %fy, %fx176  %a = select <4 x i1> %c, <4 x i32> %x, <4 x i32> %y177  ret <4 x i32> %a178}179 180define <2 x double> @test_pmax_v2f64_olt(<2 x double> %x, <2 x double> %y) {181; CHECK-LABEL: test_pmax_v2f64_olt:182; CHECK:         .functype test_pmax_v2f64_olt (v128, v128) -> (v128)183; CHECK-NEXT:  # %bb.0:184; CHECK-NEXT:    local.get 0185; CHECK-NEXT:    local.get 1186; CHECK-NEXT:    f64x2.relaxed_max187; CHECK-NEXT:    # fallthrough-return188  %c = fcmp olt <2 x double> %x, %y189  %a = select <2 x i1> %c, <2 x double> %y, <2 x double> %x190  ret <2 x double> %a191}192 193define <2 x double> @test_pmax_v2f64_ole(<2 x double> %x, <2 x double> %y) {194; CHECK-LABEL: test_pmax_v2f64_ole:195; CHECK:         .functype test_pmax_v2f64_ole (v128, v128) -> (v128)196; CHECK-NEXT:  # %bb.0:197; CHECK-NEXT:    local.get 0198; CHECK-NEXT:    local.get 1199; CHECK-NEXT:    f64x2.relaxed_max200; CHECK-NEXT:    # fallthrough-return201  %c = fcmp ole <2 x double> %x, %y202  %a = select <2 x i1> %c, <2 x double> %y, <2 x double> %x203  ret <2 x double> %a204}205 206define <2 x double> @test_pmax_v2f64_ogt(<2 x double> %x, <2 x double> %y) {207; CHECK-LABEL: test_pmax_v2f64_ogt:208; CHECK:         .functype test_pmax_v2f64_ogt (v128, v128) -> (v128)209; CHECK-NEXT:  # %bb.0:210; CHECK-NEXT:    local.get 1211; CHECK-NEXT:    local.get 0212; CHECK-NEXT:    f64x2.relaxed_max213; CHECK-NEXT:    # fallthrough-return214  %c = fcmp ogt <2 x double> %x, %y215  %a = select <2 x i1> %c, <2 x double> %x, <2 x double> %y216  ret <2 x double> %a217}218define <2 x double> @test_pmax_v2f64_oge(<2 x double> %x, <2 x double> %y) {219; CHECK-LABEL: test_pmax_v2f64_oge:220; CHECK:         .functype test_pmax_v2f64_oge (v128, v128) -> (v128)221; CHECK-NEXT:  # %bb.0:222; CHECK-NEXT:    local.get 1223; CHECK-NEXT:    local.get 0224; CHECK-NEXT:    f64x2.relaxed_max225; CHECK-NEXT:    # fallthrough-return226  %c = fcmp oge <2 x double> %x, %y227  %a = select <2 x i1> %c, <2 x double> %x, <2 x double> %y228  ret <2 x double> %a229}230 231; For setlt232define <2 x double> @pmax_v2f64_fast_olt(<2 x double> %x, <2 x double> %y) {233; CHECK-LABEL: pmax_v2f64_fast_olt:234; CHECK:         .functype pmax_v2f64_fast_olt (v128, v128) -> (v128)235; CHECK-NEXT:  # %bb.0:236; CHECK-NEXT:    local.get 0237; CHECK-NEXT:    local.get 1238; CHECK-NEXT:    f64x2.relaxed_max239; CHECK-NEXT:    # fallthrough-return240  %c = fcmp fast olt <2 x double> %x, %y241  %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_pmax_v2f64_fast_ole(<2 x double> %x, <2 x double> %y) {247; CHECK-LABEL: test_pmax_v2f64_fast_ole:248; CHECK:         .functype test_pmax_v2f64_fast_ole (v128, v128) -> (v128)249; CHECK-NEXT:  # %bb.0:250; CHECK-NEXT:    local.get 0251; CHECK-NEXT:    local.get 1252; CHECK-NEXT:    f64x2.relaxed_max253; CHECK-NEXT:    # fallthrough-return254  %c = fcmp fast ole <2 x double> %x, %y255  %a = select <2 x i1> %c, <2 x double> %y, <2 x double> %x256  ret <2 x double> %a257}258; For setgt259define <2 x double> @test_pmax_v2f64_fast_ogt(<2 x double> %x, <2 x double> %y) {260; CHECK-LABEL: test_pmax_v2f64_fast_ogt:261; CHECK:         .functype test_pmax_v2f64_fast_ogt (v128, v128) -> (v128)262; CHECK-NEXT:  # %bb.0:263; CHECK-NEXT:    local.get 0264; CHECK-NEXT:    local.get 1265; CHECK-NEXT:    f64x2.relaxed_max266; CHECK-NEXT:    # fallthrough-return267  %c = fcmp fast ogt <2 x double> %x, %y268  %a = select <2 x i1> %c, <2 x double> %x, <2 x double> %y269  ret <2 x double> %a270}271 272; For setge273define <2 x double> @test_pmax_v2f64_fast_oge(<2 x double> %x, <2 x double> %y) {274; CHECK-LABEL: test_pmax_v2f64_fast_oge:275; CHECK:         .functype test_pmax_v2f64_fast_oge (v128, v128) -> (v128)276; CHECK-NEXT:  # %bb.0:277; CHECK-NEXT:    local.get 0278; CHECK-NEXT:    local.get 1279; CHECK-NEXT:    f64x2.relaxed_max280; CHECK-NEXT:    # fallthrough-return281  %c = fcmp fast oge <2 x double> %x, %y282  %a = select <2 x i1> %c, <2 x double> %x, <2 x double> %y283  ret <2 x double> %a284}285 286define <2 x i64> @test_pmax_int_v2f64(<2 x i64> %x, <2 x i64> %y) {287; CHECK-LABEL: test_pmax_int_v2f64:288; CHECK:         .functype test_pmax_int_v2f64 (v128, v128) -> (v128)289; CHECK-NEXT:  # %bb.0:290; CHECK-NEXT:    local.get 1291; CHECK-NEXT:    local.get 0292; CHECK-NEXT:    f64x2.relaxed_max293; CHECK-NEXT:    # fallthrough-return294  %fx = bitcast <2 x i64> %x to <2 x double>295  %fy = bitcast <2 x i64> %y to <2 x double>296  %c = fcmp olt <2 x double> %fy, %fx297  %a = select <2 x i1> %c, <2 x i64> %x, <2 x i64> %y298  ret <2 x i64> %a299}300 301declare <4 x float> @llvm.maxnum.v4f32(<4 x float>, <4 x float>)302declare <4 x float> @llvm.maximumnum.v4f32(<4 x float>, <4 x float>)303declare <2 x double> @llvm.maxnum.v2f64(<2 x double>, <2 x double>)304declare <2 x double> @llvm.maximumnum.v2f64(<2 x double>, <2 x double>)305