brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · a2c24c9 Raw
105 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=m68k-linux -verify-machineinstrs | FileCheck %s3 4;; TODO All these can be improved5 6define zeroext i16 @t1(i16 zeroext %x) nounwind readnone ssp {7; CHECK-LABEL: t1:8; CHECK:       ; %bb.0: ; %entry9; CHECK-NEXT:    move.w (6,%sp), %d010; CHECK-NEXT:    and.l #65535, %d011; CHECK-NEXT:    sub.l #26, %d012; CHECK-NEXT:    shi %d013; CHECK-NEXT:    and.l #255, %d014; CHECK-NEXT:    and.l #1, %d015; CHECK-NEXT:    lsl.l #5, %d016; CHECK-NEXT:    rts17entry:18  %0 = icmp ugt i16 %x, 26                        ; <i1> [#uses=1]19  %iftmp.1.0 = select i1 %0, i16 32, i16 0        ; <i16> [#uses=1]20  ret i16 %iftmp.1.021}22 23define zeroext i16 @t2(i16 zeroext %x) nounwind readnone ssp {24; CHECK-LABEL: t2:25; CHECK:       ; %bb.0: ; %entry26; CHECK-NEXT:    move.w (6,%sp), %d027; CHECK-NEXT:    and.l #65535, %d028; CHECK-NEXT:    sub.l #26, %d029; CHECK-NEXT:    scs %d030; CHECK-NEXT:    and.l #255, %d031; CHECK-NEXT:    and.l #1, %d032; CHECK-NEXT:    lsl.l #5, %d033; CHECK-NEXT:    rts34entry:35  %0 = icmp ult i16 %x, 26                        ; <i1> [#uses=1]36  %iftmp.0.0 = select i1 %0, i16 32, i16 0        ; <i16> [#uses=1]37  ret i16 %iftmp.0.038}39 40define fastcc i64 @t3(i64 %x) nounwind readnone ssp {41; CHECK-LABEL: t3:42; CHECK:       ; %bb.0: ; %entry43; CHECK-NEXT:    suba.l #4, %sp44; CHECK-NEXT:    movem.l %d2, (0,%sp)                    ; 8-byte Folded Spill45; CHECK-NEXT:    moveq #0, %d246; CHECK-NEXT:    sub.l #18, %d147; CHECK-NEXT:    subx.l %d2, %d048; CHECK-NEXT:    scs %d049; CHECK-NEXT:    move.l %d0, %d150; CHECK-NEXT:    and.l #255, %d151; CHECK-NEXT:    and.l #1, %d152; CHECK-NEXT:    lsl.l #6, %d153; CHECK-NEXT:    move.l %d2, %d054; CHECK-NEXT:    movem.l (0,%sp), %d2                    ; 8-byte Folded Reload55; CHECK-NEXT:    adda.l #4, %sp56; CHECK-NEXT:    rts57entry:58  %0 = icmp ult i64 %x, 18                        ; <i1> [#uses=1]59  %iftmp.2.0 = select i1 %0, i64 64, i64 0        ; <i64> [#uses=1]60  ret i64 %iftmp.2.061}62 63define i8 @t5(i32 %a) {64; CHECK-LABEL: t5:65; CHECK:         .cfi_startproc66; CHECK-NEXT:  ; %bb.0: ; %entry67; CHECK-NEXT:    moveq #31, %d168; CHECK-NEXT:    move.l (4,%sp), %d069; CHECK-NEXT:    lsr.l %d1, %d070; CHECK-NEXT:    eori.b #1, %d071; CHECK-NEXT:    ; kill: def $bd0 killed $bd0 killed $d072; CHECK-NEXT:    rts73entry:74  %.lobit = lshr i32 %a, 3175  %trunc = trunc i32 %.lobit to i876  %.not = xor i8 %trunc, 177  ret i8 %.not78}79 80 81;82; TODO: Should it be like this?83; cmp.l84; smi85; since we are intereseted in sign bit only86; and.l in the end is superfluous87 88define zeroext i1 @t6(i32 %a) {89; CHECK-LABEL: t6:90; CHECK:         .cfi_startproc91; CHECK-NEXT:  ; %bb.0: ; %entry92; CHECK-NEXT:    moveq #31, %d093; CHECK-NEXT:    move.l (4,%sp), %d194; CHECK-NEXT:    lsr.l %d0, %d195; CHECK-NEXT:    eori.b #1, %d196; CHECK-NEXT:    move.l %d1, %d097; CHECK-NEXT:    and.l #255, %d098; CHECK-NEXT:    rts99entry:100  %.lobit = lshr i32 %a, 31101  %trunc = trunc i32 %.lobit to i1102  %.not = xor i1 %trunc, 1103  ret i1 %.not104}105