brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 8ea7934 Raw
57 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=arm64-apple-ios | FileCheck %s3 4define <4 x float> @foo(<4 x float> %val, <4 x float> %test) nounwind {5; CHECK-LABEL: foo:6; CHECK:       ; %bb.0:7; CHECK-NEXT:    fmov.4s v2, #1.000000008; CHECK-NEXT:    fcmeq.4s v0, v0, v19; CHECK-NEXT:    and.16b v0, v0, v210; CHECK-NEXT:    ret11  %cmp = fcmp oeq <4 x float> %val, %test12  %ext = zext <4 x i1> %cmp to <4 x i32>13  %result = sitofp <4 x i32> %ext to <4 x float>14  ret <4 x float> %result15}16; Make sure the operation doesn't try to get folded when the sizes don't match,17; as that ends up crashing later when trying to form a bitcast operation for18; the folded nodes.19define void @foo1(<4 x float> %val, <4 x float> %test, ptr %p) nounwind {20; CHECK-LABEL: foo1:21; CHECK:       ; %bb.0:22; CHECK-NEXT:    movi.4s v2, #123; CHECK-NEXT:    fcmeq.4s v0, v0, v124; CHECK-NEXT:    and.16b v0, v0, v225; CHECK-NEXT:    ushll2.2d v1, v0, #026; CHECK-NEXT:    ushll.2d v0, v0, #027; CHECK-NEXT:    scvtf.2d v1, v128; CHECK-NEXT:    scvtf.2d v0, v029; CHECK-NEXT:    stp q0, q1, [x0]30; CHECK-NEXT:    ret31  %cmp = fcmp oeq <4 x float> %val, %test32  %ext = zext <4 x i1> %cmp to <4 x i32>33  %result = sitofp <4 x i32> %ext to <4 x double>34  store <4 x double> %result, ptr %p35  ret void36}37 38; Fold explicit AND operations when the constant isn't a splat of a single39; scalar value like what the zext creates.40define <4 x float> @foo2(<4 x float> %val, <4 x float> %test) nounwind {41; CHECK-LABEL: foo2:42; CHECK:       ; %bb.0:43; CHECK-NEXT:    fcmeq.4s v0, v0, v144; CHECK-NEXT:  Lloh0:45; CHECK-NEXT:    adrp x8, lCPI2_0@PAGE46; CHECK-NEXT:  Lloh1:47; CHECK-NEXT:    ldr q1, [x8, lCPI2_0@PAGEOFF]48; CHECK-NEXT:    and.16b v0, v0, v149; CHECK-NEXT:    ret50; CHECK-NEXT:    .loh AdrpLdr Lloh0, Lloh151  %cmp = fcmp oeq <4 x float> %val, %test52  %ext = zext <4 x i1> %cmp to <4 x i32>53  %and = and <4 x i32> %ext, <i32 255, i32 256, i32 257, i32 258>54  %result = sitofp <4 x i32> %and to <4 x float>55  ret <4 x float> %result56}57