1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --no_x86_scrub_sp
2 ; RUN: llc -mtriple=i386-linux-gnu -global-isel -verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc -mtriple=i386-linux-gnu -regbankselect-greedy -global-isel -verify-machineinstrs < %s | FileCheck %s
5 ;TODO merge with x86-64 tests (many operations not suppored yet)
7 define i1 @test_load_i1(ptr %p1) {
8 ; CHECK-LABEL: test_load_i1:
10 ; CHECK-NEXT: movl 4(%esp), %eax
11 ; CHECK-NEXT: movzbl (%eax), %eax
17 define i8 @test_load_i8(ptr %p1) {
18 ; CHECK-LABEL: test_load_i8:
20 ; CHECK-NEXT: movl 4(%esp), %eax
21 ; CHECK-NEXT: movzbl (%eax), %eax
27 define i16 @test_load_i16(ptr %p1) {
28 ; CHECK-LABEL: test_load_i16:
30 ; CHECK-NEXT: movl 4(%esp), %eax
31 ; CHECK-NEXT: movzwl (%eax), %eax
33 %r = load i16, ptr %p1
37 define i32 @test_load_i32(ptr %p1) {
38 ; CHECK-LABEL: test_load_i32:
40 ; CHECK-NEXT: movl 4(%esp), %eax
41 ; CHECK-NEXT: movl (%eax), %eax
43 %r = load i32, ptr %p1
47 define ptr @test_store_i1(i1 %val, ptr %p1) {
48 ; CHECK-LABEL: test_store_i1:
50 ; CHECK-NEXT: movl 4(%esp), %ecx
51 ; CHECK-NEXT: movl 8(%esp), %eax
52 ; CHECK-NEXT: andb $1, %cl
53 ; CHECK-NEXT: movb %cl, (%eax)
55 store i1 %val, ptr %p1
59 define ptr @test_store_i8(i8 %val, ptr %p1) {
60 ; CHECK-LABEL: test_store_i8:
62 ; CHECK-NEXT: movl 4(%esp), %ecx
63 ; CHECK-NEXT: movl 8(%esp), %eax
64 ; CHECK-NEXT: movb %cl, (%eax)
66 store i8 %val, ptr %p1
70 define ptr @test_store_i16(i16 %val, ptr %p1) {
71 ; CHECK-LABEL: test_store_i16:
73 ; CHECK-NEXT: movl 4(%esp), %ecx
74 ; CHECK-NEXT: movl 8(%esp), %eax
75 ; CHECK-NEXT: movw %cx, (%eax)
77 store i16 %val, ptr %p1
81 define ptr @test_store_i32(i32 %val, ptr %p1) {
82 ; CHECK-LABEL: test_store_i32:
84 ; CHECK-NEXT: movl 4(%esp), %ecx
85 ; CHECK-NEXT: movl 8(%esp), %eax
86 ; CHECK-NEXT: movl %ecx, (%eax)
88 store i32 %val, ptr %p1
92 define ptr @test_load_ptr(ptr %ptr1) {
93 ; CHECK-LABEL: test_load_ptr:
95 ; CHECK-NEXT: movl 4(%esp), %eax
96 ; CHECK-NEXT: movl (%eax), %eax
98 %p = load ptr, ptr %ptr1
102 define void @test_store_ptr(ptr %ptr1, ptr %a) {
103 ; CHECK-LABEL: test_store_ptr:
105 ; CHECK-NEXT: movl 4(%esp), %eax
106 ; CHECK-NEXT: movl 8(%esp), %ecx
107 ; CHECK-NEXT: movl %ecx, (%eax)
109 store ptr %a, ptr %ptr1