[Sparc] Emit 'restore' instead of 'restore %g0, %g0, %g0'. This improves the readabil...
[oota-llvm.git] / test / MC / Sparc / sparc-alu-instructions.s
1 ! RUN: llvm-mc %s -arch=sparc   -show-encoding | FileCheck %s
2 ! RUN: llvm-mc %s -arch=sparcv9 -show-encoding | FileCheck %s
3
4         ! CHECK: add %g0, %g0, %g0    ! encoding: [0x80,0x00,0x00,0x00]
5         add %g0, %g0, %g0
6         ! CHECK: add %g1, %g2, %g3    ! encoding: [0x86,0x00,0x40,0x02]
7         add %g1, %g2, %g3
8         ! CHECK: add %o0, %o1, %l0    ! encoding: [0xa0,0x02,0x00,0x09]
9         add %r8, %r9, %l0
10         ! CHECK: add %o0, 10,  %l0    ! encoding: [0xa0,0x02,0x20,0x0a]
11         add %o0, 10, %l0
12
13         ! CHECK: addcc %g1, %g2, %g3  ! encoding: [0x86,0x80,0x40,0x02]
14         addcc %g1, %g2, %g3
15
16         ! CHECK: addxcc %g1, %g2, %g3 ! encoding: [0x86,0xc0,0x40,0x02]
17         addxcc %g1, %g2, %g3
18
19         ! CHECK: udiv %g1, %g2, %g3   ! encoding: [0x86,0x70,0x40,0x02]
20         udiv %g1, %g2, %g3
21
22         ! CHECK: sdiv %g1, %g2, %g3   ! encoding: [0x86,0x78,0x40,0x02]
23         sdiv %g1, %g2, %g3
24
25         ! CHECK: and %g1, %g2, %g3    ! encoding: [0x86,0x08,0x40,0x02]
26         and %g1, %g2, %g3
27         ! CHECK: andn %g1, %g2, %g3   ! encoding: [0x86,0x28,0x40,0x02]
28         andn %g1, %g2, %g3
29         ! CHECK: or %g1, %g2, %g3     ! encoding: [0x86,0x10,0x40,0x02]
30         or  %g1, %g2, %g3
31         ! CHECK: orn %g1, %g2, %g3    ! encoding: [0x86,0x30,0x40,0x02]
32         orn %g1, %g2, %g3
33         ! CHECK: xor %g1, %g2, %g3    ! encoding: [0x86,0x18,0x40,0x02]
34         xor %g1, %g2, %g3
35         ! CHECK: xnor %g1, %g2, %g3   ! encoding: [0x86,0x38,0x40,0x02]
36         xnor %g1, %g2, %g3
37
38         ! CHECK: umul %g1, %g2, %g3   ! encoding: [0x86,0x50,0x40,0x02]
39         umul %g1, %g2, %g3
40
41         ! CHECK: smul %g1, %g2, %g3   ! encoding: [0x86,0x58,0x40,0x02]
42         smul %g1, %g2, %g3
43
44         ! CHECK: nop                  ! encoding: [0x01,0x00,0x00,0x00]
45         nop
46
47         ! CHECK: sethi 10, %l0        ! encoding: [0x21,0x00,0x00,0x0a]
48         sethi 10, %l0
49
50         ! CHECK: sll %g1, %g2, %g3    ! encoding: [0x87,0x28,0x40,0x02]
51         sll %g1, %g2, %g3
52         ! CHECK: sll %g1, 31, %g3     ! encoding: [0x87,0x28,0x60,0x1f]
53         sll %g1, 31, %g3
54
55         ! CHECK: srl %g1, %g2, %g3    ! encoding: [0x87,0x30,0x40,0x02]
56         srl %g1, %g2, %g3
57         ! CHECK: srl %g1, 31, %g3     ! encoding: [0x87,0x30,0x60,0x1f]
58         srl %g1, 31, %g3
59
60         ! CHECK: sra %g1, %g2, %g3    ! encoding: [0x87,0x38,0x40,0x02]
61         sra %g1, %g2, %g3
62         ! CHECK: sra %g1, 31, %g3     ! encoding: [0x87,0x38,0x60,0x1f]
63         sra %g1, 31, %g3
64
65         ! CHECK: sub %g1, %g2, %g3    ! encoding: [0x86,0x20,0x40,0x02]
66         sub %g1, %g2, %g3
67         ! CHECK: subcc %g1, %g2, %g3  ! encoding: [0x86,0xa0,0x40,0x02]
68         subcc %g1, %g2, %g3
69
70         ! CHECK: subxcc %g1, %g2, %g3 ! encoding: [0x86,0xe0,0x40,0x02]
71         subxcc %g1, %g2, %g3
72
73         ! CHECK: or %g0, %g1, %g3     ! encoding: [0x86,0x10,0x00,0x01]
74         mov %g1, %g3
75
76         ! CHECK: or %g0, 255, %g3     ! encoding: [0x86,0x10,0x20,0xff]
77         mov 0xff, %g3
78
79         ! CHECK: restore              ! encoding: [0x81,0xe8,0x00,0x00]
80         restore %g0, %g0, %g0