sljit-sys 0.4.0

System crate for sljit using bindgen and ast-grep
Documentation
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
impl Compiler {
    #[inline(always)]
    pub fn emit_const(
        &mut self,
        op: sljit_s32,
        dst: sljit_s32,
        dstw: sljit_sw,
        init_value: sljit_sw,
    ) -> Constant {
        unsafe { sljit_emit_const(self.0, op, dst, dstw, init_value) }.into()
    }
    #[inline(always)]
    pub fn get_first_const(&mut self) -> Constant {
        unsafe { sljit_get_first_const(self.0) }.into()
    }
    #[inline(always)]
    pub fn emit_label(&mut self) -> Label {
        unsafe { sljit_emit_label(self.0) }.into()
    }
    #[inline(always)]
    pub fn emit_aligned_label(
        &mut self,
        alignment: sljit_s32,
        buffers: *mut sljit_read_only_buffer,
    ) -> Label {
        unsafe { sljit_emit_aligned_label(self.0, alignment, buffers) }.into()
    }
    #[inline(always)]
    pub fn get_first_label(&mut self) -> Label {
        unsafe { sljit_get_first_label(self.0) }.into()
    }
    #[inline(always)]
    pub fn set_compiler_memory_error(&mut self) {
        unsafe { sljit_set_compiler_memory_error(self.0) }
    }
    #[inline(always)]
    pub fn compiler_set_user_data(&mut self, user_data: *mut ::core::ffi::c_void) {
        unsafe { sljit_compiler_set_user_data(self.0, user_data) }
    }
    #[inline(always)]
    pub fn set_current_flags(&mut self, current_flags: sljit_s32) {
        unsafe { sljit_set_current_flags(self.0, current_flags) }
    }
    #[inline(always)]
    pub fn get_compiler_error(&mut self) -> sljit_s32 {
        unsafe { sljit_get_compiler_error(self.0) }
    }
    #[inline(always)]
    pub fn alloc_memory(&mut self, size: sljit_s32) -> *mut ::core::ffi::c_void {
        unsafe { sljit_alloc_memory(self.0, size) }
    }
    #[inline(always)]
    pub fn compiler_get_allocator_data(&mut self) -> *mut ::core::ffi::c_void {
        unsafe { sljit_compiler_get_allocator_data(self.0) }
    }
    #[inline(always)]
    pub fn compiler_get_user_data(&mut self) -> *mut ::core::ffi::c_void {
        unsafe { sljit_compiler_get_user_data(self.0) }
    }
    #[inline(always)]
    pub fn get_executable_offset(&mut self) -> sljit_sw {
        unsafe { sljit_get_executable_offset(self.0) }
    }
    #[inline(always)]
    pub fn get_generated_code_size(&mut self) -> sljit_uw {
        unsafe { sljit_get_generated_code_size(self.0) }
    }
    #[inline(always)]
    pub fn emit_enter(
        &mut self,
        options: sljit_s32,
        arg_types: sljit_s32,
        scratches: sljit_s32,
        saveds: sljit_s32,
        local_size: sljit_s32,
    ) -> sljit_s32 {
        unsafe { sljit_emit_enter(self.0, options, arg_types, scratches, saveds, local_size) }
    }
    #[inline(always)]
    pub fn set_context(
        &mut self,
        options: sljit_s32,
        arg_types: sljit_s32,
        scratches: sljit_s32,
        saveds: sljit_s32,
        local_size: sljit_s32,
    ) -> sljit_s32 {
        unsafe { sljit_set_context(self.0, options, arg_types, scratches, saveds, local_size) }
    }
    #[inline(always)]
    pub fn emit_return_void(&mut self) -> sljit_s32 {
        unsafe { sljit_emit_return_void(self.0) }
    }
    #[inline(always)]
    pub fn emit_return(&mut self, op: sljit_s32, src: sljit_s32, srcw: sljit_sw) -> sljit_s32 {
        unsafe { sljit_emit_return(self.0, op, src, srcw) }
    }
    #[inline(always)]
    pub fn emit_return_to(&mut self, src: sljit_s32, srcw: sljit_sw) -> sljit_s32 {
        unsafe { sljit_emit_return_to(self.0, src, srcw) }
    }
    #[inline(always)]
    pub fn emit_op0(&mut self, op: sljit_s32) -> sljit_s32 {
        unsafe { sljit_emit_op0(self.0, op) }
    }
    #[inline(always)]
    pub fn emit_op1(
        &mut self,
        op: sljit_s32,
        dst: sljit_s32,
        dstw: sljit_sw,
        src: sljit_s32,
        srcw: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_op1(self.0, op, dst, dstw, src, srcw) }
    }
    #[inline(always)]
    pub fn emit_op2(
        &mut self,
        op: sljit_s32,
        dst: sljit_s32,
        dstw: sljit_sw,
        src1: sljit_s32,
        src1w: sljit_sw,
        src2: sljit_s32,
        src2w: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_op2(self.0, op, dst, dstw, src1, src1w, src2, src2w) }
    }
    #[inline(always)]
    pub fn emit_op2u(
        &mut self,
        op: sljit_s32,
        src1: sljit_s32,
        src1w: sljit_sw,
        src2: sljit_s32,
        src2w: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_op2u(self.0, op, src1, src1w, src2, src2w) }
    }
    #[inline(always)]
    pub fn emit_op2r(
        &mut self,
        op: sljit_s32,
        dst_reg: sljit_s32,
        src1: sljit_s32,
        src1w: sljit_sw,
        src2: sljit_s32,
        src2w: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_op2r(self.0, op, dst_reg, src1, src1w, src2, src2w) }
    }
    #[inline(always)]
    pub fn emit_shift_into(
        &mut self,
        op: sljit_s32,
        dst_reg: sljit_s32,
        src1_reg: sljit_s32,
        src2_reg: sljit_s32,
        src3: sljit_s32,
        src3w: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_shift_into(self.0, op, dst_reg, src1_reg, src2_reg, src3, src3w) }
    }
    #[inline(always)]
    pub fn emit_op_src(&mut self, op: sljit_s32, src: sljit_s32, srcw: sljit_sw) -> sljit_s32 {
        unsafe { sljit_emit_op_src(self.0, op, src, srcw) }
    }
    #[inline(always)]
    pub fn emit_op_dst(&mut self, op: sljit_s32, dst: sljit_s32, dstw: sljit_sw) -> sljit_s32 {
        unsafe { sljit_emit_op_dst(self.0, op, dst, dstw) }
    }
    #[inline(always)]
    pub fn emit_fop1(
        &mut self,
        op: sljit_s32,
        dst: sljit_s32,
        dstw: sljit_sw,
        src: sljit_s32,
        srcw: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_fop1(self.0, op, dst, dstw, src, srcw) }
    }
    #[inline(always)]
    pub fn emit_fop2(
        &mut self,
        op: sljit_s32,
        dst: sljit_s32,
        dstw: sljit_sw,
        src1: sljit_s32,
        src1w: sljit_sw,
        src2: sljit_s32,
        src2w: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_fop2(self.0, op, dst, dstw, src1, src1w, src2, src2w) }
    }
    #[inline(always)]
    pub fn emit_fop2r(
        &mut self,
        op: sljit_s32,
        dst_freg: sljit_s32,
        src1: sljit_s32,
        src1w: sljit_sw,
        src2: sljit_s32,
        src2w: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_fop2r(self.0, op, dst_freg, src1, src1w, src2, src2w) }
    }
    #[inline(always)]
    pub fn emit_fset32(&mut self, freg: sljit_s32, value: sljit_f32) -> sljit_s32 {
        unsafe { sljit_emit_fset32(self.0, freg, value) }
    }
    #[inline(always)]
    pub fn emit_fset64(&mut self, freg: sljit_s32, value: sljit_f64) -> sljit_s32 {
        unsafe { sljit_emit_fset64(self.0, freg, value) }
    }
    #[inline(always)]
    pub fn emit_fcopy(&mut self, op: sljit_s32, freg: sljit_s32, reg: sljit_s32) -> sljit_s32 {
        unsafe { sljit_emit_fcopy(self.0, op, freg, reg) }
    }
    #[inline(always)]
    pub fn emit_ijump(&mut self, type_: sljit_s32, src: sljit_s32, srcw: sljit_sw) -> sljit_s32 {
        unsafe { sljit_emit_ijump(self.0, type_, src, srcw) }
    }
    #[inline(always)]
    pub fn emit_icall(
        &mut self,
        type_: sljit_s32,
        arg_types: sljit_s32,
        src: sljit_s32,
        srcw: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_icall(self.0, type_, arg_types, src, srcw) }
    }
    #[inline(always)]
    pub fn emit_op_flags(
        &mut self,
        op: sljit_s32,
        dst: sljit_s32,
        dstw: sljit_sw,
        type_: sljit_s32,
    ) -> sljit_s32 {
        unsafe { sljit_emit_op_flags(self.0, op, dst, dstw, type_) }
    }
    #[inline(always)]
    pub fn emit_select(
        &mut self,
        type_: sljit_s32,
        dst_reg: sljit_s32,
        src1: sljit_s32,
        src1w: sljit_sw,
        src2_reg: sljit_s32,
    ) -> sljit_s32 {
        unsafe { sljit_emit_select(self.0, type_, dst_reg, src1, src1w, src2_reg) }
    }
    #[inline(always)]
    pub fn emit_fselect(
        &mut self,
        type_: sljit_s32,
        dst_freg: sljit_s32,
        src1: sljit_s32,
        src1w: sljit_sw,
        src2_freg: sljit_s32,
    ) -> sljit_s32 {
        unsafe { sljit_emit_fselect(self.0, type_, dst_freg, src1, src1w, src2_freg) }
    }
    #[inline(always)]
    pub fn emit_mem(
        &mut self,
        type_: sljit_s32,
        reg: sljit_s32,
        mem: sljit_s32,
        memw: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_mem(self.0, type_, reg, mem, memw) }
    }
    #[inline(always)]
    pub fn emit_mem_update(
        &mut self,
        type_: sljit_s32,
        reg: sljit_s32,
        mem: sljit_s32,
        memw: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_mem_update(self.0, type_, reg, mem, memw) }
    }
    #[inline(always)]
    pub fn emit_fmem(
        &mut self,
        type_: sljit_s32,
        freg: sljit_s32,
        mem: sljit_s32,
        memw: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_fmem(self.0, type_, freg, mem, memw) }
    }
    #[inline(always)]
    pub fn emit_fmem_update(
        &mut self,
        type_: sljit_s32,
        freg: sljit_s32,
        mem: sljit_s32,
        memw: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_fmem_update(self.0, type_, freg, mem, memw) }
    }
    #[inline(always)]
    pub fn emit_simd_mov(
        &mut self,
        type_: sljit_s32,
        vreg: sljit_s32,
        srcdst: sljit_s32,
        srcdstw: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_simd_mov(self.0, type_, vreg, srcdst, srcdstw) }
    }
    #[inline(always)]
    pub fn emit_simd_replicate(
        &mut self,
        type_: sljit_s32,
        vreg: sljit_s32,
        src: sljit_s32,
        srcw: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_simd_replicate(self.0, type_, vreg, src, srcw) }
    }
    #[inline(always)]
    pub fn emit_simd_lane_mov(
        &mut self,
        type_: sljit_s32,
        vreg: sljit_s32,
        lane_index: sljit_s32,
        srcdst: sljit_s32,
        srcdstw: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_simd_lane_mov(self.0, type_, vreg, lane_index, srcdst, srcdstw) }
    }
    #[inline(always)]
    pub fn emit_simd_lane_replicate(
        &mut self,
        type_: sljit_s32,
        vreg: sljit_s32,
        src: sljit_s32,
        src_lane_index: sljit_s32,
    ) -> sljit_s32 {
        unsafe { sljit_emit_simd_lane_replicate(self.0, type_, vreg, src, src_lane_index) }
    }
    #[inline(always)]
    pub fn emit_simd_extend(
        &mut self,
        type_: sljit_s32,
        vreg: sljit_s32,
        src: sljit_s32,
        srcw: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_simd_extend(self.0, type_, vreg, src, srcw) }
    }
    #[inline(always)]
    pub fn emit_simd_sign(
        &mut self,
        type_: sljit_s32,
        vreg: sljit_s32,
        dst: sljit_s32,
        dstw: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_simd_sign(self.0, type_, vreg, dst, dstw) }
    }
    #[inline(always)]
    pub fn emit_simd_op2(
        &mut self,
        type_: sljit_s32,
        dst_vreg: sljit_s32,
        src1_vreg: sljit_s32,
        src2: sljit_s32,
        src2w: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_emit_simd_op2(self.0, type_, dst_vreg, src1_vreg, src2, src2w) }
    }
    #[inline(always)]
    pub fn emit_atomic_load(
        &mut self,
        op: sljit_s32,
        dst_reg: sljit_s32,
        mem_reg: sljit_s32,
    ) -> sljit_s32 {
        unsafe { sljit_emit_atomic_load(self.0, op, dst_reg, mem_reg) }
    }
    #[inline(always)]
    pub fn emit_atomic_store(
        &mut self,
        op: sljit_s32,
        src_reg: sljit_s32,
        mem_reg: sljit_s32,
        temp_reg: sljit_s32,
    ) -> sljit_s32 {
        unsafe { sljit_emit_atomic_store(self.0, op, src_reg, mem_reg, temp_reg) }
    }
    #[inline(always)]
    pub fn get_local_base(
        &mut self,
        dst: sljit_s32,
        dstw: sljit_sw,
        offset: sljit_sw,
    ) -> sljit_s32 {
        unsafe { sljit_get_local_base(self.0, dst, dstw, offset) }
    }
    #[inline(always)]
    pub fn emit_op_custom(
        &mut self,
        instruction: *mut ::core::ffi::c_void,
        size: sljit_u32,
    ) -> sljit_s32 {
        unsafe { sljit_emit_op_custom(self.0, instruction, size) }
    }
    #[inline(always)]
    pub fn serialize_compiler(&mut self, options: sljit_s32, size: *mut sljit_uw) -> *mut sljit_uw {
        unsafe { sljit_serialize_compiler(self.0, options, size) }
    }
    #[inline(always)]
    pub fn emit_jump(&mut self, type_: sljit_s32) -> Jump {
        unsafe { sljit_emit_jump(self.0, type_) }.into()
    }
    #[inline(always)]
    pub fn emit_call(&mut self, type_: sljit_s32, arg_types: sljit_s32) -> Jump {
        unsafe { sljit_emit_call(self.0, type_, arg_types) }.into()
    }
    #[inline(always)]
    pub fn emit_cmp(
        &mut self,
        type_: sljit_s32,
        src1: sljit_s32,
        src1w: sljit_sw,
        src2: sljit_s32,
        src2w: sljit_sw,
    ) -> Jump {
        unsafe { sljit_emit_cmp(self.0, type_, src1, src1w, src2, src2w) }.into()
    }
    #[inline(always)]
    pub fn emit_fcmp(
        &mut self,
        type_: sljit_s32,
        src1: sljit_s32,
        src1w: sljit_sw,
        src2: sljit_s32,
        src2w: sljit_sw,
    ) -> Jump {
        unsafe { sljit_emit_fcmp(self.0, type_, src1, src1w, src2, src2w) }.into()
    }
    #[inline(always)]
    pub fn emit_op2cmpz(
        &mut self,
        op: sljit_s32,
        dst: sljit_s32,
        dstw: sljit_sw,
        src1: sljit_s32,
        src1w: sljit_sw,
        src2: sljit_s32,
        src2w: sljit_sw,
    ) -> Jump {
        unsafe { sljit_emit_op2cmpz(self.0, op, dst, dstw, src1, src1w, src2, src2w) }.into()
    }
    #[inline(always)]
    pub fn emit_op_addr(&mut self, op: sljit_s32, dst: sljit_s32, dstw: sljit_sw) -> Jump {
        unsafe { sljit_emit_op_addr(self.0, op, dst, dstw) }.into()
    }
    #[inline(always)]
    pub fn get_first_jump(&mut self) -> Jump {
        unsafe { sljit_get_first_jump(self.0) }.into()
    }
}