summaryrefslogtreecommitdiff
path: root/test/MC/AArch64/neon-scalar-cvt.s
blob: dc8e3165b6dd26a6ba214ee64ea395b902575433 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
// RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+neon -show-encoding < %s | FileCheck %s
// RUN: llvm-mc -triple arm64-none-linux-gnu -mattr=+neon -show-encoding < %s | FileCheck %s

// Check that the assembler can handle the documented syntax for AArch64

//----------------------------------------------------------------------
// Scalar Signed Integer Convert To Floating-point
//----------------------------------------------------------------------

    scvtf s22, s13
    scvtf d21, d12

// CHECK: scvtf s22, s13    // encoding: [0xb6,0xd9,0x21,0x5e]
// CHECK: scvtf d21, d12    // encoding: [0x95,0xd9,0x61,0x5e]

//----------------------------------------------------------------------
// Scalar Unsigned Integer Convert To Floating-point
//----------------------------------------------------------------------

    ucvtf s22, s13
    ucvtf d21, d14

// CHECK: ucvtf s22, s13    // encoding: [0xb6,0xd9,0x21,0x7e]
// CHECK: ucvtf d21, d14    // encoding: [0xd5,0xd9,0x61,0x7e]

//----------------------------------------------------------------------
// Scalar Signed Fixed-point Convert To Floating-Point (Immediate)
//----------------------------------------------------------------------

    scvtf s22, s13, #32
    scvtf d21, d12, #64

// CHECK: scvtf s22, s13, #32  // encoding: [0xb6,0xe5,0x20,0x5f]
// CHECK: scvtf d21, d12, #64  // encoding: [0x95,0xe5,0x40,0x5f]    

//----------------------------------------------------------------------
// Scalar Unsigned Fixed-point Convert To Floating-Point (Immediate)
//----------------------------------------------------------------------

    ucvtf s22, s13, #32
    ucvtf d21, d14, #64

// CHECK: ucvtf s22, s13, #32  // encoding: [0xb6,0xe5,0x20,0x7f]
// CHECK: ucvtf d21, d14, #64  // encoding: [0xd5,0xe5,0x40,0x7f]

//----------------------------------------------------------------------
// Scalar Floating-point Convert To Signed Fixed-point (Immediate)
//----------------------------------------------------------------------

    fcvtzs s21, s12, #1
    fcvtzs d21, d12, #1

// CHECK: fcvtzs s21, s12, #1  // encoding: [0x95,0xfd,0x3f,0x5f]
// CHECK: fcvtzs d21, d12, #1  // encoding: [0x95,0xfd,0x7f,0x5f]
        
//----------------------------------------------------------------------
// Scalar Floating-point Convert To Unsigned Fixed-point (Immediate)
//----------------------------------------------------------------------

    fcvtzu s21, s12, #1
    fcvtzu d21, d12, #1

// CHECK: fcvtzu s21, s12, #1  // encoding: [0x95,0xfd,0x3f,0x7f]
// CHECK: fcvtzu d21, d12, #1  // encoding: [0x95,0xfd,0x7f,0x7f]

//----------------------------------------------------------------------
// Scalar Floating-point Convert To Lower Precision Narrow, Rounding To
// Odd
//----------------------------------------------------------------------

    fcvtxn s22, d13

// CHECK: fcvtxn s22, d13    // encoding: [0xb6,0x69,0x61,0x7e]

//----------------------------------------------------------------------
// Scalar Floating-point Convert To Signed Integer, Rounding To Nearest
// With Ties To Away
//----------------------------------------------------------------------

    fcvtas s12, s13
    fcvtas d21, d14

// CHECK: fcvtas s12, s13    // encoding: [0xac,0xc9,0x21,0x5e]
// CHECK: fcvtas d21, d14    // encoding: [0xd5,0xc9,0x61,0x5e]

//----------------------------------------------------------------------
// Scalar Floating-point Convert To Unsigned Integer, Rounding To
// Nearest With Ties To Away
//----------------------------------------------------------------------

    fcvtau s12, s13
    fcvtau d21, d14

