[ARM64] Port basic-a64-diagnostics.s over to ARM64
[oota-llvm.git] / test / MC / AArch64 / neon-scalar-cvt.s
1 // RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+neon -show-encoding < %s | FileCheck %s
2 // RUN: llvm-mc -triple arm64-none-linux-gnu -mattr=+neon -show-encoding < %s | FileCheck %s
3
4 // Check that the assembler can handle the documented syntax for AArch64
5
6 //----------------------------------------------------------------------
7 // Scalar Signed Integer Convert To Floating-point
8 //----------------------------------------------------------------------
9
10     scvtf s22, s13
11     scvtf d21, d12
12
13 // CHECK: scvtf s22, s13    // encoding: [0xb6,0xd9,0x21,0x5e]
14 // CHECK: scvtf d21, d12    // encoding: [0x95,0xd9,0x61,0x5e]
15
16 //----------------------------------------------------------------------
17 // Scalar Unsigned Integer Convert To Floating-point
18 //----------------------------------------------------------------------
19
20     ucvtf s22, s13
21     ucvtf d21, d14
22
23 // CHECK: ucvtf s22, s13    // encoding: [0xb6,0xd9,0x21,0x7e]
24 // CHECK: ucvtf d21, d14    // encoding: [0xd5,0xd9,0x61,0x7e]
25
26 //----------------------------------------------------------------------
27 // Scalar Signed Fixed-point Convert To Floating-Point (Immediate)
28 //----------------------------------------------------------------------
29
30     scvtf s22, s13, #32
31     scvtf d21, d12, #64
32
33 // CHECK: scvtf s22, s13, #32  // encoding: [0xb6,0xe5,0x20,0x5f]
34 // CHECK: scvtf d21, d12, #64  // encoding: [0x95,0xe5,0x40,0x5f]    
35
36 //----------------------------------------------------------------------
37 // Scalar Unsigned Fixed-point Convert To Floating-Point (Immediate)
38 //----------------------------------------------------------------------
39
40     ucvtf s22, s13, #32
41     ucvtf d21, d14, #64
42
43 // CHECK: ucvtf s22, s13, #32  // encoding: [0xb6,0xe5,0x20,0x7f]
44 // CHECK: ucvtf d21, d14, #64  // encoding: [0xd5,0xe5,0x40,0x7f]
45
46 //----------------------------------------------------------------------
47 // Scalar Floating-point Convert To Signed Fixed-point (Immediate)
48 //----------------------------------------------------------------------
49
50     fcvtzs s21, s12, #1
51     fcvtzs d21, d12, #1
52
53 // CHECK: fcvtzs s21, s12, #1  // encoding: [0x95,0xfd,0x3f,0x5f]
54 // CHECK: fcvtzs d21, d12, #1  // encoding: [0x95,0xfd,0x7f,0x5f]
55         
56 //----------------------------------------------------------------------
57 // Scalar Floating-point Convert To Unsigned Fixed-point (Immediate)
58 //----------------------------------------------------------------------
59
60     fcvtzu s21, s12, #1
61     fcvtzu d21, d12, #1
62
63 // CHECK: fcvtzu s21, s12, #1  // encoding: [0x95,0xfd,0x3f,0x7f]
64 // CHECK: fcvtzu d21, d12, #1  // encoding: [0x95,0xfd,0x7f,0x7f]
65
66 //----------------------------------------------------------------------
67 // Scalar Floating-point Convert To Lower Precision Narrow, Rounding To
68 // Odd
69 //----------------------------------------------------------------------
70
71     fcvtxn s22, d13
72
73 // CHECK: fcvtxn s22, d13    // encoding: [0xb6,0x69,0x61,0x7e]
74
75 //----------------------------------------------------------------------
76 // Scalar Floating-point Convert To Signed Integer, Rounding To Nearest
77 // With Ties To Away
78 //----------------------------------------------------------------------
79
80     fcvtas s12, s13
81     fcvtas d21, d14
82
83 // CHECK: fcvtas s12, s13    // encoding: [0xac,0xc9,0x21,0x5e]
84 // CHECK: fcvtas d21, d14    // encoding: [0xd5,0xc9,0x61,0x5e]
85
86 //----------------------------------------------------------------------
87 // Scalar Floating-point Convert To Unsigned Integer, Rounding To
88 // Nearest With Ties To Away
89 //----------------------------------------------------------------------
90
91     fcvtau s12, s13
92     fcvtau d21, d14
93
94 // CHECK: fcvtau s12, s13    // encoding: [0xac,0xc9,0x21,0x7e]
95 // CHECK: fcvtau d21, d14    // encoding: [0xd5,0xc9,0x61,0x7e]
96
97 //----------------------------------------------------------------------
98 // Scalar Floating-point Convert To Signed Integer, Rounding Toward
99 // Minus Infinity
100 //----------------------------------------------------------------------
101
102     fcvtms s22, s13
103     fcvtms d21, d14
104
105 // CHECK: fcvtms s22, s13    // encoding: [0xb6,0xb9,0x21,0x5e]
106 // CHECK: fcvtms d21, d14    // encoding: [0xd5,0xb9,0x61,0x5e]
107
108 //----------------------------------------------------------------------
109 // Scalar Floating-point Convert To Unsigned Integer, Rounding Toward
110 // Minus Infinity
111 //----------------------------------------------------------------------
112
113     fcvtmu s12, s13
114     fcvtmu d21, d14
115
116 // CHECK: fcvtmu s12, s13    // encoding: [0xac,0xb9,0x21,0x7e]
117 // CHECK: fcvtmu d21, d14    // encoding: [0xd5,0xb9,0x61,0x7e]
118
119 //----------------------------------------------------------------------
120 // Scalar Floating-point Convert To Signed Integer, Rounding To Nearest
121 // With Ties To Even
122 //----------------------------------------------------------------------
123
124     fcvtns s22, s13
125     fcvtns d21, d14
126
127 // CHECK: fcvtns s22, s13    // encoding: [0xb6,0xa9,0x21,0x5e]
128 // CHECK: fcvtns d21, d14    // encoding: [0xd5,0xa9,0x61,0x5e]
129
130 //----------------------------------------------------------------------
131 // Scalar Floating-point Convert To Unsigned Integer, Rounding To
132 // Nearest With Ties To Even
133 //----------------------------------------------------------------------
134
135     fcvtnu s12, s13
136     fcvtnu d21, d14
137
138 // CHECK: fcvtnu s12, s13    // encoding: [0xac,0xa9,0x21,0x7e]
139 // CHECK: fcvtnu d21, d14    // encoding: [0xd5,0xa9,0x61,0x7e]
140         
141 //----------------------------------------------------------------------
142 // Scalar Floating-point Convert To Signed Integer, Rounding Toward
143 // Positive Infinity
144 //----------------------------------------------------------------------
145
146     fcvtps s22, s13
147     fcvtps d21, d14
148
149 // CHECK: fcvtps s22, s13    // encoding: [0xb6,0xa9,0xa1,0x5e]
150 // CHECK: fcvtps d21, d14    // encoding: [0xd5,0xa9,0xe1,0x5e]
151         
152 //----------------------------------------------------------------------
153 // Scalar Floating-point Convert To Unsigned Integer, Rounding Toward
154 // Positive Infinity
155 //----------------------------------------------------------------------
156
157     fcvtpu s12, s13
158     fcvtpu d21, d14
159
160 // CHECK: fcvtpu s12, s13    // encoding: [0xac,0xa9,0xa1,0x7e]
161 // CHECK: fcvtpu d21, d14    // encoding: [0xd5,0xa9,0xe1,0x7e]
162
163 //----------------------------------------------------------------------
164 // Scalar Floating-point Convert To Signed Integer, Rounding Toward Zero
165 //----------------------------------------------------------------------
166
167     fcvtzs s12, s13
168     fcvtzs d21, d14
169
170 // CHECK: fcvtzs s12, s13    // encoding: [0xac,0xb9,0xa1,0x5e]
171 // CHECK: fcvtzs d21, d14    // encoding: [0xd5,0xb9,0xe1,0x5e]
172         
173 //----------------------------------------------------------------------
174 // Scalar Floating-point Convert To Unsigned Integer, Rounding Toward 
175 // Zero
176 //----------------------------------------------------------------------
177
178     fcvtzu s12, s13
179     fcvtzu d21, d14
180
181 // CHECK: fcvtzu s12, s13    // encoding: [0xac,0xb9,0xa1,0x7e]
182 // CHECK: fcvtzu d21, d14    // encoding: [0xd5,0xb9,0xe1,0x7e]