You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
475 B

#include "Endianness.h"
#include <llvm/IR/IntrinsicInst.h>
#include "Type.h"
namespace dev
{
namespace eth
{
namespace jit
{
llvm::Value* Endianness::bswap(llvm::IRBuilder<>& _builder, llvm::Value* _word)
{
// TODO: Native is Little Endian
assert(_word->getType() == Type::Word);
auto bswap = llvm::Intrinsic::getDeclaration(_builder.GetInsertBlock()->getParent()->getParent(), llvm::Intrinsic::bswap, Type::Word);
return _builder.CreateCall(bswap, _word);
}
}
}
}