Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

IF/ENDIF fix does not work on large nested if/endif block #4

Open
linnaea opened this issue Jan 13, 2020 · 4 comments
Open

IF/ENDIF fix does not work on large nested if/endif block #4

linnaea opened this issue Jan 13, 2020 · 4 comments

Comments

@linnaea
Copy link
Owner

linnaea commented Jan 13, 2020

Current IF/ENDIF fix only handles the innermost block, this will still trigger the IF/ENDIF out of range error if the block is enclosed in another IF/ENDIF block.

if (this->ctx.getIFENDIFFix() &&
!this->block->insnList.empty() &&
this->block->insnList.size() % 1000 == 0 &&
this->block->endifLabel.value() != 0) {
this->curr.flag = 0;
this->curr.subFlag = 1;
ir::LabelIndex jip = this->block->endifLabel;
this->ENDIF(GenRegister::immd(0), jip);
this->push();
this->curr.predicate = GEN_PREDICATE_NORMAL;
this->IF(GenRegister::immd(0), jip, jip);
this->pop();
}

This might be the cause of some assertions on hashcat.

Removing the assertion on gen_program.cpp as a workaround.

@linnaea
Copy link
Owner Author

linnaea commented Jan 13, 2020

One possible solution would be to move the code in the large block somewhere else and insert a pair of JMPI instructions.

Might need to rebuild ir::Function.

@ryoqun
Copy link

ryoqun commented Mar 6, 2020

Oh, cool is this worked on at this fork? I've experienced this error when trying solana-labs/solana-perf-libs#58 on my macbook, which has a bit old integrated OpenCL intel chip. :)

@linnaea
Copy link
Owner Author

linnaea commented Mar 6, 2020

Oh, cool is this worked on at this fork? I've experienced this error when trying solana-labs/solana-perf-libs#58 on my macbook, which has a bit old integrated OpenCL intel chip. :)

Intel's iGPUs are slow and inefficient beyond belief when the workload is cryptography related, a Pentium E5400 can outperform 2 Haswell GT3, plus the iGPU's power draw counts towards the package power limit of the CPU and may cause the CPU to throttle, so overall you might be able to get better performance running CPU-only.

@ryoqun
Copy link

ryoqun commented Mar 6, 2020

@linnaea Thanks for really quick reply! Yeah, I wasn't expecting some great number... But hearing that makes me more certain for the sad fact... Maybe I should just be satisfied that I just can build and barely run the OpenCL thingy on my environment, targeting both nvidia and intel.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants