1 # RUN: llvm-mc -triple=hexagon -filetype=obj -o - %s | llvm-objdump -d - | FileCheck %s 2 # Hexagon Programmer's Reference Manual 11.10.2 XTYPE/BIT 3 4 # Count leading 5 # CHECK: 11 c0 54 88 6 r17 = clb(r21:20) 7 # CHECK: 51 c0 54 88 8 r17 = cl0(r21:20) 9 # CHECK: 91 c0 54 88 10 r17 = cl1(r21:20) 11 # CHECK: 11 c0 74 88 12 r17 = normamt(r21:20) 13 # CHECK: 51 d7 74 88 14 r17 = add(clb(r21:20), #23) 15 # CHECK: 11 d7 35 8c 16 r17 = add(clb(r21), #23) 17 # CHECK: 91 c0 15 8c 18 r17 = clb(r21) 19 # CHECK: b1 c0 15 8c 20 r17 = cl0(r21) 21 # CHECK: d1 c0 15 8c 22 r17 = cl1(r21) 23 # CHECK: f1 c0 15 8c 24 r17 = normamt(r21) 25 26 # Count population 27 # CHECK: 71 c0 74 88 28 r17 = popcount(r21:20) 29 30 # Count trailing 31 # CHECK: 51 c0 f4 88 32 r17 = ct0(r21:20) 33 # CHECK: 91 c0 f4 88 34 r17 = ct1(r21:20) 35 # CHECK: 91 c0 55 8c 36 r17 = ct0(r21) 37 # CHECK: b1 c0 55 8c 38 r17 = ct1(r21) 39 40 # Extract bitfield 41 # CHECK: f0 df 54 81 42 r17:16 = extractu(r21:20, #31, #23) 43 # CHECK: f0 df 54 8a 44 r17:16 = extract(r21:20, #31, #23) 45 # CHECK: f1 df 55 8d 46 r17 = extractu(r21, #31, #23) 47 # CHECK: f1 df d5 8d 48 r17 = extract(r21, #31, #23) 49 # CHECK: 10 de 14 c1 50 r17:16 = extractu(r21:20, r31:30) 51 # CHECK: 90 de d4 c1 52 r17:16 = extract(r21:20, r31:30) 53 # CHECK: 11 de 15 c9 54 r17 = extractu(r21, r31:30) 55 # CHECK: 51 de 15 c9 56 r17 = extract(r21, r31:30) 57 58 # Insert bitfield 59 # CHECK: f0 df 54 83 60 r17:16 = insert(r21:20, #31, #23) 61 # CHECK: f1 df 55 8f 62 r17 = insert(r21, #31, #23) 63 # CHECK: 11 de 15 c8 64 r17 = insert(r21, r31:30) 65 # CHECK: 10 de 14 ca 66 r17:16 = insert(r21:20, r31:30) 67 68 # Interleave/deinterleave 69 # CHECK: 90 c0 d4 80 70 r17:16 = deinterleave(r21:20) 71 # CHECK: b0 c0 d4 80 72 r17:16 = interleave(r21:20) 73 74 # Linear feedback-shift iteration 75 # CHECK: d0 de 94 c1 76 r17:16 = lfs(r21:20, r31:30) 77 78 # Masked parity 79 # CHECK: 11 de 14 d0 80 r17 = parity(r21:20, r31:30) 81 # CHECK: 11 df f5 d5 82 r17 = parity(r21, r31) 83 84 # Bit reverse 85 # CHECK: d0 c0 d4 80 86 r17:16 = brev(r21:20) 87 # CHECK: d1 c0 55 8c 88 r17 = brev(r21) 89 90 # Set/clear/toggle bit 91 # CHECK: 11 df d5 8c 92 r17 = setbit(r21, #31) 93 # CHECK: 31 df d5 8c 94 r17 = clrbit(r21, #31) 95 # CHECK: 51 df d5 8c 96 r17 = togglebit(r21, #31) 97 # CHECK: 11 df 95 c6 98 r17 = setbit(r21, r31) 99 # CHECK: 51 df 95 c6 100 r17 = clrbit(r21, r31) 101 # CHECK: 91 df 95 c6 102 r17 = togglebit(r21, r31) 103 104 # Split bitfield 105 # CHECK: 90 df d5 88 106 r17:16 = bitsplit(r21, #31) 107 # CHECK: 10 df 35 d4 108 r17:16 = bitsplit(r21, r31) 109 110 # Table index 111 # CHECK: f1 cd 15 87 112 r17 = tableidxb(r21, #7, #13):raw 113 # CHECK: f1 cd 55 87 114 r17 = tableidxh(r21, #7, #13):raw 115 # CHECK: f1 cd 95 87 116 r17 = tableidxw(r21, #7, #13):raw 117 # CHECK: f1 cd d5 87 118 r17 = tableidxd(r21, #7, #13):raw 119