MCPcopy Create free account
hub / github.com/beefytech/Beef / EmitUnaryOp

Method EmitUnaryOp

IDEHelper/Compiler/CeMachine.cpp:1337–1369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1335}
1336
1337void CeBuilder::EmitUnaryOp(CeOp iOp, CeOp fOp, const CeOperand& val, CeOperand& result)
1338{
1339 CeOp op = iOp;
1340 if (val.mType->IsIntable())
1341 {
1342 if (val.mType->mSize == 1)
1343 op = iOp;
1344 else if (val.mType->mSize == 2)
1345 op = (CeOp)(iOp + 1);
1346 else if (val.mType->mSize == 4)
1347 op = (CeOp)(iOp + 2);
1348 else if (val.mType->mSize == 8)
1349 op = (CeOp)(iOp + 3);
1350 else
1351 Fail("Invalid int operand size");
1352 }
1353 else if (val.mType->IsFloat())
1354 {
1355 if (val.mType->mSize == 4)
1356 op = fOp;
1357 else if (val.mType->mSize == 8)
1358 op = (CeOp)(fOp + 1);
1359 else
1360 Fail("Invalid float operand size");
1361 }
1362 else
1363 Fail("Invalid unary operand");
1364 Emit(op);
1365
1366 result = FrameAlloc(val.mType);
1367 EmitFrameOffset(result);
1368 EmitFrameOffset(val);
1369}
1370
1371void CeBuilder::EmitSizedOp(CeOp baseOp, const CeOperand& operand, CeOperand* outResult, bool allowNonStdSize)
1372{

Callers

nothing calls this directly

Calls 3

FailFunction · 0.85
IsIntableMethod · 0.45
IsFloatMethod · 0.45

Tested by

no test coverage detected