|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6 |
| 2 | + |
| 3 | +; RUN: llc < %s -mtriple=wasm32-unknown-unknown -mattr=+simd128,+relaxed-simd | FileCheck %s |
| 4 | + |
| 5 | +; Test that fminimum and fmaximum get transformed to relaxed_min and relaxed_max |
| 6 | + |
| 7 | +target triple = "wasm32" |
| 8 | + |
| 9 | +define <4 x float> @test_max_f32x4(<4 x float> %a, <4 x float> %b) { |
| 10 | +; CHECK-LABEL: test_max_f32x4: |
| 11 | +; CHECK: .functype test_max_f32x4 (v128, v128) -> (v128) |
| 12 | +; CHECK-NEXT: # %bb.0: |
| 13 | +; CHECK-NEXT: local.get 0 |
| 14 | +; CHECK-NEXT: local.get 1 |
| 15 | +; CHECK-NEXT: f32x4.max |
| 16 | +; CHECK-NEXT: # fallthrough-return |
| 17 | + %result = call <4 x float> @llvm.maximum.v4f32(<4 x float> %a, <4 x float> %b) |
| 18 | + ret <4 x float> %result |
| 19 | +} |
| 20 | + |
| 21 | + |
| 22 | +define <2 x double> @test_max_f64x2(<2 x double> %a, <2 x double> %b) { |
| 23 | +; CHECK-LABEL: test_max_f64x2: |
| 24 | +; CHECK: .functype test_max_f64x2 (v128, v128) -> (v128) |
| 25 | +; CHECK-NEXT: # %bb.0: |
| 26 | +; CHECK-NEXT: local.get 0 |
| 27 | +; CHECK-NEXT: local.get 1 |
| 28 | +; CHECK-NEXT: f64x2.max |
| 29 | +; CHECK-NEXT: # fallthrough-return |
| 30 | + %result = call <2 x double> @llvm.maximum.v2f64(<2 x double> %a, <2 x double> %b) |
| 31 | + ret <2 x double> %result |
| 32 | +} |
| 33 | + |
| 34 | +declare <4 x float> @llvm.maximum.v4f32(<4 x float>, <4 x float>) |
| 35 | +declare <2 x double> @llvm.maximum.v2f64(<2 x double>, <2 x double>) |
0 commit comments