diff options
author | jonas echterhoff <jonas@unity3d.com> | 2014-02-19 11:17:37 +0100 |
---|---|---|
committer | jonas echterhoff <jonas@unity3d.com> | 2014-02-19 11:17:37 +0100 |
commit | aa72e2349d22e3ef30eabfb8d3aac5a845f81977 (patch) | |
tree | adb3cc7e2d644908d900f163c997dabfeb2c7746 | |
parent | 67c5344e6e14ebb165fc668549da8d5e9fc80c76 (diff) |
Fix atomic decrement (operand order of emitted code was flipped).
-rw-r--r-- | lib/Target/JSBackend/JSBackend.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp index 7222c28992..1620d3e10e 100644 --- a/lib/Target/JSBackend/JSBackend.cpp +++ b/lib/Target/JSBackend/JSBackend.cpp @@ -1492,12 +1492,12 @@ void JSWriter::generateInstruction(const Instruction *I, raw_string_ostream& Cod // Most bitcasts are no-ops for us. However, the exception is int to float and float to int switch (rmwi->getOperation()) { case AtomicRMWInst::Xchg: Code << getStore(I, P, I->getType(), VS, 0); break; - case AtomicRMWInst::Add: Code << getStore(I, P, I->getType(), "((" + VS + '+' + iName + ")|0)", 0); break; - case AtomicRMWInst::Sub: Code << getStore(I, P, I->getType(), "((" + VS + '-' + iName + ")|0)", 0); break; - case AtomicRMWInst::And: Code << getStore(I, P, I->getType(), "(" + VS + '&' + iName + ")", 0); break; - case AtomicRMWInst::Nand: Code << getStore(I, P, I->getType(), "(~(" + VS + '&' + iName + "))", 0); break; - case AtomicRMWInst::Or: Code << getStore(I, P, I->getType(), "(" + VS + '|' + iName + ")", 0); break; - case AtomicRMWInst::Xor: Code << getStore(I, P, I->getType(), "(" + VS + '^' + iName + ")", 0); break; + case AtomicRMWInst::Add: Code << getStore(I, P, I->getType(), "((" + iName + '+' + VS + ")|0)", 0); break; + case AtomicRMWInst::Sub: Code << getStore(I, P, I->getType(), "((" + iName + '-' + VS + ")|0)", 0); break; + case AtomicRMWInst::And: Code << getStore(I, P, I->getType(), "(" + iName + '&' + VS + ")", 0); break; + case AtomicRMWInst::Nand: Code << getStore(I, P, I->getType(), "(~(" + iName + '&' + VS + "))", 0); break; + case AtomicRMWInst::Or: Code << getStore(I, P, I->getType(), "(" + iName + '|' + VS + ")", 0); break; + case AtomicRMWInst::Xor: Code << getStore(I, P, I->getType(), "(" + iName + '^' + VS + ")", 0); break; case AtomicRMWInst::Max: case AtomicRMWInst::Min: case AtomicRMWInst::UMax: |