summary refs log tree commit diff
path: root/test/load2.ssa
blob: 05c12a66d93176290eef441924a268395257810a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# blit & load elimination

export
function $f() {
@start
        %x =l alloc4 12
        %y =l alloc4 12

	%x1 =l add 1, %x
	%x2 =l add 1, %x1
	%x3 =l add 1, %x2
	%x4 =l add 1, %x3
	%x5 =l add 1, %x4
	%x6 =l add 1, %x5
	%x7 =l add 1, %x6
	%x8 =l add 1, %x7
	%x9 =l add 1, %x8
	%xa =l add 1, %x9
	%xb =l add 1, %xa

	%y1 =l add 1, %y
	%y4 =l add 4, %y
	
	storew 287454020, %x4   # 0x11223344
	storew 1432778632, %y   # 0x55667788
	blit %y, %x5, 1
	%n =w load %x4
	call $px(w %n)          # 0x11228844

	storew 287454020, %x4   # 0x11223344
	storew 1432778632, %y   # 0x55667788
	blit %y, %x5, 2
	%n =w load %x4
	call $px(w %n)          # 0x11778844

	storew 287454020, %x4   # 0x11223344
	storew 1432778632, %y   # 0x55667788
	blit %y, %x5, 4
	%n =w load %x4
	call $px(w %n)          # 0x66778844

	storew 287454020, %x4   # 0x11223344
	storew 1432778632, %y   # 0x55667788
	blit %y, %x2, 4
	%n =w load %x4
	call $px(w %n)          # 0x11225566

	storew 287454020, %x4   # 0x11223344
	storew 0, %y
	storew 1432778632, %y4  # 0x55667788
	blit %y1, %x2, 7
	%n =w load %x4
	call $px(w %n)          # 0x66778800

	ret
}

# >>> driver
# #include <stdio.h>
# void px(unsigned n) {
# 	printf("0x%08x\n", n);
# }
# int main() {
# 	extern void f(void);
# 	f();
# }
# <<<

# >>> output
# 0x11228844
# 0x11778844
# 0x66778844
# 0x11225566
# 0x66778800
# <<<