90 lines · plain
1; RUN: llc -mtriple=hexagon -fp-contract=fast -disable-hexagon-peephole -disable-hexagon-amodeopt < %s | FileCheck %s2 3; The test checks for various addressing modes for floating point loads/stores.4 5%struct.matrix_paramsGlob = type { [50 x i8], i16, [50 x float] }6%struct.matrix_params = type { [50 x i8], i16, ptr }7%struct.matrix_params2 = type { i16, [50 x [50 x float]] }8 9@globB = common global %struct.matrix_paramsGlob zeroinitializer, align 410@globA = common global %struct.matrix_paramsGlob zeroinitializer, align 411@b = common global float 0.000000e+00, align 412@a = common global float 0.000000e+00, align 413 14; CHECK-LABEL: test115; CHECK: [[REG11:(r[0-9]+)]] = memw(r{{[0-9]+}}+r{{[0-9]+}}<<#2)16; CHECK: [[REG12:(r[0-9]+)]] += sfmpy({{.*}}[[REG11]]17; CHECK: memw(r{{[0-9]+}}+r{{[0-9]+}}<<#2) = [[REG12]].new18 19; Function Attrs: norecurse nounwind20define void @test1(ptr nocapture readonly %params, i32 %col1) {21entry:22 %matrixA = getelementptr inbounds %struct.matrix_params, ptr %params, i32 0, i32 223 %0 = load ptr, ptr %matrixA, align 424 %arrayidx = getelementptr inbounds ptr, ptr %0, i32 225 %1 = load ptr, ptr %arrayidx, align 426 %arrayidx1 = getelementptr inbounds float, ptr %1, i32 %col127 %2 = load float, ptr %arrayidx1, align 428 %mul = fmul float %2, 2.000000e+0129 %add = fadd float %mul, 1.000000e+0130 %arrayidx3 = getelementptr inbounds ptr, ptr %0, i32 531 %3 = load ptr, ptr %arrayidx3, align 432 %arrayidx4 = getelementptr inbounds float, ptr %3, i32 %col133 store float %add, ptr %arrayidx4, align 434 ret void35}36 37; CHECK-LABEL: test238; CHECK: [[REG21:(r[0-9]+)]] = memw(##globB+92)39; CHECK: [[REG22:(r[0-9]+)]] = sfadd({{.*}}[[REG21]]40; CHECK: memw(##globA+84) = [[REG22]]41 42; Function Attrs: norecurse nounwind43define void @test2(ptr nocapture readonly %params, i32 %col1) {44entry:45 %matrixA = getelementptr inbounds %struct.matrix_params, ptr %params, i32 0, i32 246 %0 = load ptr, ptr %matrixA, align 447 %1 = load ptr, ptr %0, align 448 %arrayidx1 = getelementptr inbounds float, ptr %1, i32 %col149 %2 = load float, ptr %arrayidx1, align 450 %3 = load float, ptr getelementptr inbounds (%struct.matrix_paramsGlob, ptr @globB, i32 0, i32 2, i32 10), align 451 %add = fadd float %2, %352 store float %add, ptr getelementptr inbounds (%struct.matrix_paramsGlob, ptr @globA, i32 0, i32 2, i32 8), align 453 ret void54}55 56; CHECK-LABEL: test357; CHECK: [[REG31:(r[0-9]+)]] = memw(gp+#b)58; CHECK: [[REG32:(r[0-9]+)]] = sfadd({{.*}}[[REG31]]59; CHECK: memw(gp+#a) = [[REG32]]60 61; Function Attrs: norecurse nounwind62define void @test3(ptr nocapture readonly %params, i32 %col1) {63entry:64 %matrixA = getelementptr inbounds %struct.matrix_params, ptr %params, i32 0, i32 265 %0 = load ptr, ptr %matrixA, align 466 %1 = load ptr, ptr %0, align 467 %arrayidx1 = getelementptr inbounds float, ptr %1, i32 %col168 %2 = load float, ptr %arrayidx1, align 469 %3 = load float, ptr @b, align 470 %add = fadd float %2, %371 store float %add, ptr @a, align 472 ret void73}74 75; CHECK-LABEL: test476; CHECK: [[REG41:(r[0-9]+)]] = memw(r0<<#2+##globB+52)77; CHECK: [[REG42:(r[0-9]+)]] = sfadd({{.*}}[[REG41]]78; CHECK: memw(r0<<#2+##globA+60) = [[REG42]]79; Function Attrs: noinline norecurse nounwind80define void @test4(i32 %col1) {81entry:82 %arrayidx = getelementptr inbounds %struct.matrix_paramsGlob, ptr @globB, i32 0, i32 2, i32 %col183 %0 = load float, ptr %arrayidx, align 484 %add = fadd float %0, 0.000000e+0085 %add1 = add nsw i32 %col1, 286 %arrayidx2 = getelementptr inbounds %struct.matrix_paramsGlob, ptr @globA, i32 0, i32 2, i32 %add187 store float %add, ptr %arrayidx2, align 488 ret void89}90