xref: /minix3/external/bsd/llvm/dist/llvm/test/MC/Sparc/sparc-alu-instructions.s (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc! RUN: llvm-mc %s -arch=sparc   -show-encoding | FileCheck %s
2*0a6a1f1dSLionel Sambuc! RUN: llvm-mc %s -arch=sparcv9 -show-encoding | FileCheck %s
3*0a6a1f1dSLionel Sambuc
4*0a6a1f1dSLionel Sambuc        ! CHECK: add %g0, %g0, %g0    ! encoding: [0x80,0x00,0x00,0x00]
5*0a6a1f1dSLionel Sambuc        add %g0, %g0, %g0
6*0a6a1f1dSLionel Sambuc        ! CHECK: add %g1, %g2, %g3    ! encoding: [0x86,0x00,0x40,0x02]
7*0a6a1f1dSLionel Sambuc        add %g1, %g2, %g3
8*0a6a1f1dSLionel Sambuc        ! CHECK: add %o0, %o1, %l0    ! encoding: [0xa0,0x02,0x00,0x09]
9*0a6a1f1dSLionel Sambuc        add %r8, %r9, %l0
10*0a6a1f1dSLionel Sambuc        ! CHECK: add %o0, 10,  %l0    ! encoding: [0xa0,0x02,0x20,0x0a]
11*0a6a1f1dSLionel Sambuc        add %o0, 10, %l0
12*0a6a1f1dSLionel Sambuc
13*0a6a1f1dSLionel Sambuc        ! CHECK: addcc %g1, %g2, %g3  ! encoding: [0x86,0x80,0x40,0x02]
14*0a6a1f1dSLionel Sambuc        addcc %g1, %g2, %g3
15*0a6a1f1dSLionel Sambuc
16*0a6a1f1dSLionel Sambuc        ! CHECK: addxcc %g1, %g2, %g3 ! encoding: [0x86,0xc0,0x40,0x02]
17*0a6a1f1dSLionel Sambuc        addxcc %g1, %g2, %g3
18*0a6a1f1dSLionel Sambuc
19*0a6a1f1dSLionel Sambuc        ! CHECK: udiv %g1, %g2, %g3   ! encoding: [0x86,0x70,0x40,0x02]
20*0a6a1f1dSLionel Sambuc        udiv %g1, %g2, %g3
21*0a6a1f1dSLionel Sambuc
22*0a6a1f1dSLionel Sambuc        ! CHECK: sdiv %g1, %g2, %g3   ! encoding: [0x86,0x78,0x40,0x02]
23*0a6a1f1dSLionel Sambuc        sdiv %g1, %g2, %g3
24*0a6a1f1dSLionel Sambuc
25*0a6a1f1dSLionel Sambuc        ! CHECK: and %g1, %g2, %g3    ! encoding: [0x86,0x08,0x40,0x02]
26*0a6a1f1dSLionel Sambuc        and %g1, %g2, %g3
27*0a6a1f1dSLionel Sambuc        ! CHECK: andn %g1, %g2, %g3   ! encoding: [0x86,0x28,0x40,0x02]
28*0a6a1f1dSLionel Sambuc        andn %g1, %g2, %g3
29*0a6a1f1dSLionel Sambuc        ! CHECK: or %g1, %g2, %g3     ! encoding: [0x86,0x10,0x40,0x02]
30*0a6a1f1dSLionel Sambuc        or  %g1, %g2, %g3
31*0a6a1f1dSLionel Sambuc        ! CHECK: orn %g1, %g2, %g3    ! encoding: [0x86,0x30,0x40,0x02]
32*0a6a1f1dSLionel Sambuc        orn %g1, %g2, %g3
33*0a6a1f1dSLionel Sambuc        ! CHECK: xor %g1, %g2, %g3    ! encoding: [0x86,0x18,0x40,0x02]
34*0a6a1f1dSLionel Sambuc        xor %g1, %g2, %g3
35*0a6a1f1dSLionel Sambuc        ! CHECK: xnor %g1, %g2, %g3   ! encoding: [0x86,0x38,0x40,0x02]
36*0a6a1f1dSLionel Sambuc        xnor %g1, %g2, %g3
37*0a6a1f1dSLionel Sambuc
38*0a6a1f1dSLionel Sambuc        ! CHECK: umul %g1, %g2, %g3   ! encoding: [0x86,0x50,0x40,0x02]
39*0a6a1f1dSLionel Sambuc        umul %g1, %g2, %g3
40*0a6a1f1dSLionel Sambuc
41*0a6a1f1dSLionel Sambuc        ! CHECK: smul %g1, %g2, %g3   ! encoding: [0x86,0x58,0x40,0x02]
42*0a6a1f1dSLionel Sambuc        smul %g1, %g2, %g3
43*0a6a1f1dSLionel Sambuc
44*0a6a1f1dSLionel Sambuc        ! CHECK: nop                  ! encoding: [0x01,0x00,0x00,0x00]
45*0a6a1f1dSLionel Sambuc        nop
46*0a6a1f1dSLionel Sambuc
47*0a6a1f1dSLionel Sambuc        ! CHECK: sethi 10, %l0        ! encoding: [0x21,0x00,0x00,0x0a]
48*0a6a1f1dSLionel Sambuc        sethi 10, %l0
49*0a6a1f1dSLionel Sambuc
50*0a6a1f1dSLionel Sambuc        ! CHECK: sll %g1, %g2, %g3    ! encoding: [0x87,0x28,0x40,0x02]
51*0a6a1f1dSLionel Sambuc        sll %g1, %g2, %g3
52*0a6a1f1dSLionel Sambuc        ! CHECK: sll %g1, 31, %g3     ! encoding: [0x87,0x28,0x60,0x1f]
53*0a6a1f1dSLionel Sambuc        sll %g1, 31, %g3
54*0a6a1f1dSLionel Sambuc
55*0a6a1f1dSLionel Sambuc        ! CHECK: srl %g1, %g2, %g3    ! encoding: [0x87,0x30,0x40,0x02]
56*0a6a1f1dSLionel Sambuc        srl %g1, %g2, %g3
57*0a6a1f1dSLionel Sambuc        ! CHECK: srl %g1, 31, %g3     ! encoding: [0x87,0x30,0x60,0x1f]
58*0a6a1f1dSLionel Sambuc        srl %g1, 31, %g3
59*0a6a1f1dSLionel Sambuc
60*0a6a1f1dSLionel Sambuc        ! CHECK: sra %g1, %g2, %g3    ! encoding: [0x87,0x38,0x40,0x02]
61*0a6a1f1dSLionel Sambuc        sra %g1, %g2, %g3
62*0a6a1f1dSLionel Sambuc        ! CHECK: sra %g1, 31, %g3     ! encoding: [0x87,0x38,0x60,0x1f]
63*0a6a1f1dSLionel Sambuc        sra %g1, 31, %g3
64*0a6a1f1dSLionel Sambuc
65*0a6a1f1dSLionel Sambuc        ! CHECK: sub %g1, %g2, %g3    ! encoding: [0x86,0x20,0x40,0x02]
66*0a6a1f1dSLionel Sambuc        sub %g1, %g2, %g3
67*0a6a1f1dSLionel Sambuc        ! CHECK: subcc %g1, %g2, %g3  ! encoding: [0x86,0xa0,0x40,0x02]
68*0a6a1f1dSLionel Sambuc        subcc %g1, %g2, %g3
69*0a6a1f1dSLionel Sambuc
70*0a6a1f1dSLionel Sambuc        ! CHECK: subxcc %g1, %g2, %g3 ! encoding: [0x86,0xe0,0x40,0x02]
71*0a6a1f1dSLionel Sambuc        subxcc %g1, %g2, %g3
72*0a6a1f1dSLionel Sambuc
73*0a6a1f1dSLionel Sambuc        ! CHECK: mov %g1, %g3     ! encoding: [0x86,0x10,0x00,0x01]
74*0a6a1f1dSLionel Sambuc        mov %g1, %g3
75*0a6a1f1dSLionel Sambuc
76*0a6a1f1dSLionel Sambuc        ! CHECK: mov 255, %g3     ! encoding: [0x86,0x10,0x20,0xff]
77*0a6a1f1dSLionel Sambuc        mov 0xff, %g3
78*0a6a1f1dSLionel Sambuc
79*0a6a1f1dSLionel Sambuc        ! CHECK: restore              ! encoding: [0x81,0xe8,0x00,0x00]
80*0a6a1f1dSLionel Sambuc        restore %g0, %g0, %g0
81*0a6a1f1dSLionel Sambuc
82*0a6a1f1dSLionel Sambuc        ! CHECK: addx %g2, %g1, %g3              ! encoding: [0x86,0x40,0x80,0x01]
83*0a6a1f1dSLionel Sambuc        addx %g2, %g1, %g3
84*0a6a1f1dSLionel Sambuc
85*0a6a1f1dSLionel Sambuc        ! CHECK:  subx %g2, %g1, %g3              ! encoding: [0x86,0x60,0x80,0x01]
86*0a6a1f1dSLionel Sambuc        subx %g2, %g1, %g3
87*0a6a1f1dSLionel Sambuc
88*0a6a1f1dSLionel Sambuc        ! CHECK:  umulcc %g2, %g1, %g3            ! encoding: [0x86,0xd0,0x80,0x01]
89*0a6a1f1dSLionel Sambuc        umulcc %g2, %g1, %g3
90*0a6a1f1dSLionel Sambuc
91*0a6a1f1dSLionel Sambuc        ! CHECK:  smulcc %g2, %g1, %g3            ! encoding: [0x86,0xd8,0x80,0x01]
92*0a6a1f1dSLionel Sambuc        smulcc %g2, %g1, %g3
93*0a6a1f1dSLionel Sambuc
94*0a6a1f1dSLionel Sambuc        ! CHECK:  udivcc %g2, %g1, %g3            ! encoding: [0x86,0xf0,0x80,0x01]
95*0a6a1f1dSLionel Sambuc        udivcc %g2, %g1, %g3
96*0a6a1f1dSLionel Sambuc
97*0a6a1f1dSLionel Sambuc        ! CHECK:  sdivcc %g2, %g1, %g3            ! encoding: [0x86,0xf8,0x80,0x01]
98*0a6a1f1dSLionel Sambuc        sdivcc %g2, %g1, %g3
99*0a6a1f1dSLionel Sambuc
100*0a6a1f1dSLionel Sambuc        ! CHECK:  andcc %g2, %g1, %g3             ! encoding: [0x86,0x88,0x80,0x01]
101*0a6a1f1dSLionel Sambuc        andcc %g2, %g1, %g3
102*0a6a1f1dSLionel Sambuc
103*0a6a1f1dSLionel Sambuc        ! CHECK:  andncc %g2, %g1, %g3            ! encoding: [0x86,0xa8,0x80,0x01]
104*0a6a1f1dSLionel Sambuc        andncc %g2, %g1, %g3
105*0a6a1f1dSLionel Sambuc
106*0a6a1f1dSLionel Sambuc        ! CHECK:  orcc %g2, %g1, %g3              ! encoding: [0x86,0x90,0x80,0x01]
107*0a6a1f1dSLionel Sambuc        orcc %g2, %g1, %g3
108*0a6a1f1dSLionel Sambuc
109*0a6a1f1dSLionel Sambuc        ! CHECK:  orncc %g2, %g1, %g3             ! encoding: [0x86,0xb0,0x80,0x01]
110*0a6a1f1dSLionel Sambuc        orncc %g2, %g1, %g3
111*0a6a1f1dSLionel Sambuc
112*0a6a1f1dSLionel Sambuc        ! CHECK:  xorcc %g2, %g1, %g3             ! encoding: [0x86,0x98,0x80,0x01]
113*0a6a1f1dSLionel Sambuc        xorcc %g2, %g1, %g3
114*0a6a1f1dSLionel Sambuc
115*0a6a1f1dSLionel Sambuc        ! CHECK:  xnorcc %g2, %g1, %g3            ! encoding: [0x86,0xb8,0x80,0x01]
116*0a6a1f1dSLionel Sambuc        xnorcc %g2, %g1, %g3
117*0a6a1f1dSLionel Sambuc
118*0a6a1f1dSLionel Sambuc        ! CHECK:  taddcc %g2, %g1, %g3            ! encoding: [0x87,0x00,0x80,0x01]
119*0a6a1f1dSLionel Sambuc        taddcc %g2, %g1, %g3
120*0a6a1f1dSLionel Sambuc
121*0a6a1f1dSLionel Sambuc        ! CHECK:  tsubcc %g2, %g1, %g3            ! encoding: [0x87,0x08,0x80,0x01]
122*0a6a1f1dSLionel Sambuc        tsubcc %g2, %g1, %g3
123*0a6a1f1dSLionel Sambuc
124*0a6a1f1dSLionel Sambuc        ! CHECK:  taddcctv %g2, %g1, %g3          ! encoding: [0x87,0x10,0x80,0x01]
125*0a6a1f1dSLionel Sambuc        taddcctv %g2, %g1, %g3
126*0a6a1f1dSLionel Sambuc
127*0a6a1f1dSLionel Sambuc        ! CHECK:  tsubcctv %g2, %g1, %g3          ! encoding: [0x87,0x18,0x80,0x01]
128*0a6a1f1dSLionel Sambuc        tsubcctv %g2, %g1, %g3
129