136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines! RUN: llvm-mc %s -arch=sparc   -show-encoding | FileCheck %s
236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines! RUN: llvm-mc %s -arch=sparcv9 -show-encoding | FileCheck %s
336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: add %g0, %g0, %g0    ! encoding: [0x80,0x00,0x00,0x00]
536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        add %g0, %g0, %g0
636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: add %g1, %g2, %g3    ! encoding: [0x86,0x00,0x40,0x02]
736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        add %g1, %g2, %g3
836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: add %o0, %o1, %l0    ! encoding: [0xa0,0x02,0x00,0x09]
936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        add %r8, %r9, %l0
1036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: add %o0, 10,  %l0    ! encoding: [0xa0,0x02,0x20,0x0a]
1136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        add %o0, 10, %l0
1236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
1336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: addcc %g1, %g2, %g3  ! encoding: [0x86,0x80,0x40,0x02]
1436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        addcc %g1, %g2, %g3
1536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
1636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: addxcc %g1, %g2, %g3 ! encoding: [0x86,0xc0,0x40,0x02]
1736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        addxcc %g1, %g2, %g3
1836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
1936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: udiv %g1, %g2, %g3   ! encoding: [0x86,0x70,0x40,0x02]
2036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        udiv %g1, %g2, %g3
2136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
2236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: sdiv %g1, %g2, %g3   ! encoding: [0x86,0x78,0x40,0x02]
2336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        sdiv %g1, %g2, %g3
2436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
2536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: and %g1, %g2, %g3    ! encoding: [0x86,0x08,0x40,0x02]
2636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        and %g1, %g2, %g3
2736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: andn %g1, %g2, %g3   ! encoding: [0x86,0x28,0x40,0x02]
2836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        andn %g1, %g2, %g3
2936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: or %g1, %g2, %g3     ! encoding: [0x86,0x10,0x40,0x02]
3036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        or  %g1, %g2, %g3
3136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: orn %g1, %g2, %g3    ! encoding: [0x86,0x30,0x40,0x02]
3236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        orn %g1, %g2, %g3
3336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: xor %g1, %g2, %g3    ! encoding: [0x86,0x18,0x40,0x02]
3436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        xor %g1, %g2, %g3
3536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: xnor %g1, %g2, %g3   ! encoding: [0x86,0x38,0x40,0x02]
3636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        xnor %g1, %g2, %g3
3736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
3836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: umul %g1, %g2, %g3   ! encoding: [0x86,0x50,0x40,0x02]
3936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        umul %g1, %g2, %g3
4036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
4136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: smul %g1, %g2, %g3   ! encoding: [0x86,0x58,0x40,0x02]
4236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        smul %g1, %g2, %g3
4336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
4436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: nop                  ! encoding: [0x01,0x00,0x00,0x00]
4536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        nop
4636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
4736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: sethi 10, %l0        ! encoding: [0x21,0x00,0x00,0x0a]
4836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        sethi 10, %l0
4936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
5036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: sll %g1, %g2, %g3    ! encoding: [0x87,0x28,0x40,0x02]
5136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        sll %g1, %g2, %g3
5236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: sll %g1, 31, %g3     ! encoding: [0x87,0x28,0x60,0x1f]
5336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        sll %g1, 31, %g3
5436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
5536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: srl %g1, %g2, %g3    ! encoding: [0x87,0x30,0x40,0x02]
5636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        srl %g1, %g2, %g3
5736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: srl %g1, 31, %g3     ! encoding: [0x87,0x30,0x60,0x1f]
5836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        srl %g1, 31, %g3
5936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
6036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: sra %g1, %g2, %g3    ! encoding: [0x87,0x38,0x40,0x02]
6136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        sra %g1, %g2, %g3
6236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: sra %g1, 31, %g3     ! encoding: [0x87,0x38,0x60,0x1f]
6336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        sra %g1, 31, %g3
6436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
6536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: sub %g1, %g2, %g3    ! encoding: [0x86,0x20,0x40,0x02]
6636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        sub %g1, %g2, %g3
6736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: subcc %g1, %g2, %g3  ! encoding: [0x86,0xa0,0x40,0x02]
6836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        subcc %g1, %g2, %g3
6936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
7036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: subxcc %g1, %g2, %g3 ! encoding: [0x86,0xe0,0x40,0x02]
7136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        subxcc %g1, %g2, %g3
7236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
73dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines        ! CHECK: mov %g1, %g3     ! encoding: [0x86,0x10,0x00,0x01]
7436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        mov %g1, %g3
7536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
76dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines        ! CHECK: mov 255, %g3     ! encoding: [0x86,0x10,0x20,0xff]
7736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        mov 0xff, %g3
7836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
79f3ef5332fa3f4d5ec72c178a2b19dac363a19383Pirama Arumuga Nainar        ! CHECK: restore %g0, %g0, %g1           ! encoding: [0x83,0xe8,0x00,0x00]
80f3ef5332fa3f4d5ec72c178a2b19dac363a19383Pirama Arumuga Nainar        restore %g0, %g0, %g1
8136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
8236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK: addx %g2, %g1, %g3              ! encoding: [0x86,0x40,0x80,0x01]
8336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        addx %g2, %g1, %g3
8436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
8536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  subx %g2, %g1, %g3              ! encoding: [0x86,0x60,0x80,0x01]
8636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        subx %g2, %g1, %g3
8736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
8836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  umulcc %g2, %g1, %g3            ! encoding: [0x86,0xd0,0x80,0x01]
8936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        umulcc %g2, %g1, %g3
9036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
9136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  smulcc %g2, %g1, %g3            ! encoding: [0x86,0xd8,0x80,0x01]
9236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        smulcc %g2, %g1, %g3
9336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
94f3ef5332fa3f4d5ec72c178a2b19dac363a19383Pirama Arumuga Nainar        ! CHECK:  mulscc %g2, %g1, %g3            ! encoding: [0x87,0x20,0x80,0x01]
95f3ef5332fa3f4d5ec72c178a2b19dac363a19383Pirama Arumuga Nainar        mulscc %g2, %g1, %g3
96f3ef5332fa3f4d5ec72c178a2b19dac363a19383Pirama Arumuga Nainar
97f3ef5332fa3f4d5ec72c178a2b19dac363a19383Pirama Arumuga Nainar        ! CHECK:  mulscc %g2, 254, %g3            ! encoding: [0x87,0x20,0xa0,0xfe]
98f3ef5332fa3f4d5ec72c178a2b19dac363a19383Pirama Arumuga Nainar        mulscc %g2, 254, %g3
99f3ef5332fa3f4d5ec72c178a2b19dac363a19383Pirama Arumuga Nainar
10036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  udivcc %g2, %g1, %g3            ! encoding: [0x86,0xf0,0x80,0x01]
10136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        udivcc %g2, %g1, %g3
10236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
10336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  sdivcc %g2, %g1, %g3            ! encoding: [0x86,0xf8,0x80,0x01]
10436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        sdivcc %g2, %g1, %g3
10536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
10636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  andcc %g2, %g1, %g3             ! encoding: [0x86,0x88,0x80,0x01]
10736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        andcc %g2, %g1, %g3
10836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
10936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  andncc %g2, %g1, %g3            ! encoding: [0x86,0xa8,0x80,0x01]
11036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        andncc %g2, %g1, %g3
11136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
11236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  orcc %g2, %g1, %g3              ! encoding: [0x86,0x90,0x80,0x01]
11336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        orcc %g2, %g1, %g3
11436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
11536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  orncc %g2, %g1, %g3             ! encoding: [0x86,0xb0,0x80,0x01]
11636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        orncc %g2, %g1, %g3
11736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
11836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  xorcc %g2, %g1, %g3             ! encoding: [0x86,0x98,0x80,0x01]
11936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        xorcc %g2, %g1, %g3
12036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
12136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  xnorcc %g2, %g1, %g3            ! encoding: [0x86,0xb8,0x80,0x01]
12236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        xnorcc %g2, %g1, %g3
12336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
12436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  taddcc %g2, %g1, %g3            ! encoding: [0x87,0x00,0x80,0x01]
12536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        taddcc %g2, %g1, %g3
12636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
12736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  tsubcc %g2, %g1, %g3            ! encoding: [0x87,0x08,0x80,0x01]
12836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        tsubcc %g2, %g1, %g3
12936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
13036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  taddcctv %g2, %g1, %g3          ! encoding: [0x87,0x10,0x80,0x01]
13136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        taddcctv %g2, %g1, %g3
13236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines
13336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        ! CHECK:  tsubcctv %g2, %g1, %g3          ! encoding: [0x87,0x18,0x80,0x01]
13436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines        tsubcctv %g2, %g1, %g3
135