1; RUN: llc -mtriple=powerpc-unknown-linux-gnu -O0 < %s | FileCheck %s 2 3@ld = common global ppc_fp128 0xM00000000000000000000000000000000, align 16 4@ld2 = common global ppc_fp128 0xM00000000000000000000000000000000, align 16 5@d = common global double 0.000000e+00, align 8 6@f = common global float 0.000000e+00, align 4 7@i = common global i32 0, align 4 8@ui = common global i32 0, align 4 9@var = common global i8 0, align 1 10 11define void @foo() #0 { 12entry: 13 %c = alloca ppc_fp128, align 16 14 %0 = load ppc_fp128, ppc_fp128* @ld, align 16 15 %1 = load ppc_fp128, ppc_fp128* @ld2, align 16 16 %add = fadd ppc_fp128 %0, %1 17 store ppc_fp128 %add, ppc_fp128* %c, align 16 18 %2 = load ppc_fp128, ppc_fp128* @ld, align 16 19 %3 = load ppc_fp128, ppc_fp128* @ld2, align 16 20 %sub = fsub ppc_fp128 %2, %3 21 store ppc_fp128 %sub, ppc_fp128* %c, align 16 22 %4 = load ppc_fp128, ppc_fp128* @ld, align 16 23 %5 = load ppc_fp128, ppc_fp128* @ld2, align 16 24 %mul = fmul ppc_fp128 %4, %5 25 store ppc_fp128 %mul, ppc_fp128* %c, align 16 26 %6 = load ppc_fp128, ppc_fp128* @ld, align 16 27 %7 = load ppc_fp128, ppc_fp128* @ld2, align 16 28 %div = fdiv ppc_fp128 %6, %7 29 store ppc_fp128 %div, ppc_fp128* %c, align 16 30 ret void 31 32 ; CHECK-LABEL: __gcc_qadd 33 ; CHECK-LABEL: __gcc_qsub 34 ; CHECK-LABEL: __gcc_qmul 35 ; CHECK-LABEL: __gcc_qdiv 36} 37 38define void @foo1() #0 { 39entry: 40 %0 = load double, double* @d, align 8 41 %conv = fpext double %0 to ppc_fp128 42 store ppc_fp128 %conv, ppc_fp128* @ld, align 16 43 ret void 44 45 ; CHECK-LABEL: __gcc_dtoq 46} 47 48define void @foo2() #0 { 49entry: 50 %0 = load ppc_fp128, ppc_fp128* @ld, align 16 51 %conv = fptrunc ppc_fp128 %0 to double 52 store double %conv, double* @d, align 8 53 ret void 54 55 ; CHECK-LABEL: __gcc_qtod 56} 57 58define void @foo3() #0 { 59entry: 60 %0 = load ppc_fp128, ppc_fp128* @ld, align 16 61 %conv = fptrunc ppc_fp128 %0 to float 62 store float %conv, float* @f, align 4 63 ret void 64 65 ; CHECK-LABEL: __gcc_qtos 66} 67 68define void @foo4() #0 { 69entry: 70 %0 = load i32, i32* @i, align 4 71 %conv = sitofp i32 %0 to ppc_fp128 72 store ppc_fp128 %conv, ppc_fp128* @ld, align 16 73 ret void 74 75 ; CHECK-LABEL: __gcc_itoq 76} 77 78define void @foo5() #0 { 79entry: 80 %0 = load i32, i32* @ui, align 4 81 %conv = uitofp i32 %0 to ppc_fp128 82 store ppc_fp128 %conv, ppc_fp128* @ld, align 16 83 ret void 84 85 ; CHECK-LABEL: __gcc_utoq 86} 87 88define void @foo6() #0 { 89entry: 90 %0 = load ppc_fp128, ppc_fp128* @ld, align 16 91 %1 = load ppc_fp128, ppc_fp128* @ld2, align 16 92 %cmp = fcmp oeq ppc_fp128 %0, %1 93 %conv = zext i1 %cmp to i32 94 %conv1 = trunc i32 %conv to i8 95 store i8 %conv1, i8* @var, align 1 96 ret void 97 98 ; CHECK-LABEL: __gcc_qeq 99} 100 101define void @foo7() #0 { 102entry: 103 %0 = load ppc_fp128, ppc_fp128* @ld, align 16 104 %1 = load ppc_fp128, ppc_fp128* @ld2, align 16 105 %cmp = fcmp une ppc_fp128 %0, %1 106 %conv = zext i1 %cmp to i32 107 %conv1 = trunc i32 %conv to i8 108 store i8 %conv1, i8* @var, align 1 109 ret void 110 111 ; CHECK-LABEL: __gcc_qne 112} 113 114define void @foo8() #0 { 115entry: 116 %0 = load ppc_fp128, ppc_fp128* @ld, align 16 117 %1 = load ppc_fp128, ppc_fp128* @ld2, align 16 118 %cmp = fcmp ogt ppc_fp128 %0, %1 119 %conv = zext i1 %cmp to i32 120 %conv1 = trunc i32 %conv to i8 121 store i8 %conv1, i8* @var, align 1 122 ret void 123 124 ; CHECK-LABEL: __gcc_qgt 125} 126 127define void @foo9() #0 { 128entry: 129 %0 = load ppc_fp128, ppc_fp128* @ld, align 16 130 %1 = load ppc_fp128, ppc_fp128* @ld2, align 16 131 %cmp = fcmp olt ppc_fp128 %0, %1 132 %conv = zext i1 %cmp to i32 133 %conv1 = trunc i32 %conv to i8 134 store i8 %conv1, i8* @var, align 1 135 ret void 136 137 ; CHECK-LABEL: __gcc_qlt 138} 139 140define void @foo10() #0 { 141entry: 142 %0 = load ppc_fp128, ppc_fp128* @ld, align 16 143 %1 = load ppc_fp128, ppc_fp128* @ld2, align 16 144 %cmp = fcmp ole ppc_fp128 %0, %1 145 %conv = zext i1 %cmp to i32 146 %conv1 = trunc i32 %conv to i8 147 store i8 %conv1, i8* @var, align 1 148 ret void 149 150 ; CHECK-LABEL: __gcc_qle 151} 152 153define void @foo11() #0 { 154entry: 155 %0 = load ppc_fp128, ppc_fp128* @ld, align 16 156 %1 = load ppc_fp128, ppc_fp128* @ld, align 16 157 %cmp = fcmp une ppc_fp128 %0, %1 158 %conv = zext i1 %cmp to i32 159 %conv1 = trunc i32 %conv to i8 160 store i8 %conv1, i8* @var, align 1 161 ret void 162 163 ; CHECK-LABEL: __gcc_qunord 164} 165 166define void @foo12() #0 { 167entry: 168 %0 = load ppc_fp128, ppc_fp128* @ld, align 16 169 %1 = load ppc_fp128, ppc_fp128* @ld2, align 16 170 %cmp = fcmp oge ppc_fp128 %0, %1 171 %conv = zext i1 %cmp to i32 172 %conv1 = trunc i32 %conv to i8 173 store i8 %conv1, i8* @var, align 1 174 ret void 175 176 ; CHECK-LABEL: __gcc_qge 177} 178 179attributes #0 = { "use-soft-float"="true" } 180