1# RUN: llvm-mc -triple hexagon -disassemble < %s | FileCheck %s
2# Hexagon Programmer's Reference Manual 11.1.1 ALU32/ALU
3
4# Add
50xf1 0xc3 0x15 0xb0
6# CHECK: r17 = add(r21, #31)
70x11 0xdf 0x15 0xf3
8# CHECK: r17 = add(r21, r31)
90x11 0xdf 0x55 0xf6
10# CHECK: r17 = add(r21, r31):sat
11
12# And
130xf1 0xc3 0x15 0x76
14# CHECK: r17 = and(r21, #31)
150xf1 0xc3 0x95 0x76
16# CHECK: r17 = or(r21, #31)
170x11 0xdf 0x15 0xf1
18# CHECK: r17 = and(r21, r31)
190x11 0xdf 0x35 0xf1
20# CHECK: r17 = or(r21, r31)
210x11 0xdf 0x75 0xf1
22# CHECK: r17 = xor(r21, r31)
230x11 0xd5 0x9f 0xf1
24# CHECK: r17 = and(r21, ~r31)
250x11 0xd5 0xbf 0xf1
26# CHECK: r17 = or(r21, ~r31)
27
28# Nop
290x00 0xc0 0x00 0x7f
30# CHECK: nop
31
32# Subtract
330xb1 0xc2 0x5f 0x76
34# CHECK: r17 = sub(#21, r31)
350x11 0xdf 0x35 0xf3
36# CHECK: r17 = sub(r31, r21)
370x11 0xdf 0xd5 0xf6
38# CHECK: r17 = sub(r31, r21):sat
39
40# Sign extend
410x11 0xc0 0xbf 0x70
42# CHECK: r17 = sxtb(r31)
43
44# Transfer immediate
450x15 0xc0 0x31 0x72
46# CHECK: r17.h = #21
470x15 0xc0 0x31 0x71
48# CHECK: r17.l = #21
490xf1 0xff 0x5f 0x78
50# CHECK: r17 = #32767
510xf1 0xff 0xdf 0x78
52# CHECK: r17 = ##65535
53
54# Transfer register
550x11 0xc0 0x75 0x70
56# CHECK: r17 = r21
57
58# Vector add halfwords
590x11 0xdf 0x15 0xf6
60# CHECK: r17 = vaddh(r21, r31)
610x11 0xdf 0x35 0xf6
62# CHECK: r17 = vaddh(r21, r31):sat
630x11 0xdf 0x75 0xf6
64# CHECK: r17 = vadduh(r21, r31):sat
65
66# Vector average halfwords
670x11 0xdf 0x15 0xf7
68# CHECK: r17 = vavgh(r21, r31)
690x11 0xdf 0x35 0xf7
70# CHECK: r17 = vavgh(r21, r31):rnd
710x11 0xdf 0x75 0xf7
72# CHECK: r17 = vnavgh(r31, r21)
73
74# Vector subtract halfwords
750x11 0xdf 0x95 0xf6
76# CHECK: r17 = vsubh(r31, r21)
770x11 0xdf 0xb5 0xf6
78# CHECK: r17 = vsubh(r31, r21):sat
790x11 0xdf 0xf5 0xf6
80# CHECK: r17 = vsubuh(r31, r21):sat
81
82# Zero extend
830x11 0xc0 0xd5 0x70
84# CHECK: r17 = zxth(r21)
85