// CHECK: fcvtau s12, s13    // encoding: [0xac,0xc9,0x21,0x7e]
// CHECK: fcvtau d21, d14    // encoding: [0xd5,0xc9,0x61,0x7e]

//----------------------------------------------------------------------
// Scalar Floating-point Convert To Signed Integer, Rounding Toward
// Minus Infinity
//----------------------------------------------------------------------

    fcvtms s22, s13
    fcvtms d21, d14

// CHECK: fcvtms s22, s13    // encoding: [0xb6,0xb9,0x21,0x5e]
// CHECK: fcvtms d21, d14    // encoding: [0xd5,0xb9,0x61,0x5e]

//----------------------------------------------------------------------
// Scalar Floating-point Convert To Unsigned Integer, Rounding Toward
// Minus Infinity
//----------------------------------------------------------------------

    fcvtmu s12, s13
    fcvtmu d21, d14

// CHECK: fcvtmu s12, s13    // encoding: [0xac,0xb9,0x21,0x7e]
// CHECK: fcvtmu d21, d14    // encoding: [0xd5,0xb9,0x61,0x7e]

//----------------------------------------------------------------------
// Scalar Floating-point Convert To Signed Integer, Rounding To Nearest
// With Ties To Even
//----------------------------------------------------------------------

    fcvtns s22, s13
    fcvtns d21, d14

// CHECK: fcvtns s22, s13    // encoding: [0xb6,0xa9,0x21,0x5e]
// CHECK: fcvtns d21, d14    // encoding: [0xd5,0xa9,0x61,0x5e]

//----------------------------------------------------------------------
// Scalar Floating-point Convert To Unsigned Integer, Rounding To
// Nearest With Ties To Even
//----------------------------------------------------------------------

    fcvtnu s12, s13
    fcvtnu d21, d14

// CHECK: fcvtnu s12, s13    // encoding: [0xac,0xa9,0x21,0x7e]
// CHECK: fcvtnu d21, d14    // encoding: [0xd5,0xa9,0x61,0x7e]
        
//----------------------------------------------------------------------
// Scalar Floating-point Convert To Signed Integer, Rounding Toward
// Positive Infinity
//----------------------------------------------------------------------

    fcvtps s22, s13
    fcvtps d21, d14

// CHECK: fcvtps s22, s13    // encoding: [0xb6,0xa9,0xa1,0x5e]
// CHECK: fcvtps d21, d14    // encoding: [0xd5,0xa9,0xe1,0x5e]
        
//----------------------------------------------------------------------
// Scalar Floating-point Convert To Unsigned Integer, Rounding Toward
// Positive Infinity
//----------------------------------------------------------------------

    fcvtpu s12, s13
    fcvtpu d21, d14

// CHECK: fcvtpu s12, s13    // encoding: [0xac,0xa9,0xa1,0x7e]
// CHECK: fcvtpu d21, d14    // encoding: [0xd5,0xa9,0xe1,0x7e]

//----------------------------------------------------------------------
// Scalar Floating-point Convert To Signed Integer, Rounding Toward Zero
//----------------------------------------------------------------------

    fcvtzs s12, s13
    fcvtzs d21, d14

// CHECK: fcvtzs s12, s13    // encoding: [0xac,0xb9,0xa1,0x5e]
// CHECK: fcvtzs d21, d14    // encoding: [0xd5,0xb9,0xe1,0x5e]
        
//----------------------------------------------------------------------
// Scalar Floating-point Convert To Unsigned Integer, Rounding Toward 
// Zero
//----------------------------------------------------------------------

    fcvtzu s12, s13
    fcvtzu d21, d14

// CHECK: fcvtzu s12, s13    // encoding: [0xac,0xb9,0xa1,0x7e]
// CHECK: fcvtzu d21, d14    // encoding: [0xd5,0xb9,0xe1,0x7e]