We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LLVM.opcode
from the julia code
function ApprovalProgram(a::UInt64)::UInt64 if a % UInt64(2) == UInt64(0) return UInt64(1) end return UInt64(0) end
code_llvm gives as the 1st instruction: %0 = and i64 %"a::UInt64", 1
code_llvm
%0 = and i64 %"a::UInt64", 1
which inspected using LLVM.jl (instruction = collect(LLVM.instructions(bb))[1])
LLVM.jl
instruction = collect(LLVM.instructions(bb))[1]
gives typeof(instruction) == LLVM.AndInst which seems like the and opcode of LLVM,
typeof(instruction) == LLVM.AndInst
and
LLVM
but LLVM.opcode(instruction) gives LLVMAnd::LLVMOpcode = 0x00000017
LLVM.opcode(instruction)
LLVMAnd::LLVMOpcode = 0x00000017
and 0x17=23 in https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/Instruction.def corresponds to srem in line 157
srem
Why this mismatch?
The text was updated successfully, but these errors were encountered:
found the correct mapping
https://github.com/hdoc/llvm-project/blob/release/15.x//llvm/include/llvm-c/Core.h#L2159
Sorry, something went wrong.
No branches or pull requests
from the julia code
code_llvm
gives as the 1st instruction:%0 = and i64 %"a::UInt64", 1
which inspected using
LLVM.jl
(instruction = collect(LLVM.instructions(bb))[1]
)gives
typeof(instruction) == LLVM.AndInst
which seems like theand
opcode ofLLVM
,but
LLVM.opcode(instruction)
givesLLVMAnd::LLVMOpcode = 0x00000017
and 0x17=23 in https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/Instruction.def corresponds to
srem
in line 157Why this mismatch?
The text was updated successfully, but these errors were encountered: