Skip to content

Commit

Permalink
Merge pull request rust-lang#157 from vext01/unsupported-binops
Browse files Browse the repository at this point in the history
Unsupported binops
  • Loading branch information
ltratt authored May 15, 2024
2 parents 7901e2c + 90483cb commit c645c79
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions llvm/lib/YkIR/YkIRWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,22 @@ class YkIRWriter {
unsigned &InstIdx) {
assert(I->getNumOperands() == 2);

// We don't yet support:
// - fast math flags (for float operations).
// - the `exact` keyword
// - vector variants
if ((isa<FPMathOperator>(I) && (I->getFastMathFlags().any())) ||
(isa<PossiblyExactOperator>(I) && I->isExact()) ||
I->getType()->isVectorTy()) {
serialiseUnimplementedInstruction(I, FLCtxt, BBIdx, InstIdx);
return;
}

// Note that we do nothing with the `nsw` and `nuw` (no {signed,unsigned}
// wrap) keywords, which may generate poison values. If they do, the rules
// of deferred UB allow us to make any value we wish, including (as
// we do) the wrapped value.

// opcode:
serialiseOpcode(OpCodeBinOp);
// left-hand side:
Expand All @@ -386,9 +402,6 @@ class YkIRWriter {

// Serialise a binary operator.
void serialiseBinOperator(Instruction::BinaryOps BO) {
// operand kind:
// OutStreamer.emitInt8(OperandKind::OpKindBinOp);
// the operator:
switch (BO) {
case Instruction::BinaryOps::Add:
OutStreamer.emitInt8(BinOp::BinOpAdd);
Expand Down

0 comments on commit c645c79

Please sign in to comment.