137 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 52# NOTE: This MIR test is required because the support for 64 bit memory ops is missing in X86 mode, Due to distinction between float/int types, support is expected in near future and there is this RFC in place https://discourse.llvm.org/t/rfc-globalisel-adding-fp-type-information-to-llt/83349. Once this support is introduced this test must be dropped and integrated into the LLVM IR tests.3# RUN: llc -O2 -mtriple=i686-linux-gnu -mattr=+x87,-sse,-sse2 -run-pass=regbankselect,instruction-select -disable-gisel-legality-check -global-isel -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes GISEL-X864 5---6name: test_double_to_int167alignment: 168exposesReturnsTwice: false9legalized: true10tracksRegLiveness: true11fixedStack:12 - { id: 0, type: default, offset: 0, size: 8, alignment: 16, stack-id: default,13 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,14 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }15stack:16 - { id: 0, name: '', type: default, offset: 0, size: 2, alignment: 2,17 stack-id: default, callee-saved-register: '', callee-saved-restored: true,18 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }19 20body: |21 bb.1.entry:22 ; GISEL-X86-LABEL: name: test_double_to_int1623 ; GISEL-X86: [[DEF:%[0-9]+]]:rfp64 = IMPLICIT_DEF24 ; GISEL-X86-NEXT: FP64_TO_INT16_IN_MEM %stack.0, 1, $noreg, 0, $noreg, [[DEF]], implicit-def dead $eflags :: (store (s16) into %stack.0)25 ; GISEL-X86-NEXT: [[MOV16rm:%[0-9]+]]:gr16 = MOV16rm %stack.0, 1, $noreg, 0, $noreg :: (load (s16) from %stack.0)26 ; GISEL-X86-NEXT: $ax = COPY [[MOV16rm]]27 ; GISEL-X86-NEXT: RET 0, implicit $ax28 %0:_(s64) = IMPLICIT_DEF29 %3:_(p0) = G_FRAME_INDEX %stack.030 G_FIST %0(s64), %3(p0) :: (store (s16) into %stack.0)31 %2:_(s16) = G_LOAD %3(p0) :: (load (s16) from %stack.0)32 $ax = COPY %2(s16)33 RET 0, implicit $ax34...35---36name: test_double_to_int3237alignment: 1638exposesReturnsTwice: false39legalized: true40tracksRegLiveness: true41fixedStack:42 - { id: 0, type: default, offset: 0, size: 8, alignment: 16, stack-id: default,43 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,44 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }45stack:46 - { id: 0, name: '', type: default, offset: 0, size: 4, alignment: 4,47 stack-id: default, callee-saved-register: '', callee-saved-restored: true,48 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }49 50body: |51 bb.1.entry:52 ; GISEL-X86-LABEL: name: test_double_to_int3253 ; GISEL-X86: [[DEF:%[0-9]+]]:rfp64 = IMPLICIT_DEF54 ; GISEL-X86-NEXT: FP64_TO_INT32_IN_MEM %stack.0, 1, $noreg, 0, $noreg, [[DEF]], implicit-def dead $eflags :: (store (s32) into %stack.0)55 ; GISEL-X86-NEXT: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %stack.0, 1, $noreg, 0, $noreg :: (load (s32) from %stack.0)56 ; GISEL-X86-NEXT: $eax = COPY [[MOV32rm]]57 ; GISEL-X86-NEXT: RET 0, implicit $eax58 %0:_(s64) = IMPLICIT_DEF59 %3:_(p0) = G_FRAME_INDEX %stack.060 G_FIST %0(s64), %3(p0) :: (store (s32) into %stack.0)61 %2:_(s32) = G_LOAD %3(p0) :: (load (s32) from %stack.0)62 $eax = COPY %2(s32)63 RET 0, implicit $eax64...65---66name: test_double_to_int6467alignment: 1668exposesReturnsTwice: false69legalized: true70tracksRegLiveness: true71fixedStack:72 - { id: 0, type: default, offset: 0, size: 8, alignment: 16, stack-id: default,73 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,74 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }75stack:76 - { id: 0, name: '', type: default, offset: 0, size: 8, alignment: 8,77 stack-id: default, callee-saved-register: '', callee-saved-restored: true,78 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }79body: |80 bb.1.entry:81 ; GISEL-X86-LABEL: name: test_double_to_int6482 ; GISEL-X86: [[DEF:%[0-9]+]]:rfp64 = IMPLICIT_DEF83 ; GISEL-X86-NEXT: [[LEA32r:%[0-9]+]]:gr32 = LEA32r %stack.0, 1, $noreg, 0, $noreg84 ; GISEL-X86-NEXT: FP64_TO_INT64_IN_MEM %stack.0, 1, $noreg, 0, $noreg, [[DEF]], implicit-def dead $eflags :: (store (s64) into %stack.0)85 ; GISEL-X86-NEXT: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %stack.0, 1, $noreg, 0, $noreg :: (load (s32) from %stack.0, align 8)86 ; GISEL-X86-NEXT: [[MOV32rm1:%[0-9]+]]:gr32 = MOV32rm [[LEA32r]], 1, $noreg, 4, $noreg :: (load (s32) from %stack.0 + 4, basealign 8)87 ; GISEL-X86-NEXT: $eax = COPY [[MOV32rm]]88 ; GISEL-X86-NEXT: $edx = COPY [[MOV32rm1]]89 ; GISEL-X86-NEXT: RET 0, implicit $eax, implicit $edx90 %1:_(p0) = G_FRAME_INDEX %fixed-stack.091 %10:_(s32) = G_LOAD %1(p0) :: (invariant load (s32) from %fixed-stack.0, align 16)92 %8:_(s32) = G_CONSTANT i32 493 %11:_(p0) = G_PTR_ADD %1, %8(s32)94 %12:_(s32) = G_LOAD %11(p0) :: (invariant load (s32) from %fixed-stack.0 + 4, basealign 16)95 %0:_(s64) = IMPLICIT_DEF96 %5:_(p0) = G_FRAME_INDEX %stack.097 G_FIST %0(s64), %5(p0) :: (store (s64) into %stack.0)98 %6:_(s32) = G_LOAD %5(p0) :: (load (s32) from %stack.0, align 8)99 %7:_(p0) = G_PTR_ADD %5, %8(s32)100 %9:_(s32) = G_LOAD %7(p0) :: (load (s32) from %stack.0 + 4, basealign 8)101 $eax = COPY %6(s32)102 $edx = COPY %9(s32)103 RET 0, implicit $eax, implicit $edx104...105---106name: test_double_to_int8107alignment: 16108exposesReturnsTwice: false109legalized: true110tracksRegLiveness: true111fixedStack:112 - { id: 0, type: default, offset: 0, size: 8, alignment: 16, stack-id: default,113 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,114 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }115stack:116 - { id: 0, name: '', type: default, offset: 0, size: 2, alignment: 2,117 stack-id: default, callee-saved-register: '', callee-saved-restored: true,118 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }119 120body: |121 bb.1.entry:122 ; GISEL-X86-LABEL: name: test_double_to_int8123 ; GISEL-X86: [[DEF:%[0-9]+]]:rfp64 = IMPLICIT_DEF124 ; GISEL-X86-NEXT: FP64_TO_INT16_IN_MEM %stack.0, 1, $noreg, 0, $noreg, [[DEF]], implicit-def dead $eflags :: (store (s16) into %stack.0)125 ; GISEL-X86-NEXT: [[MOV16rm:%[0-9]+]]:gr16 = MOV16rm %stack.0, 1, $noreg, 0, $noreg :: (load (s16) from %stack.0)126 ; GISEL-X86-NEXT: [[COPY:%[0-9]+]]:gr16_abcd = COPY [[MOV16rm]]127 ; GISEL-X86-NEXT: [[COPY1:%[0-9]+]]:gr8_abcd_l = COPY [[COPY]].sub_8bit128 ; GISEL-X86-NEXT: $al = COPY [[COPY1]]129 ; GISEL-X86-NEXT: RET 0, implicit $al130 %0:_(s64) = IMPLICIT_DEF131 %4:_(p0) = G_FRAME_INDEX %stack.0132 G_FIST %0(s64), %4(p0) :: (store (s16) into %stack.0)133 %3:_(s16) = G_LOAD %4(p0) :: (load (s16) from %stack.0)134 %2:_(s8) = G_TRUNC %3(s16)135 $al = COPY %2(s8)136 RET 0, implicit $al137