brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.3 KiB · 7aba3bc Raw
153 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc  -O0 -mtriple=mipsel-linux-gnu -global-isel  -verify-machineinstrs %s -o -| FileCheck %s -check-prefixes=MIPS323 4define i8 @select_i8(i1 %test, i8 %a, i8 %b) {5; MIPS32-LABEL: select_i8:6; MIPS32:       # %bb.0: # %entry7; MIPS32-NEXT:    move $2, $68; MIPS32-NEXT:    andi $1, $4, 19; MIPS32-NEXT:    movn $2, $5, $110; MIPS32-NEXT:    jr $ra11; MIPS32-NEXT:    nop12entry:13  %cond = select i1 %test, i8 %a, i8 %b14  ret i8 %cond15}16 17define i16 @select_i16(i1 %test, i16 %a, i16 %b) {18; MIPS32-LABEL: select_i16:19; MIPS32:       # %bb.0: # %entry20; MIPS32-NEXT:    move $2, $621; MIPS32-NEXT:    andi $1, $4, 122; MIPS32-NEXT:    movn $2, $5, $123; MIPS32-NEXT:    jr $ra24; MIPS32-NEXT:    nop25entry:26  %cond = select i1 %test, i16 %a, i16 %b27  ret i16 %cond28}29 30define i32 @select_i32(i1 %test, i32 %a, i32 %b) {31; MIPS32-LABEL: select_i32:32; MIPS32:       # %bb.0: # %entry33; MIPS32-NEXT:    move $2, $634; MIPS32-NEXT:    andi $1, $4, 135; MIPS32-NEXT:    movn $2, $5, $136; MIPS32-NEXT:    jr $ra37; MIPS32-NEXT:    nop38entry:39  %cond = select i1 %test, i32 %a, i32 %b40  ret i32 %cond41}42 43define ptr @select_ptr(i1 %test, ptr %a, ptr %b) {44; MIPS32-LABEL: select_ptr:45; MIPS32:       # %bb.0: # %entry46; MIPS32-NEXT:    move $2, $647; MIPS32-NEXT:    andi $1, $4, 148; MIPS32-NEXT:    movn $2, $5, $149; MIPS32-NEXT:    jr $ra50; MIPS32-NEXT:    nop51entry:52  %cond = select i1 %test, ptr %a, ptr %b53  ret ptr %cond54}55 56define i32 @select_with_negation(i32 %a, i32 %b, i32 %x, i32 %y) {57; MIPS32-LABEL: select_with_negation:58; MIPS32:       # %bb.0: # %entry59; MIPS32-NEXT:    move $2, $760; MIPS32-NEXT:    slt $1, $4, $561; MIPS32-NEXT:    xori $1, $1, 162; MIPS32-NEXT:    movn $2, $6, $163; MIPS32-NEXT:    jr $ra64; MIPS32-NEXT:    nop65entry:66  %cmp = icmp slt i32 %a, %b67  %lneg = xor i1 %cmp, true68  %cond = select i1 %lneg, i32 %x, i32 %y69  ret i32 %cond70}71 72define i64 @select_i64(i1 %test, i64 %a, i64 %b) {73; MIPS32-LABEL: select_i64:74; MIPS32:       # %bb.0: # %entry75; MIPS32-NEXT:    addiu $1, $sp, 1676; MIPS32-NEXT:    lw $2, 0($1)77; MIPS32-NEXT:    addiu $1, $sp, 2078; MIPS32-NEXT:    lw $3, 0($1)79; MIPS32-NEXT:    andi $1, $4, 180; MIPS32-NEXT:    movn $2, $6, $181; MIPS32-NEXT:    movn $3, $7, $182; MIPS32-NEXT:    jr $ra83; MIPS32-NEXT:    nop84entry:85  %cond = select i1 %test, i64 %a, i64 %b86  ret i64 %cond87}88 89define void @select_ambiguous_i64_in_fpr(i1 %test, ptr %i64_ptr_a, ptr %i64_ptr_b, ptr %i64_ptr_c) {90; MIPS32-LABEL: select_ambiguous_i64_in_fpr:91; MIPS32:       # %bb.0: # %entry92; MIPS32-NEXT:    ldc1 $f2, 0($5)93; MIPS32-NEXT:    ldc1 $f0, 0($6)94; MIPS32-NEXT:    andi $1, $4, 195; MIPS32-NEXT:    movn.d $f0, $f2, $196; MIPS32-NEXT:    sdc1 $f0, 0($7)97; MIPS32-NEXT:    jr $ra98; MIPS32-NEXT:    nop99entry:100  %0 = load i64, ptr %i64_ptr_a, align 8101  %1 = load i64, ptr %i64_ptr_b, align 8102  %cond = select i1 %test, i64 %0, i64 %1103  store i64 %cond, ptr %i64_ptr_c, align 8104  ret void105}106 107define float @select_float(i1 %test, float %a, float %b) {108; MIPS32-LABEL: select_float:109; MIPS32:       # %bb.0: # %entry110; MIPS32-NEXT:    andi $1, $4, 1111; MIPS32-NEXT:    mtc1 $5, $f1112; MIPS32-NEXT:    mtc1 $6, $f0113; MIPS32-NEXT:    movn.s $f0, $f1, $1114; MIPS32-NEXT:    jr $ra115; MIPS32-NEXT:    nop116entry:117  %cond = select i1 %test, float %a, float %b118  ret float %cond119}120 121define void @select_ambiguous_float_in_gpr(i1 %test, ptr %f32_ptr_a, ptr %f32_ptr_b, ptr %f32_ptr_c) {122; MIPS32-LABEL: select_ambiguous_float_in_gpr:123; MIPS32:       # %bb.0: # %entry124; MIPS32-NEXT:    lw $2, 0($5)125; MIPS32-NEXT:    lw $1, 0($6)126; MIPS32-NEXT:    andi $3, $4, 1127; MIPS32-NEXT:    movn $1, $2, $3128; MIPS32-NEXT:    sw $1, 0($7)129; MIPS32-NEXT:    jr $ra130; MIPS32-NEXT:    nop131entry:132  %0 = load float, ptr %f32_ptr_a, align 4133  %1 = load float, ptr %f32_ptr_b, align 4134  %cond = select i1 %test, float %0, float %1135  store float %cond, ptr %f32_ptr_c, align 4136  ret void137}138 139define double @select_double(double %a, double %b, i1 %test) {140; MIPS32-LABEL: select_double:141; MIPS32:       # %bb.0: # %entry142; MIPS32-NEXT:    mov.d $f0, $f14143; MIPS32-NEXT:    addiu $1, $sp, 16144; MIPS32-NEXT:    lw $1, 0($1)145; MIPS32-NEXT:    andi $1, $1, 1146; MIPS32-NEXT:    movn.d $f0, $f12, $1147; MIPS32-NEXT:    jr $ra148; MIPS32-NEXT:    nop149entry:150  %cond = select i1 %test, double %a, double %b151  ret double %cond152}153