cleanup and formatting

This commit is contained in:
null-cell committed 2023-03-28 14:09:12 +02:00
1 parent bc980f071e
commit 796d0c0f35
9 files changed
+3 -252

No files matched your search

+1
View File
@@ -23,6 +23,7 @@ samples/sample
_sample*.txt
tmp
MANIFEST
.vscode
bindings/python/dist/
bindings/python/src/
-18
View File
@@ -1,18 +0,0 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/include",
"${workspaceFolder}/llvm/lib/Target/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
-59
View File
@@ -1,59 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) MIPS Launch",
"type": "cppdbg",
"request": "launch",
"program": "/home/kali/keystone/build/kstool/kstool",
"args": ["mips", "'nop'"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
},
{
"name": "(gdb) RISCVLaunch",
"type": "cppdbg",
"request": "launch",
"program": "/home/kali/keystone/build/kstool/kstool",
"args": ["riscv64", "'mul a2, a1, a1'"],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
}
]
}
-66
View File
@@ -1,66 +0,0 @@
{
"files.associations": {
"*.inc": "c",
"*.tcc": "cpp",
"bitset": "cpp",
"lanebitmask.h": "c",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"compare": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"cstdint": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"random": "cpp",
"ratio": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"numbers": "cpp",
"ostream": "cpp",
"semaphore": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"typeinfo": "cpp"
},
"C_Cpp.dimInactiveRegions": false
}
+1 -1
View File
@@ -5,7 +5,7 @@ OBJDIR = ./build
else
OBJDIR = $(abspath $(BUILDDIR))/obj/bindings/python
endif
.PHONY: gen_const install install3 clean
gen_const:
-95
View File
@@ -1,95 +0,0 @@
//===- llvm/MC/LaneBitmask.h ------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// A common definition of LaneBitmask for use in TableGen and CodeGen.
///
/// A lane mask is a bitmask representing the covering of a register with
/// sub-registers.
///
/// This is typically used to track liveness at sub-register granularity.
/// Lane masks for sub-register indices are similar to register units for
/// physical registers. The individual bits in a lane mask can't be assigned
/// any specific meaning. They can be used to check if two sub-register
/// indices overlap.
///
/// Iff the target has a register such that:
///
/// getSubReg(Reg, A) overlaps getSubReg(Reg, B)
///
/// then:
///
/// (getSubRegIndexLaneMask(A) & getSubRegIndexLaneMask(B)) != 0
#ifndef LLVM_MC_LANEBITMASK_H
#define LLVM_MC_LANEBITMASK_H
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
namespace llvm_ks {
struct LaneBitmask {
// When changing the underlying type, change the format string as well.
using Type = unsigned;
enum : unsigned { BitWidth = 8*sizeof(Type) };
constexpr static const char *const FormatStr = "%08X";
constexpr LaneBitmask() = default;
explicit constexpr LaneBitmask(Type V) : Mask(V) {}
constexpr bool operator== (LaneBitmask M) const { return Mask == M.Mask; }
constexpr bool operator!= (LaneBitmask M) const { return Mask != M.Mask; }
constexpr bool operator< (LaneBitmask M) const { return Mask < M.Mask; }
constexpr bool none() const { return Mask == 0; }
constexpr bool any() const { return Mask != 0; }
constexpr bool all() const { return ~Mask == 0; }
constexpr LaneBitmask operator~() const {
return LaneBitmask(~Mask);
}
constexpr LaneBitmask operator|(LaneBitmask M) const {
return LaneBitmask(Mask | M.Mask);
}
constexpr LaneBitmask operator&(LaneBitmask M) const {
return LaneBitmask(Mask & M.Mask);
}
LaneBitmask &operator|=(LaneBitmask M) {
Mask |= M.Mask;
return *this;
}
LaneBitmask &operator&=(LaneBitmask M) {
Mask &= M.Mask;
return *this;
}
constexpr Type getAsInteger() const { return Mask; }
unsigned getNumLanes() const {
return countPopulation(Mask);
}
unsigned getHighestLane() const {
return Log2_32(Mask);
}
static constexpr LaneBitmask getNone() { return LaneBitmask(0); }
static constexpr LaneBitmask getAll() { return ~LaneBitmask(0); }
static constexpr LaneBitmask getLane(unsigned Lane) {
return LaneBitmask(Type(1) << Lane);
}
private:
Type Mask = 0;
};
} // end namespace llvm
#endif // LLVM_MC_LANEBITMASK_H
-11
View File
@@ -89,17 +89,6 @@ public:
/// appropriate.
virtual void applyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize,
uint64_t Value, bool IsPCRel, unsigned int &KsError) const = 0;
/* /// Apply the \p Value for given \p Fixup into the provided data fragment, at
/// the offset specified by the fixup and following the fixup kind as
/// appropriate. Errors (such as an out of range fixup value) should be
/// reported via \p Ctx.
/// The \p STI is present only for fragments of type MCRelaxableFragment and
/// MCDataFragment with hasInstructions() == true.
virtual void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
const MCValue &Target, MutableArrayRef<char> Data,
uint64_t Value, bool IsResolved,
const MCSubtargetInfo *STI, unsigned int &KsError) const = 0; */
/// @}
+1 -1
View File
@@ -310,7 +310,7 @@ enum {
EM_NORC = 218, // Nanoradio Optimized RISC
EM_CSR_KALIMBA = 219, // CSR Kalimba architecture family
EM_AMDGPU = 224, // AMD GPU architecture
EM_RISCV = 243, // RISC-V
EM_RISCV = 243, // RISC-V
// A request has been made to the maintainer of the official registry for
// such numbers for an official value for WebAssembly. As soon as one is
@@ -5,7 +5,6 @@
|* Automatically generated file, do not edit! *|
|* *|
\*===----------------------------------------------------------------------===*/
#include "llvm/MC/LaneBitmask.h"
#ifdef GET_REGINFO_ENUM
#undef GET_REGINFO_ENUM