updated clang versions, reformatted

This commit is contained in:
Anthony Pesch 2015-10-31 07:14:32 -07:00
parent 954bc5f06c
commit 8f5bae8121
7 changed files with 72 additions and 55 deletions

View File

@ -1,4 +1,4 @@
find_program(CLANG_FORMAT_EXECUTABLE NAMES clang-format clang-format-3.6)
find_program(CLANG_FORMAT_EXECUTABLE NAMES clang-format clang-format-3.6 clang-format-3.7)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(cppcheck
DEFAULT_MSG

View File

@ -65,17 +65,19 @@ inline CullFace TranslateCull(uint32_t cull_mode) {
inline BlendFunc TranslateSrcBlendFunc(uint32_t blend_func) {
static BlendFunc src_blend_funcs[] = {
BLEND_ZERO, BLEND_ONE, BLEND_SRC_COLOR, BLEND_ONE_MINUS_SRC_COLOR,
BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA, BLEND_DST_ALPHA,
BLEND_ONE_MINUS_DST_ALPHA};
BLEND_ZERO, BLEND_ONE,
BLEND_SRC_COLOR, BLEND_ONE_MINUS_SRC_COLOR,
BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA,
BLEND_DST_ALPHA, BLEND_ONE_MINUS_DST_ALPHA};
return src_blend_funcs[blend_func];
}
inline BlendFunc TranslateDstBlendFunc(uint32_t blend_func) {
static BlendFunc dst_blend_funcs[] = {
BLEND_ZERO, BLEND_ONE, BLEND_DST_COLOR, BLEND_ONE_MINUS_DST_COLOR,
BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA, BLEND_DST_ALPHA,
BLEND_ONE_MINUS_DST_ALPHA};
BLEND_ZERO, BLEND_ONE,
BLEND_DST_COLOR, BLEND_ONE_MINUS_DST_COLOR,
BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA,
BLEND_DST_ALPHA, BLEND_ONE_MINUS_DST_ALPHA};
return dst_blend_funcs[blend_func];
}

View File

