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
|
/* This file is part of the sirit project.
* Copyright (c) 2019 sirit
* This software may be used and distributed according to the terms of the
* 3-Clause BSD License
*/
#include "sirit/sirit.h"
#include "stream.h"
namespace Sirit {
Id Module::OpShiftRightLogical(Id result_type, Id base, Id shift) {
code->Reserve(5);
return *code << OpId{spv::Op::OpShiftRightLogical, result_type} << base << shift << EndOp{};
}
Id Module::OpShiftRightArithmetic(Id result_type, Id base, Id shift) {
code->Reserve(5);
return *code << OpId{spv::Op::OpShiftRightArithmetic, result_type} << base << shift << EndOp{};
}
Id Module::OpShiftLeftLogical(Id result_type, Id base, Id shift) {
code->Reserve(5);
return *code << OpId{spv::Op::OpShiftLeftLogical, result_type} << base << shift << EndOp{};
}
Id Module::OpBitwiseOr(Id result_type, Id operand_1, Id operand_2) {
code->Reserve(5);
return *code << OpId{spv::Op::OpBitwiseOr, result_type} << operand_1 << operand_2 << EndOp{};
}
Id Module::OpBitwiseXor(Id result_type, Id operand_1, Id operand_2) {
code->Reserve(5);
return *code << OpId{spv::Op::OpBitwiseXor, result_type} << operand_1 << operand_2 << EndOp{};
}
Id Module::OpBitwiseAnd(Id result_type, Id operand_1, Id operand_2) {
code->Reserve(5);
return *code << OpId{spv::Op::OpBitwiseAnd, result_type} << operand_1 << operand_2 << EndOp{};
}
Id Module::OpNot(Id result_type, Id operand) {
code->Reserve(4);
return *code << OpId{spv::Op::OpNot, result_type} << operand << EndOp{};
}
Id Module::OpBitFieldInsert(Id result_type, Id base, Id insert, Id offset, Id count) {
code->Reserve(7);
return *code << OpId{spv::Op::OpBitFieldInsert, result_type} << base << insert << offset
<< count << EndOp{};
}
Id Module::OpBitFieldSExtract(Id result_type, Id base, Id offset, Id count) {
code->Reserve(6);
return *code << OpId{spv::Op::OpBitFieldSExtract, result_type} << base << offset << count
<< EndOp{};
}
Id Module::OpBitFieldUExtract(Id result_type, Id base, Id offset, Id count) {
code->Reserve(6);
return *code << OpId{spv::Op::OpBitFieldUExtract, result_type} << base << offset << count
<< EndOp{};
}
Id Module::OpBitReverse(Id result_type, Id base) {
code->Reserve(4);
return *code << OpId{spv::Op::OpBitReverse, result_type} << base << EndOp{};
}
Id Module::OpBitCount(Id result_type, Id base) {
code->Reserve(4);
return *code << OpId{spv::Op::OpBitCount, result_type} << base << EndOp{};
}
} // namespace Sirit
|