Lines Matching defs:gate

28 GateRef ConstantFolding::VisitGate(GateRef gate)
30 auto op = acc_.GetOpCode(gate);
33 return VisitADD(gate);
35 return VisitSUB(gate);
37 return VisitMUL(gate);
39 return VisitSMOD(gate);
41 return VisitUMOD(gate);
43 return VisitZEXT(gate);
49 GateRef ConstantFolding::VisitZEXT(GateRef gate)
51 auto input = acc_.GetValueIn(gate, 0);
52 if (acc_.GetMachineType(gate) == acc_.GetMachineType(input)) {
60 auto machineType = acc_.GetMachineType(gate);
76 GateRef ConstantFolding::VisitSMOD(GateRef gate)
78 auto left = acc_.GetValueIn(gate, 0);
79 auto right = acc_.GetValueIn(gate, 1);
80 if (!IsInt32Type(gate) || !IsInt32Type(left) || !IsInt32Type(right)) {
95 GateRef ConstantFolding::VisitUMOD(GateRef gate)
97 auto left = acc_.GetValueIn(gate, 0);
98 auto right = acc_.GetValueIn(gate, 1);
99 if (!IsInt32Type(gate) || !IsInt32Type(left) || !IsInt32Type(right)) {
114 GateRef ConstantFolding::VisitADD(GateRef gate)
116 auto left = acc_.GetValueIn(gate, 0);
117 auto right = acc_.GetValueIn(gate, 1);
118 if (!IsInt32Type(gate) || !IsInt32Type(left) || !IsInt32Type(right)) {
131 GateRef ConstantFolding::VisitSUB(GateRef gate)
133 auto left = acc_.GetValueIn(gate, 0);
134 auto right = acc_.GetValueIn(gate, 1);
135 if (!IsInt32Type(gate) || !IsInt32Type(left) || !IsInt32Type(right)) {
148 GateRef ConstantFolding::VisitMUL(GateRef gate)
150 auto left = acc_.GetValueIn(gate, 0);
151 auto right = acc_.GetValueIn(gate, 1);
152 if (!IsInt32Type(gate) || !IsInt32Type(left) || !IsInt32Type(right)) {
179 bool ConstantFolding::IsInt32Type(GateRef gate) const
181 return acc_.GetMachineType(gate) == MachineType::I32;