@ -12,18 +12,11 @@ DEFINE_string(profile, "", "Controller profile");
// Controller profile contains button mappings and other misc. configurable
// settings for the controller.
static Json default_profile = Json::object{{"joyx", ""},
{"joyy", ""},
{"ltrig", ""},
{"rtrig", ""},
{"start", "space"},
{"a", "k"},
{"b", "l"},
{"x", "j"},
{"y", "i"},
{"dpad_up", "w"},
{"dpad_down", "s"},
{"dpad_left", "a"},
static Json default_profile =
Json::object{{"joyx", ""}, {"joyy", ""}, {"ltrig", ""},
{"rtrig", ""}, {"start", "space"}, {"a", "k"},
{"b", "l"}, {"x", "j"}, {"y", "i"},
{"dpad_up", "w"}, {"dpad_down", "s"}, {"dpad_left", "a"},
{"dpad_right", "d"}};
MapleControllerProfile::MapleControllerProfile() : button_map_() {}

View File

@ -14,14 +14,11 @@ namespace dreavm {
namespace jit {
namespace backend {
namespace interpreter {
const Register int_registers[] = {{"a", ir::VALUE_INT_MASK},
{"b", ir::VALUE_INT_MASK},
{"c", ir::VALUE_INT_MASK},
{"d", ir::VALUE_INT_MASK},
{"e", ir::VALUE_FLOAT_MASK},
{"f", ir::VALUE_FLOAT_MASK},
{"g", ir::VALUE_FLOAT_MASK},
{"h", ir::VALUE_FLOAT_MASK}};
const Register int_registers[] = {
{"a", ir::VALUE_INT_MASK}, {"b", ir::VALUE_INT_MASK},
{"c", ir::VALUE_INT_MASK}, {"d", ir::VALUE_INT_MASK},
{"e", ir::VALUE_FLOAT_MASK}, {"f", ir::VALUE_FLOAT_MASK},
{"g", ir::VALUE_FLOAT_MASK}, {"h", ir::VALUE_FLOAT_MASK}};
const int int_num_registers = sizeof(int_registers) / sizeof(Register);
}

View File

@ -19,18 +19,13 @@ namespace dreavm {
namespace jit {
namespace backend {
namespace x64 {
const Register x64_registers[] = {{"rbx", ir::VALUE_INT_MASK},
{"rbp", ir::VALUE_INT_MASK},
{"r12", ir::VALUE_INT_MASK},
{"r13", ir::VALUE_INT_MASK},
{"r14", ir::VALUE_INT_MASK},
{"r15", ir::VALUE_INT_MASK},
{"xmm6", ir::VALUE_FLOAT_MASK},
{"xmm7", ir::VALUE_FLOAT_MASK},
{"xmm8", ir::VALUE_FLOAT_MASK},
{"xmm9", ir::VALUE_FLOAT_MASK},
{"xmm10", ir::VALUE_FLOAT_MASK},
{"xmm11", ir::VALUE_FLOAT_MASK}};
const Register x64_registers[] = {
{"rbx", ir::VALUE_INT_MASK}, {"rbp", ir::VALUE_INT_MASK},
{"r12", ir::VALUE_INT_MASK}, {"r13", ir::VALUE_INT_MASK},
{"r14", ir::VALUE_INT_MASK}, {"r15", ir::VALUE_INT_MASK},
{"xmm6", ir::VALUE_FLOAT_MASK}, {"xmm7", ir::VALUE_FLOAT_MASK},
{"xmm8", ir::VALUE_FLOAT_MASK}, {"xmm9", ir::VALUE_FLOAT_MASK},
{"xmm10", ir::VALUE_FLOAT_MASK}, {"xmm11", ir::VALUE_FLOAT_MASK}};
const int x64_num_registers = sizeof(x64_registers) / sizeof(Register);
}

View File

@ -44,14 +44,34 @@ using namespace dreavm::jit::ir;
// map register ids coming from IR values, must be in sync with x64_backend.h
// note, only callee saved registers are used here to avoid having to reload
// registers when calling non-JIT'd functions
static const Xbyak::Reg *reg_map_8[] = {
&Xbyak::util::bl, &Xbyak::util::bpl, &Xbyak::util::r12b, &Xbyak::util::r13b,
&Xbyak::util::r14b, &Xbyak::util::r15b, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr};
static const Xbyak::Reg *reg_map_16[] = {
&Xbyak::util::bx, &Xbyak::util::bp, &Xbyak::util::r12w, &Xbyak::util::r13w,
&Xbyak::util::r14w, &Xbyak::util::r15w, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr};
static const Xbyak::Reg *reg_map_8[] = {&Xbyak::util::bl,
&Xbyak::util::bpl,
&Xbyak::util::r12b,
&Xbyak::util::r13b,
&Xbyak::util::r14b,
&Xbyak::util::r15b,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr};
static const Xbyak::Reg *reg_map_16[] = {&Xbyak::util::bx,
&Xbyak::util::bp,
&Xbyak::util::r12w,
&Xbyak::util::r13w,
&Xbyak::util::r14w,
&Xbyak::util::r15w,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr};
static const Xbyak::Reg *reg_map_32[] = {
&Xbyak::util::ebx, &Xbyak::util::ebp, &Xbyak::util::r12d,
&Xbyak::util::r13d, &Xbyak::util::r14d, &Xbyak::util::r15d,
@ -66,9 +86,12 @@ static const Xbyak::Reg *reg_map_64[] = {
// map register ids coming from IR values for callee saved registers. use
// nullptr to specify that the register isn't saved
static const Xbyak::Reg *callee_save_map[] = {
&Xbyak::util::rbx, &Xbyak::util::rbp, &Xbyak::util::r12, &Xbyak::util::r13,
&Xbyak::util::r14, &Xbyak::util::r15, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
&Xbyak::util::rbx, &Xbyak::util::rbp,
&Xbyak::util::r12, &Xbyak::util::r13,
&Xbyak::util::r14, &Xbyak::util::r15,
nullptr, nullptr,
nullptr, nullptr,
nullptr, nullptr,
nullptr, nullptr};
#ifdef PLATFORM_WINDOWS

View File

@ -54,10 +54,17 @@ static GLenum cull_face[] = {
GL_BACK // CULL_BACK
};
static GLenum blend_funcs[] = {
GL_NONE, GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR,
GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA,
GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR};
static GLenum blend_funcs[] = {GL_NONE,
GL_ZERO,
GL_ONE,
GL_SRC_COLOR,
GL_ONE_MINUS_SRC_COLOR,
GL_SRC_ALPHA,
GL_ONE_MINUS_SRC_ALPHA,
GL_DST_ALPHA,
GL_ONE_MINUS_DST_ALPHA,
GL_DST_COLOR,
GL_ONE_MINUS_DST_COLOR};
GLBackend::GLBackend(Window &window)
: window_(window),