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