Skip to content

Commit c645c79

Browse files
authored
Merge pull request rust-lang#157 from vext01/unsupported-binops
Unsupported binops
2 parents 7901e2c + 90483cb commit c645c79

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

llvm/lib/YkIR/YkIRWriter.cpp

+16-3
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,22 @@ class YkIRWriter {
371371
unsigned &InstIdx) {
372372
assert(I->getNumOperands() == 2);
373373

374+
// We don't yet support:
375+
// - fast math flags (for float operations).
376+
// - the `exact` keyword
377+
// - vector variants
378+
if ((isa<FPMathOperator>(I) && (I->getFastMathFlags().any())) ||
379+
(isa<PossiblyExactOperator>(I) && I->isExact()) ||
380+
I->getType()->isVectorTy()) {
381+
serialiseUnimplementedInstruction(I, FLCtxt, BBIdx, InstIdx);
382+
return;
383+
}
384+
385+
// Note that we do nothing with the `nsw` and `nuw` (no {signed,unsigned}
386+
// wrap) keywords, which may generate poison values. If they do, the rules
387+
// of deferred UB allow us to make any value we wish, including (as
388+
// we do) the wrapped value.
389+
374390
// opcode:
375391
serialiseOpcode(OpCodeBinOp);
376392
// left-hand side:
@@ -386,9 +402,6 @@ class YkIRWriter {
386402

387403
// Serialise a binary operator.
388404
void serialiseBinOperator(Instruction::BinaryOps BO) {
389-
// operand kind:
390-
// OutStreamer.emitInt8(OperandKind::OpKindBinOp);
391-
// the operator:
392405
switch (BO) {
393406
case Instruction::BinaryOps::Add:
394407
OutStreamer.emitInt8(BinOp::BinOpAdd);

0 commit comments

Comments
 (0)