File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,19 @@ namespace triton {
4444 }
4545 return node;
4646 }
47+ else if (call->getCalledFunction ()->getName ().find (" llvm.fshl.i" ) != std::string::npos) {
48+ // (X << (Z % BW)) | (Y >> (BW - (Z % BW)))
49+ // https://llvm.org/docs/LangRef.html#llvm-fshl-intrinsic
50+ auto x = this ->do_convert (call->getArgOperand (0 ));
51+ auto y = this ->do_convert (call->getArgOperand (1 ));
52+ auto z = this ->do_convert (call->getArgOperand (2 ));
53+ auto bw = this ->actx ->bv (x->getBitvectorSize (), x->getBitvectorSize ());
54+
55+ auto LHS = this ->actx ->bvshl (x, z);
56+ auto RHS = this ->actx ->bvlshr (y, this ->actx ->bvsub (bw, z));
57+
58+ return this ->actx ->bvor (LHS, RHS);
59+ }
4760 /* We symbolize the return of call */
4861 return this ->var (instruction->getName ().str (), instruction->getType ()->getScalarSizeInBits ());
4962 }
You can’t perform that action at this time.
0 commit comments