1; Test strict extensions of f32 to f128. 2; 3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s 4 5declare fp128 @llvm.experimental.constrained.fpext.f128.f32(float, metadata) 6 7; Check register extension. 8define void @f1(fp128 *%dst, float %val) #0 { 9; CHECK-LABEL: f1: 10; CHECK: lxebr %f0, %f0 11; CHECK: std %f0, 0(%r2) 12; CHECK: std %f2, 8(%r2) 13; CHECK: br %r14 14 %res = call fp128 @llvm.experimental.constrained.fpext.f128.f32(float %val, 15 metadata !"fpexcept.strict") #0 16 store fp128 %res, fp128 *%dst 17 ret void 18} 19 20; Check the low end of the LXEB range. 21define void @f2(fp128 *%dst, float *%ptr) #0 { 22; CHECK-LABEL: f2: 23; CHECK: lxeb %f0, 0(%r3) 24; CHECK: std %f0, 0(%r2) 25; CHECK: std %f2, 8(%r2) 26; CHECK: br %r14 27 %val = load float, float *%ptr 28 %res = call fp128 @llvm.experimental.constrained.fpext.f128.f32(float %val, 29 metadata !"fpexcept.strict") #0 30 store fp128 %res, fp128 *%dst 31 ret void 32} 33 34; Check the high end of the aligned LXEB range. 35define void @f3(fp128 *%dst, float *%base) #0 { 36; CHECK-LABEL: f3: 37; CHECK: lxeb %f0, 4092(%r3) 38; CHECK: std %f0, 0(%r2) 39; CHECK: std %f2, 8(%r2) 40; CHECK: br %r14 41 %ptr = getelementptr float, float *%base, i64 1023 42 %val = load float, float *%ptr 43 %res = call fp128 @llvm.experimental.constrained.fpext.f128.f32(float %val, 44 metadata !"fpexcept.strict") #0 45 store fp128 %res, fp128 *%dst 46 ret void 47} 48 49; Check the next word up, which needs separate address logic. 50; Other sequences besides this one would be OK. 51define void @f4(fp128 *%dst, float *%base) #0 { 52; CHECK-LABEL: f4: 53; CHECK: aghi %r3, 4096 54; CHECK: lxeb %f0, 0(%r3) 55; CHECK: std %f0, 0(%r2) 56; CHECK: std %f2, 8(%r2) 57; CHECK: br %r14 58 %ptr = getelementptr float, float *%base, i64 1024 59 %val = load float, float *%ptr 60 %res = call fp128 @llvm.experimental.constrained.fpext.f128.f32(float %val, 61 metadata !"fpexcept.strict") #0 62 store fp128 %res, fp128 *%dst 63 ret void 64} 65 66; Check negative displacements, which also need separate address logic. 67define void @f5(fp128 *%dst, float *%base) #0 { 68; CHECK-LABEL: f5: 69; CHECK: aghi %r3, -4 70; CHECK: lxeb %f0, 0(%r3) 71; CHECK: std %f0, 0(%r2) 72; CHECK: std %f2, 8(%r2) 73; CHECK: br %r14 74 %ptr = getelementptr float, float *%base, i64 -1 75 %val = load float, float *%ptr 76 %res = call fp128 @llvm.experimental.constrained.fpext.f128.f32(float %val, 77 metadata !"fpexcept.strict") #0 78 store fp128 %res, fp128 *%dst 79 ret void 80} 81 82; Check that LXEB allows indices. 83define void @f6(fp128 *%dst, float *%base, i64 %index) #0 { 84; CHECK-LABEL: f6: 85; CHECK: sllg %r1, %r4, 2 86; CHECK: lxeb %f0, 400(%r1,%r3) 87; CHECK: std %f0, 0(%r2) 88; CHECK: std %f2, 8(%r2) 89; CHECK: br %r14 90 %ptr1 = getelementptr float, float *%base, i64 %index 91 %ptr2 = getelementptr float, float *%ptr1, i64 100 92 %val = load float, float *%ptr2 93 %res = call fp128 @llvm.experimental.constrained.fpext.f128.f32(float %val, 94 metadata !"fpexcept.strict") #0 95 store fp128 %res, fp128 *%dst 96 ret void 97} 98 99attributes #0 = { strictfp } 100