1f4a2713aSLionel Sambuc// RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+neon -show-encoding < %s | FileCheck %s 2f4a2713aSLionel Sambuc 3f4a2713aSLionel Sambuc// Check that the assembler can handle the documented syntax for AArch64 4f4a2713aSLionel Sambuc 5f4a2713aSLionel Sambuc 6f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 7f4a2713aSLionel Sambuc// Vector Move Immediate Shifted 8f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 9f4a2713aSLionel Sambuc movi v0.2s, #1 10f4a2713aSLionel Sambuc movi v1.2s, #0 11f4a2713aSLionel Sambuc movi v15.2s, #1, lsl #8 12f4a2713aSLionel Sambuc movi v16.2s, #1, lsl #16 13f4a2713aSLionel Sambuc movi v31.2s, #1, lsl #24 14f4a2713aSLionel Sambuc movi v0.4s, #1 15f4a2713aSLionel Sambuc movi v0.4s, #1, lsl #8 16f4a2713aSLionel Sambuc movi v0.4s, #1, lsl #16 17f4a2713aSLionel Sambuc movi v0.4s, #1, lsl #24 18f4a2713aSLionel Sambuc movi v0.4h, #1 19f4a2713aSLionel Sambuc movi v0.4h, #1, lsl #8 20f4a2713aSLionel Sambuc movi v0.8h, #1 21f4a2713aSLionel Sambuc movi v0.8h, #1, lsl #8 22f4a2713aSLionel Sambuc 23*0a6a1f1dSLionel Sambuc// CHECK: movi v0.2s, #{{0x1|1}} // encoding: [0x20,0x04,0x00,0x0f] 24*0a6a1f1dSLionel Sambuc// CHECK: movi v1.2s, #{{0x0|0}} // encoding: [0x01,0x04,0x00,0x0f] 25*0a6a1f1dSLionel Sambuc// CHECK: movi v15.2s, #{{0x1|1}}, lsl #8 // encoding: [0x2f,0x24,0x00,0x0f] 26*0a6a1f1dSLionel Sambuc// CHECK: movi v16.2s, #{{0x1|1}}, lsl #16 // encoding: [0x30,0x44,0x00,0x0f] 27*0a6a1f1dSLionel Sambuc// CHECK: movi v31.2s, #{{0x1|1}}, lsl #24 // encoding: [0x3f,0x64,0x00,0x0f] 28*0a6a1f1dSLionel Sambuc// CHECK: movi v0.4s, #{{0x1|1}} // encoding: [0x20,0x04,0x00,0x4f] 29*0a6a1f1dSLionel Sambuc// CHECK: movi v0.4s, #{{0x1|1}}, lsl #8 // encoding: [0x20,0x24,0x00,0x4f] 30*0a6a1f1dSLionel Sambuc// CHECK: movi v0.4s, #{{0x1|1}}, lsl #16 // encoding: [0x20,0x44,0x00,0x4f] 31*0a6a1f1dSLionel Sambuc// CHECK: movi v0.4s, #{{0x1|1}}, lsl #24 // encoding: [0x20,0x64,0x00,0x4f] 32*0a6a1f1dSLionel Sambuc// CHECK: movi v0.4h, #{{0x1|1}} // encoding: [0x20,0x84,0x00,0x0f] 33*0a6a1f1dSLionel Sambuc// CHECK: movi v0.4h, #{{0x1|1}}, lsl #8 // encoding: [0x20,0xa4,0x00,0x0f] 34*0a6a1f1dSLionel Sambuc// CHECK: movi v0.8h, #{{0x1|1}} // encoding: [0x20,0x84,0x00,0x4f] 35*0a6a1f1dSLionel Sambuc// CHECK: movi v0.8h, #{{0x1|1}}, lsl #8 // encoding: [0x20,0xa4,0x00,0x4f] 36f4a2713aSLionel Sambuc 37f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 38f4a2713aSLionel Sambuc// Vector Move Inverted Immediate Shifted 39f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 40f4a2713aSLionel Sambuc mvni v0.2s, #1 41f4a2713aSLionel Sambuc mvni v1.2s, #0 42f4a2713aSLionel Sambuc mvni v0.2s, #1, lsl #8 43f4a2713aSLionel Sambuc mvni v0.2s, #1, lsl #16 44f4a2713aSLionel Sambuc mvni v0.2s, #1, lsl #24 45f4a2713aSLionel Sambuc mvni v0.4s, #1 46f4a2713aSLionel Sambuc mvni v15.4s, #1, lsl #8 47f4a2713aSLionel Sambuc mvni v16.4s, #1, lsl #16 48f4a2713aSLionel Sambuc mvni v31.4s, #1, lsl #24 49f4a2713aSLionel Sambuc mvni v0.4h, #1 50f4a2713aSLionel Sambuc mvni v0.4h, #1, lsl #8 51f4a2713aSLionel Sambuc mvni v0.8h, #1 52f4a2713aSLionel Sambuc mvni v0.8h, #1, lsl #8 53f4a2713aSLionel Sambuc 54*0a6a1f1dSLionel Sambuc// CHECK: mvni v0.2s, #{{0x1|1}} // encoding: [0x20,0x04,0x00,0x2f] 55*0a6a1f1dSLionel Sambuc// CHECK: mvni v1.2s, #{{0x0|0}} // encoding: [0x01,0x04,0x00,0x2f] 56*0a6a1f1dSLionel Sambuc// CHECK: mvni v0.2s, #{{0x1|1}}, lsl #8 // encoding: [0x20,0x24,0x00,0x2f] 57*0a6a1f1dSLionel Sambuc// CHECK: mvni v0.2s, #{{0x1|1}}, lsl #16 // encoding: [0x20,0x44,0x00,0x2f] 58*0a6a1f1dSLionel Sambuc// CHECK: mvni v0.2s, #{{0x1|1}}, lsl #24 // encoding: [0x20,0x64,0x00,0x2f] 59*0a6a1f1dSLionel Sambuc// CHECK: mvni v0.4s, #{{0x1|1}} // encoding: [0x20,0x04,0x00,0x6f] 60*0a6a1f1dSLionel Sambuc// CHECK: mvni v15.4s, #{{0x1|1}}, lsl #8 // encoding: [0x2f,0x24,0x00,0x6f] 61*0a6a1f1dSLionel Sambuc// CHECK: mvni v16.4s, #{{0x1|1}}, lsl #16 // encoding: [0x30,0x44,0x00,0x6f] 62*0a6a1f1dSLionel Sambuc// CHECK: mvni v31.4s, #{{0x1|1}}, lsl #24 // encoding: [0x3f,0x64,0x00,0x6f] 63*0a6a1f1dSLionel Sambuc// CHECK: mvni v0.4h, #{{0x1|1}} // encoding: [0x20,0x84,0x00,0x2f] 64*0a6a1f1dSLionel Sambuc// CHECK: mvni v0.4h, #{{0x1|1}}, lsl #8 // encoding: [0x20,0xa4,0x00,0x2f] 65*0a6a1f1dSLionel Sambuc// CHECK: mvni v0.8h, #{{0x1|1}} // encoding: [0x20,0x84,0x00,0x6f] 66*0a6a1f1dSLionel Sambuc// CHECK: mvni v0.8h, #{{0x1|1}}, lsl #8 // encoding: [0x20,0xa4,0x00,0x6f] 67f4a2713aSLionel Sambuc 68f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 69f4a2713aSLionel Sambuc// Vector Bitwise Bit Clear (AND NOT) - immediate 70f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 71f4a2713aSLionel Sambuc bic v0.2s, #1 72f4a2713aSLionel Sambuc bic v1.2s, #0 73f4a2713aSLionel Sambuc bic v0.2s, #1, lsl #8 74f4a2713aSLionel Sambuc bic v0.2s, #1, lsl #16 75f4a2713aSLionel Sambuc bic v0.2s, #1, lsl #24 76f4a2713aSLionel Sambuc bic v0.4s, #1 77f4a2713aSLionel Sambuc bic v0.4s, #1, lsl #8 78f4a2713aSLionel Sambuc bic v0.4s, #1, lsl #16 79f4a2713aSLionel Sambuc bic v0.4s, #1, lsl #24 80f4a2713aSLionel Sambuc bic v15.4h, #1 81f4a2713aSLionel Sambuc bic v16.4h, #1, lsl #8 82f4a2713aSLionel Sambuc bic v0.8h, #1 83f4a2713aSLionel Sambuc bic v31.8h, #1, lsl #8 84f4a2713aSLionel Sambuc 85*0a6a1f1dSLionel Sambuc// CHECK: bic v0.2s, #{{0x1|1}} // encoding: [0x20,0x14,0x00,0x2f] 86*0a6a1f1dSLionel Sambuc// CHECK: bic v1.2s, #{{0x0|0}} // encoding: [0x01,0x14,0x00,0x2f] 87*0a6a1f1dSLionel Sambuc// CHECK: bic v0.2s, #{{0x1|1}}, lsl #8 // encoding: [0x20,0x34,0x00,0x2f] 88*0a6a1f1dSLionel Sambuc// CHECK: bic v0.2s, #{{0x1|1}}, lsl #16 // encoding: [0x20,0x54,0x00,0x2f] 89*0a6a1f1dSLionel Sambuc// CHECK: bic v0.2s, #{{0x1|1}}, lsl #24 // encoding: [0x20,0x74,0x00,0x2f] 90*0a6a1f1dSLionel Sambuc// CHECK: bic v0.4s, #{{0x1|1}} // encoding: [0x20,0x14,0x00,0x6f] 91*0a6a1f1dSLionel Sambuc// CHECK: bic v0.4s, #{{0x1|1}}, lsl #8 // encoding: [0x20,0x34,0x00,0x6f] 92*0a6a1f1dSLionel Sambuc// CHECK: bic v0.4s, #{{0x1|1}}, lsl #16 // encoding: [0x20,0x54,0x00,0x6f] 93*0a6a1f1dSLionel Sambuc// CHECK: bic v0.4s, #{{0x1|1}}, lsl #24 // encoding: [0x20,0x74,0x00,0x6f] 94*0a6a1f1dSLionel Sambuc// CHECK: bic v15.4h, #{{0x1|1}} // encoding: [0x2f,0x94,0x00,0x2f] 95*0a6a1f1dSLionel Sambuc// CHECK: bic v16.4h, #{{0x1|1}}, lsl #8 // encoding: [0x30,0xb4,0x00,0x2f] 96*0a6a1f1dSLionel Sambuc// CHECK: bic v0.8h, #{{0x1|1}} // encoding: [0x20,0x94,0x00,0x6f] 97*0a6a1f1dSLionel Sambuc// CHECK: bic v31.8h, #{{0x1|1}}, lsl #8 // encoding: [0x3f,0xb4,0x00,0x6f] 98f4a2713aSLionel Sambuc 99f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 100f4a2713aSLionel Sambuc// Vector Bitwise OR - immedidate 101f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 102f4a2713aSLionel Sambuc orr v0.2s, #1 103f4a2713aSLionel Sambuc orr v1.2s, #0 104f4a2713aSLionel Sambuc orr v0.2s, #1, lsl #8 105f4a2713aSLionel Sambuc orr v0.2s, #1, lsl #16 106f4a2713aSLionel Sambuc orr v0.2s, #1, lsl #24 107f4a2713aSLionel Sambuc orr v0.4s, #1 108f4a2713aSLionel Sambuc orr v0.4s, #1, lsl #8 109f4a2713aSLionel Sambuc orr v0.4s, #1, lsl #16 110f4a2713aSLionel Sambuc orr v0.4s, #1, lsl #24 111f4a2713aSLionel Sambuc orr v31.4h, #1 112f4a2713aSLionel Sambuc orr v15.4h, #1, lsl #8 113f4a2713aSLionel Sambuc orr v0.8h, #1 114f4a2713aSLionel Sambuc orr v16.8h, #1, lsl #8 115f4a2713aSLionel Sambuc 116*0a6a1f1dSLionel Sambuc// CHECK: orr v0.2s, #{{0x1|1}} // encoding: [0x20,0x14,0x00,0x0f] 117*0a6a1f1dSLionel Sambuc// CHECK: orr v1.2s, #{{0x0|0}} // encoding: [0x01,0x14,0x00,0x0f] 118*0a6a1f1dSLionel Sambuc// CHECK: orr v0.2s, #{{0x1|1}}, lsl #8 // encoding: [0x20,0x34,0x00,0x0f] 119*0a6a1f1dSLionel Sambuc// CHECK: orr v0.2s, #{{0x1|1}}, lsl #16 // encoding: [0x20,0x54,0x00,0x0f] 120*0a6a1f1dSLionel Sambuc// CHECK: orr v0.2s, #{{0x1|1}}, lsl #24 // encoding: [0x20,0x74,0x00,0x0f] 121*0a6a1f1dSLionel Sambuc// CHECK: orr v0.4s, #{{0x1|1}} // encoding: [0x20,0x14,0x00,0x4f] 122*0a6a1f1dSLionel Sambuc// CHECK: orr v0.4s, #{{0x1|1}}, lsl #8 // encoding: [0x20,0x34,0x00,0x4f] 123*0a6a1f1dSLionel Sambuc// CHECK: orr v0.4s, #{{0x1|1}}, lsl #16 // encoding: [0x20,0x54,0x00,0x4f] 124*0a6a1f1dSLionel Sambuc// CHECK: orr v0.4s, #{{0x1|1}}, lsl #24 // encoding: [0x20,0x74,0x00,0x4f] 125*0a6a1f1dSLionel Sambuc// CHECK: orr v31.4h, #{{0x1|1}} // encoding: [0x3f,0x94,0x00,0x0f] 126*0a6a1f1dSLionel Sambuc// CHECK: orr v15.4h, #{{0x1|1}}, lsl #8 // encoding: [0x2f,0xb4,0x00,0x0f] 127*0a6a1f1dSLionel Sambuc// CHECK: orr v0.8h, #{{0x1|1}} // encoding: [0x20,0x94,0x00,0x4f] 128*0a6a1f1dSLionel Sambuc// CHECK: orr v16.8h, #{{0x1|1}}, lsl #8 // encoding: [0x30,0xb4,0x00,0x4f] 129f4a2713aSLionel Sambuc 130f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 131f4a2713aSLionel Sambuc// Vector Move Immediate Masked 132f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 133f4a2713aSLionel Sambuc movi v0.2s, #1, msl #8 134f4a2713aSLionel Sambuc movi v1.2s, #1, msl #16 135f4a2713aSLionel Sambuc movi v0.4s, #1, msl #8 136f4a2713aSLionel Sambuc movi v31.4s, #1, msl #16 137f4a2713aSLionel Sambuc 138*0a6a1f1dSLionel Sambuc// CHECK: movi v0.2s, #{{0x1|1}}, msl #8 // encoding: [0x20,0xc4,0x00,0x0f] 139*0a6a1f1dSLionel Sambuc// CHECK: movi v1.2s, #{{0x1|1}}, msl #16 // encoding: [0x21,0xd4,0x00,0x0f] 140*0a6a1f1dSLionel Sambuc// CHECK: movi v0.4s, #{{0x1|1}}, msl #8 // encoding: [0x20,0xc4,0x00,0x4f] 141*0a6a1f1dSLionel Sambuc// CHECK: movi v31.4s, #{{0x1|1}}, msl #16 // encoding: [0x3f,0xd4,0x00,0x4f] 142f4a2713aSLionel Sambuc 143f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 144f4a2713aSLionel Sambuc// Vector Move Inverted Immediate Masked 145f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 146f4a2713aSLionel Sambuc mvni v1.2s, #0x1, msl #8 147f4a2713aSLionel Sambuc mvni v0.2s, #0x1, msl #16 148f4a2713aSLionel Sambuc mvni v31.4s, #0x1, msl #8 149f4a2713aSLionel Sambuc mvni v0.4s, #0x1, msl #16 150f4a2713aSLionel Sambuc 151*0a6a1f1dSLionel Sambuc// CHECK: mvni v1.2s, #{{0x1|1}}, msl #8 // encoding: [0x21,0xc4,0x00,0x2f] 152*0a6a1f1dSLionel Sambuc// CHECK: mvni v0.2s, #{{0x1|1}}, msl #16 // encoding: [0x20,0xd4,0x00,0x2f] 153*0a6a1f1dSLionel Sambuc// CHECK: mvni v31.4s, #{{0x1|1}}, msl #8 // encoding: [0x3f,0xc4,0x00,0x6f] 154*0a6a1f1dSLionel Sambuc// CHECK: mvni v0.4s, #{{0x1|1}}, msl #16 // encoding: [0x20,0xd4,0x00,0x6f] 155f4a2713aSLionel Sambuc 156f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 157f4a2713aSLionel Sambuc// Vector Immediate - per byte 158f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 159f4a2713aSLionel Sambuc movi v0.8b, #0 160f4a2713aSLionel Sambuc movi v31.8b, #0xff 161f4a2713aSLionel Sambuc movi v15.16b, #0xf 162f4a2713aSLionel Sambuc movi v31.16b, #0x1f 163f4a2713aSLionel Sambuc 164*0a6a1f1dSLionel Sambuc// CHECK: movi v0.8b, #{{0x0|0}} // encoding: [0x00,0xe4,0x00,0x0f] 165*0a6a1f1dSLionel Sambuc// CHECK: movi v31.8b, #{{0xff|255}} // encoding: [0xff,0xe7,0x07,0x0f] 166*0a6a1f1dSLionel Sambuc// CHECK: movi v15.16b, #{{0xf|15}} // encoding: [0xef,0xe5,0x00,0x4f] 167*0a6a1f1dSLionel Sambuc// CHECK: movi v31.16b, #{{0x1f|31}} // encoding: [0xff,0xe7,0x00,0x4f] 168f4a2713aSLionel Sambuc 169f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 170f4a2713aSLionel Sambuc// Vector Move Immediate - bytemask, per doubleword 171f4a2713aSLionel Sambuc//--------------------------------------------------------------------- 172f4a2713aSLionel Sambuc movi v0.2d, #0xff00ff00ff00ff00 173f4a2713aSLionel Sambuc 174f4a2713aSLionel Sambuc// CHECK: movi v0.2d, #0xff00ff00ff00ff00 // encoding: [0x40,0xe5,0x05,0x6f] 175f4a2713aSLionel Sambuc 176f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 177f4a2713aSLionel Sambuc// Vector Move Immediate - bytemask, one doubleword 178f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 179f4a2713aSLionel Sambuc movi d0, #0xff00ff00ff00ff00 180f4a2713aSLionel Sambuc 181f4a2713aSLionel Sambuc// CHECK: movi d0, #0xff00ff00ff00ff00 // encoding: [0x40,0xe5,0x05,0x2f] 182f4a2713aSLionel Sambuc 183f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 184f4a2713aSLionel Sambuc// Vector Floating Point Move Immediate 185f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 186f4a2713aSLionel Sambuc fmov v1.2s, #1.0 187f4a2713aSLionel Sambuc fmov v15.4s, #1.0 188f4a2713aSLionel Sambuc fmov v31.2d, #1.0 189f4a2713aSLionel Sambuc 190*0a6a1f1dSLionel Sambuc// CHECK: fmov v1.2s, #{{1.00000000|1.000000e\+00}} // encoding: [0x01,0xf6,0x03,0x0f] 191*0a6a1f1dSLionel Sambuc// CHECK: fmov v15.4s, #{{1.00000000|1.000000e\+00}} // encoding: [0x0f,0xf6,0x03,0x4f] 192*0a6a1f1dSLionel Sambuc// CHECK: fmov v31.2d, #{{1.00000000|1.000000e\+00}} // encoding: [0x1f,0xf6,0x03,0x6f] 193f4a2713aSLionel Sambuc 194f4a2713aSLionel Sambuc 195f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 196f4a2713aSLionel Sambuc// Vector Move - register 197f4a2713aSLionel Sambuc//---------------------------------------------------------------------- 198f4a2713aSLionel Sambuc 199f4a2713aSLionel Sambuc mov v0.8b, v31.8b 200f4a2713aSLionel Sambuc mov v15.16b, v16.16b 201f4a2713aSLionel Sambuc orr v0.8b, v31.8b, v31.8b 202f4a2713aSLionel Sambuc orr v15.16b, v16.16b, v16.16b 203f4a2713aSLionel Sambuc 204*0a6a1f1dSLionel Sambuc// CHECK: mov v0.8b, v31.8b // encoding: [0xe0,0x1f,0xbf,0x0e] 205*0a6a1f1dSLionel Sambuc// CHECK: mov v15.16b, v16.16b // encoding: [0x0f,0x1e,0xb0,0x4e] 206*0a6a1f1dSLionel Sambuc// CHECK: mov v0.8b, v31.8b // encoding: [0xe0,0x1f,0xbf,0x0e] 207*0a6a1f1dSLionel Sambuc// CHECK: mov v15.16b, v16.16b // encoding: [0x0f,0x1e,0xb0,0x4e] 208f4a2713aSLionel Sambuc 209