Permalink
Browse files

Merge pull request #11190 from unknownbrackets/armips

Update armips and reduce warning noise
  • Loading branch information...
hrydgard committed Jun 17, 2018
2 parents ca6645c + ae7f5d7 commit d271a540f4d430916d34ee7af394727b8350c8a6
@@ -444,12 +444,17 @@ int VulkanContext::GetBestPhysicalDevice() {
case VK_PHYSICAL_DEVICE_TYPE_CPU:
score += 1;
break;
case VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU:
score += 2;
break;
case VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU:
score += 20;
break;
case VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU:
score += 10;
break;
default:
break;
}
if (props.vendorID == VULKAN_VENDOR_AMD) {
score += 5;
@@ -313,6 +313,8 @@ bool VulkanMayBeAvailable() {
case VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU:
anyGood = true;
break;
default:
break;
}
// TODO: Should also check queuefamilyproperties for a GRAPHICS queue family? Oh well.
}
@@ -163,7 +163,8 @@ static void RegisterDiscHandlers(http::Server *http, std::unordered_map<std::str
char *buf = new char[CHUNK_SIZE];
for (s64 pos = 0; pos < len; pos += CHUNK_SIZE) {
s64 chunklen = std::min(len - pos, (s64)CHUNK_SIZE);
fread(buf, chunklen, 1, fp);
if (fread(buf, chunklen, 1, fp) != 1)
break;
request.Out()->Push(buf, chunklen);
}
fclose(fp);
@@ -286,6 +286,9 @@ void GenerateDepalShader(char *buffer, GEBufferFormat pixelFormat, ShaderLanguag
case HLSL_DX9:
GenerateDepalShaderFloat(buffer, pixelFormat, language);
break;
case HLSL_D3D11_LEVEL9:
default:
_assert_msg_(G3D, false, "Depal shader language not supported: %d", (int)language);
}
}
@@ -83,5 +83,4 @@ class GPU_D3D11 : public GPUCommon {
ShaderManagerD3D11 *shaderManagerD3D11_;
int lastVsync_;
int vertexCost_ = 0;
};
@@ -82,7 +82,6 @@ class GPU_DX9 : public GPUCommon {
ShaderManagerDX9 *shaderManagerDX9_;
int lastVsync_;
int vertexCost_ = 0;
};
} // namespace DX9
@@ -92,5 +92,4 @@ class GPU_GLES : public GPUCommon {
#ifdef _WIN32
int lastVsync_;
#endif
int vertexCost_ = 0;
};
@@ -167,7 +167,7 @@ void DrawEngineVulkan::InitDeviceObjects() {
vertexCache_ = new VulkanPushBuffer(vulkan_, VERTEX_CACHE_SIZE);
tessDataTransfer = new TessellationDataTransferVulkan(vulkan_, draw_);
tessDataTransfer = new TessellationDataTransferVulkan(vulkan_);
}
DrawEngineVulkan::~DrawEngineVulkan() {
@@ -994,8 +994,8 @@ void DrawEngineVulkan::UpdateUBOs(FrameData *frame) {
}
}
DrawEngineVulkan::TessellationDataTransferVulkan::TessellationDataTransferVulkan(VulkanContext *vulkan, Draw::DrawContext *draw)
: TessellationDataTransfer(), vulkan_(vulkan), draw_(draw) {
DrawEngineVulkan::TessellationDataTransferVulkan::TessellationDataTransferVulkan(VulkanContext *vulkan)
: TessellationDataTransfer(), vulkan_(vulkan) {
}
DrawEngineVulkan::TessellationDataTransferVulkan::~TessellationDataTransferVulkan() {
@@ -280,7 +280,7 @@ class DrawEngineVulkan : public DrawEngineCommon {
// Hardware tessellation
class TessellationDataTransferVulkan : public TessellationDataTransfer {
public:
TessellationDataTransferVulkan(VulkanContext *vulkan, Draw::DrawContext *draw);
TessellationDataTransferVulkan(VulkanContext *vulkan);
~TessellationDataTransferVulkan();
void SetPushBuffer(VulkanPushBuffer *push) { push_ = push; }
@@ -299,10 +299,8 @@ class DrawEngineVulkan : public DrawEngineCommon {
private:
VulkanContext *vulkan_;
Draw::DrawContext *draw_;
VulkanPushBuffer *push_; // Updated each frame.
int size_ = 0;
uint32_t offset_ = 0;
uint32_t range_ = 0;
VkBuffer buf_ = VK_NULL_HANDLE;
@@ -104,8 +104,9 @@ bool DoesBackendSupportHWTess() {
case GPUBackend::VULKAN:
case GPUBackend::DIRECT3D11:
return true;
default:
return false;
}
return false;
}
static std::string PostShaderTranslateName(const char *value) {
@@ -421,14 +421,17 @@ LIBARMIPS_FILES := \
$(SRC)/ext/armips/Archs/ARM/Arm.cpp \
$(SRC)/ext/armips/Archs/ARM/ArmOpcodes.cpp \
$(SRC)/ext/armips/Archs/ARM/ArmParser.cpp \
$(SRC)/ext/armips/Archs/ARM/ArmRelocator.cpp \
$(SRC)/ext/armips/Archs/ARM/ArmElfRelocator.cpp \
$(SRC)/ext/armips/Archs/ARM/ArmExpressionFunctions.cpp \
$(SRC)/ext/armips/Archs/ARM/CArmInstruction.cpp \
$(SRC)/ext/armips/Archs/ARM/CThumbInstruction.cpp \
$(SRC)/ext/armips/Archs/ARM/Pool.cpp \
$(SRC)/ext/armips/Archs/ARM/ThumbOpcodes.cpp \
$(SRC)/ext/armips/Archs/MIPS/CMipsInstruction.cpp \
$(SRC)/ext/armips/Archs/MIPS/Mips.cpp \
$(SRC)/ext/armips/Archs/MIPS/MipsElfFile.cpp \
$(SRC)/ext/armips/Archs/MIPS/MipsElfRelocator.cpp \
$(SRC)/ext/armips/Archs/MIPS/MipsExpressionFunctions.cpp \
$(SRC)/ext/armips/Archs/MIPS/MipsMacros.cpp \
$(SRC)/ext/armips/Archs/MIPS/MipsOpcodes.cpp \
$(SRC)/ext/armips/Archs/MIPS/MipsParser.cpp \
Submodule armips updated 76 files
+9 −3 Archs/ARM/Arm.cpp
+2 −4 Archs/ARM/Arm.h
+13 −1 Archs/ARM/ArmElfRelocator.cpp
+6 −1 Archs/ARM/ArmElfRelocator.h
+26 −0 Archs/ARM/ArmExpressionFunctions.cpp
+3 −0 Archs/ARM/ArmExpressionFunctions.h
+1 −1 Archs/ARM/ArmOpcodes.cpp
+2 −2 Archs/ARM/ArmParser.cpp
+1 −1 Archs/ARM/ThumbOpcodes.cpp
+2 −2 Archs/Architecture.cpp
+10 −6 Archs/Architecture.h
+3 −0 Archs/MIPS/CMipsInstruction.cpp
+4 −0 Archs/MIPS/CMipsInstruction.h
+10 −104 Archs/MIPS/Mips.cpp
+2 −25 Archs/MIPS/Mips.h
+2 −2 Archs/MIPS/MipsElfFile.cpp
+101 −0 Archs/MIPS/MipsElfRelocator.cpp
+27 −0 Archs/MIPS/MipsElfRelocator.h
+30 −0 Archs/MIPS/MipsExpressionFunctions.cpp
+3 −0 Archs/MIPS/MipsExpressionFunctions.h
+1 −1 Archs/MIPS/MipsMacros.cpp
+29 −20 Archs/MIPS/MipsOpcodes.cpp
+13 −12 Archs/MIPS/MipsOpcodes.h
+80 −2 Archs/MIPS/MipsParser.cpp
+3 −0 Archs/MIPS/MipsParser.h
+2 −2 Archs/MIPS/PsxRelocator.cpp
+2 −2 Archs/MIPS/PsxRelocator.h
+12 −2 CMakeLists.txt
+2 −2 Commands/CAssemblerLabel.cpp
+8 −2 Commands/CDirectiveArea.cpp
+2 −2 Commands/CDirectiveArea.h
+5 −5 Commands/CDirectiveConditional.cpp
+5 −5 Commands/CDirectiveData.cpp
+2 −2 Commands/CDirectiveFile.h
+1 −1 Core/Assembler.cpp
+2 −2 Core/Assembler.h
+87 −87 Core/ELF/ElfFile.cpp
+9 −5 Core/ELF/ElfFile.h
+43 −20 Core/ELF/ElfRelocator.cpp
+7 −3 Core/ELF/ElfRelocator.h
+2 −7 Core/ELF/ElfTypes.h
+27 −30 Core/Expression.cpp
+8 −8 Core/Expression.h
+2 −37 Core/ExpressionFunctions.cpp
+9 −2 Core/ExpressionFunctions.h
+8 −8 Core/FileManager.cpp
+1 −3 Core/FileManager.h
+1 −1 Core/SymbolData.cpp
+4 −4 Core/SymbolTable.cpp
+2 −2 Core/SymbolTable.h
+10 −3 Main/Tests.cpp
+4 −0 Main/Tests.h
+1 −1 Parser/ExpressionParser.cpp
+20 −0 Parser/Parser.cpp
+30 −18 Parser/Tokenizer.cpp
+15 −3 Readme.md
+4 −6 Tests/Conditions/Conditions.asm
+7 −7 Tests/Core/ExpressionFunctions/expected.txt
+0 −2 Tests/Core/Expressions/Expressions.asm
+10 −10 Util/ByteArray.cpp
+11 −8 Util/ByteArray.h
+7 −7 Util/FileClasses.cpp
+2 −2 Util/FileClasses.h
+3 −3 Util/Util.cpp
+196 −0 ext/tinyformat/.travis.yml
+41 −0 ext/tinyformat/CMakeLists.txt
+2 −2 ext/tinyformat/Makefile
+0 −12 ext/tinyformat/Makefile.nmake
+452 −0 ext/tinyformat/README.md
+0 −448 ext/tinyformat/README.rst
+52 −0 ext/tinyformat/appveyor.yml
+44 −34 ext/tinyformat/tinyformat.h
+17 −4 ext/tinyformat/tinyformat_test.cpp
+9 −3 libarmips.vcxproj
+23 −5 libarmips.vcxproj.filters
+1 −0 stdafx.h
@@ -78,8 +78,10 @@ add_library(armips
${ARMIPS_PATH}/Archs/ARM/ArmOpcodes.h
${ARMIPS_PATH}/Archs/ARM/ArmParser.cpp
${ARMIPS_PATH}/Archs/ARM/ArmParser.h
${ARMIPS_PATH}/Archs/ARM/ArmRelocator.cpp
${ARMIPS_PATH}/Archs/ARM/ArmRelocator.h
${ARMIPS_PATH}/Archs/ARM/ArmElfRelocator.cpp
${ARMIPS_PATH}/Archs/ARM/ArmElfRelocator.h
${ARMIPS_PATH}/Archs/ARM/ArmExpressionFunctions.cpp
${ARMIPS_PATH}/Archs/ARM/ArmExpressionFunctions.h
${ARMIPS_PATH}/Archs/ARM/CArmInstruction.cpp
${ARMIPS_PATH}/Archs/ARM/CArmInstruction.h
${ARMIPS_PATH}/Archs/ARM/CThumbInstruction.cpp
@@ -95,6 +97,10 @@ add_library(armips
${ARMIPS_PATH}/Archs/MIPS/Mips.h
${ARMIPS_PATH}/Archs/MIPS/MipsElfFile.cpp
${ARMIPS_PATH}/Archs/MIPS/MipsElfFile.h
${ARMIPS_PATH}/Archs/MIPS/MipsElfRelocator.cpp
${ARMIPS_PATH}/Archs/MIPS/MipsElfRelocator.h
${ARMIPS_PATH}/Archs/MIPS/MipsExpressionFunctions.cpp
${ARMIPS_PATH}/Archs/MIPS/MipsExpressionFunctions.h
${ARMIPS_PATH}/Archs/MIPS/MipsMacros.cpp
${ARMIPS_PATH}/Archs/MIPS/MipsMacros.h
${ARMIPS_PATH}/Archs/MIPS/MipsOpcodes.cpp
@@ -234,16 +234,19 @@
<ItemGroup>
<ClCompile Include="armips\Archs\Architecture.cpp" />
<ClCompile Include="armips\Archs\ARM\Arm.cpp" />
<ClCompile Include="armips\Archs\ARM\ArmElfRelocator.cpp" />
<ClCompile Include="armips\Archs\ARM\ArmExpressionFunctions.cpp" />
<ClCompile Include="armips\Archs\ARM\ArmOpcodes.cpp" />
<ClCompile Include="armips\Archs\ARM\ArmParser.cpp" />
<ClCompile Include="armips\Archs\ARM\ArmRelocator.cpp" />
<ClCompile Include="armips\Archs\ARM\CArmInstruction.cpp" />
<ClCompile Include="armips\Archs\ARM\CThumbInstruction.cpp" />
<ClCompile Include="armips\Archs\ARM\Pool.cpp" />
<ClCompile Include="armips\Archs\ARM\ThumbOpcodes.cpp" />
<ClCompile Include="armips\Archs\MIPS\CMipsInstruction.cpp" />
<ClCompile Include="armips\Archs\MIPS\Mips.cpp" />
<ClCompile Include="armips\Archs\MIPS\MipsElfFile.cpp" />
<ClCompile Include="armips\Archs\MIPS\MipsElfRelocator.cpp" />
<ClCompile Include="armips\Archs\MIPS\MipsExpressionFunctions.cpp" />
<ClCompile Include="armips\Archs\MIPS\MipsMacros.cpp" />
<ClCompile Include="armips\Archs\MIPS\MipsOpcodes.cpp" />
<ClCompile Include="armips\Archs\MIPS\MipsParser.cpp" />
@@ -287,16 +290,19 @@
<ItemGroup>
<ClInclude Include="armips\Archs\Architecture.h" />
<ClInclude Include="armips\Archs\ARM\Arm.h" />
<ClInclude Include="armips\Archs\ARM\ArmElfRelocator.h" />
<ClInclude Include="armips\Archs\ARM\ArmExpressionFunctions.h" />
<ClInclude Include="armips\Archs\ARM\ArmOpcodes.h" />
<ClInclude Include="armips\Archs\ARM\ArmParser.h" />
<ClInclude Include="armips\Archs\ARM\ArmRelocator.h" />
<ClInclude Include="armips\Archs\ARM\CArmInstruction.h" />
<ClInclude Include="armips\Archs\ARM\CThumbInstruction.h" />
<ClInclude Include="armips\Archs\ARM\Pool.h" />
<ClInclude Include="armips\Archs\ARM\ThumbOpcodes.h" />
<ClInclude Include="armips\Archs\MIPS\CMipsInstruction.h" />
<ClInclude Include="armips\Archs\MIPS\Mips.h" />
<ClInclude Include="armips\Archs\MIPS\MipsElfFile.h" />
<ClInclude Include="armips\Archs\MIPS\MipsElfRelocator.h" />
<ClInclude Include="armips\Archs\MIPS\MipsExpressionFunctions.h" />
<ClInclude Include="armips\Archs\MIPS\MipsMacros.h" />
<ClInclude Include="armips\Archs\MIPS\MipsOpcodes.h" />
<ClInclude Include="armips\Archs\MIPS\MipsParser.h" />
@@ -42,9 +42,6 @@
<ClCompile Include="armips\Archs\ARM\ArmOpcodes.cpp">
<Filter>Archs\ARM</Filter>
</ClCompile>
<ClCompile Include="armips\Archs\ARM\ArmRelocator.cpp">
<Filter>Archs\ARM</Filter>
</ClCompile>
<ClCompile Include="armips\Archs\ARM\CArmInstruction.cpp">
<Filter>Archs\ARM</Filter>
</ClCompile>
@@ -163,6 +160,18 @@
<ClCompile Include="armips\Core\ExpressionFunctions.cpp">
<Filter>Core</Filter>
</ClCompile>
<ClCompile Include="armips\Archs\ARM\ArmElfRelocator.cpp">
<Filter>Archs\ARM</Filter>
</ClCompile>
<ClCompile Include="armips\Archs\MIPS\MipsElfRelocator.cpp">
<Filter>Archs\MIPS</Filter>
</ClCompile>
<ClCompile Include="armips\Archs\ARM\ArmExpressionFunctions.cpp">
<Filter>Archs\ARM</Filter>
</ClCompile>
<ClCompile Include="armips\Archs\MIPS\MipsExpressionFunctions.cpp">
<Filter>Archs\MIPS</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="armips\Archs\Architecture.h">
@@ -174,9 +183,6 @@
<ClInclude Include="armips\Archs\ARM\ArmOpcodes.h">
<Filter>Archs\ARM</Filter>
</ClInclude>
<ClInclude Include="armips\Archs\ARM\ArmRelocator.h">
<Filter>Archs\ARM</Filter>
</ClInclude>
<ClInclude Include="armips\Archs\ARM\CArmInstruction.h">
<Filter>Archs\ARM</Filter>
</ClInclude>
@@ -301,5 +307,17 @@
<ClInclude Include="armips\Core\ExpressionFunctions.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="armips\Archs\ARM\ArmElfRelocator.h">
<Filter>Archs\ARM</Filter>
</ClInclude>
<ClInclude Include="armips\Archs\MIPS\MipsElfRelocator.h">
<Filter>Archs\MIPS</Filter>
</ClInclude>
<ClInclude Include="armips\Archs\ARM\ArmExpressionFunctions.h">
<Filter>Archs\ARM</Filter>
</ClInclude>
<ClInclude Include="armips\Archs\MIPS\MipsExpressionFunctions.h">
<Filter>Archs\MIPS</Filter>
</ClInclude>
</ItemGroup>
</Project>
@@ -563,7 +563,7 @@ inline int jpeg_decoder::huff_decode(huff_tables *pH, int& extra_bits)
// Tables and macro used to fully decode the DPCM differences.
static const int s_extend_test[16] = { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
static const int s_extend_offset[16] = { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
static const int s_extend_offset[16] = { 0, -(1<<1) + 1, -(1<<2) + 1, -(1<<3) + 1, -(1<<4) + 1, -(1<<5) + 1, -(1<<6) + 1, -(1<<7) + 1, -(1<<8) + 1, -(1<<9) + 1, -(1<<10) + 1, -(1<<11) + 1, -(1<<12) + 1, -(1<<13) + 1, -(1<<14) + 1, -(1<<15) + 1 };
//static const int s_extend_mask[] = { 0, (1<<0), (1<<1), (1<<2), (1<<3), (1<<4), (1<<5), (1<<6), (1<<7), (1<<8), (1<<9), (1<<10), (1<<11), (1<<12), (1<<13), (1<<14), (1<<15), (1<<16) };
// The logical AND's in this macro are to shut up static code analysis (aren't really necessary - couldn't find another way to do this)
#define JPGD_HUFF_EXTEND(x, s) (((x) < s_extend_test[s & 15]) ? ((x) + s_extend_offset[s & 15]) : (x))
@@ -3169,4 +3169,4 @@ unsigned char *decompress_jpeg_image_from_file(const char *pSrc_filename, int *w
return decompress_jpeg_image_from_stream(&file_stream, width, height, actual_comps, req_comps);
}
} // namespace jpgd
} // namespace jpgd
@@ -1805,7 +1805,7 @@ namespace rg_etc1
{
if (block_inten[0] > m_pSorted_luma[n - 1])
{
const uint min_error = (uint)(labs(block_inten[0] - m_pSorted_luma[n - 1]));
const uint min_error = (uint)(labs((int)block_inten[0] - (int)m_pSorted_luma[n - 1]));
if (min_error >= trial_solution.m_error)
continue;
}
@@ -1819,7 +1819,7 @@ namespace rg_etc1
{
if (m_pSorted_luma[0] > block_inten[3])
{
const uint min_error = (uint)(labs(m_pSorted_luma[0] - block_inten[3]));
const uint min_error = (uint)(labs((int)m_pSorted_luma[0] - (int)block_inten[3]));
if (min_error >= trial_solution.m_error)
continue;
}
@@ -23,6 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <inttypes.h>
#include "types.h"
#include "decode.h"
#include "syn.h"
@@ -137,14 +138,14 @@ ud_syn_print_addr(struct ud *u, uint64_t addr)
name = u->sym_resolver(u, addr, &offset);
if (name) {
if (offset) {
ud_asmprintf(u, "%s%+" FMT64 "d", name, offset);
ud_asmprintf(u, "%s%+" PRId64, name, offset);
} else {
ud_asmprintf(u, "%s", name);
}
return;
}
}
ud_asmprintf(u, "0x%" FMT64 "x", addr);
ud_asmprintf(u, "0x%" PRIx64, addr);
}
@@ -171,7 +172,7 @@ ud_syn_print_imm(struct ud* u, const struct ud_operand *op)
default: UD_ASSERT(!"invalid offset"); v = 0; /* keep cc happy */
}
}
ud_asmprintf(u, "0x%" FMT64 "x", v);
ud_asmprintf(u, "0x%" PRIx64, v);
}
uint64_t
@@ -193,7 +194,7 @@ ud_syn_print_mem_disp(struct ud* u, const struct ud_operand *op, int sign)
case 64: v = op->lval.uqword; break;
default: UD_ASSERT(!"invalid offset"); v = 0; /* keep cc happy */
}
ud_asmprintf(u, "0x%" FMT64 "x", v);
ud_asmprintf(u, "0x%" PRIx64, v);
} else {
int64_t v;
UD_ASSERT(op->offset != 64);
@@ -206,9 +207,9 @@ ud_syn_print_mem_disp(struct ud* u, const struct ud_operand *op, int sign)
if (op->base == UD_R_RIP) {
ud_syn_print_addr(u, ud_syn_rip_target(u, op));
} else if (v < 0) {
ud_asmprintf(u, "-0x%" FMT64 "x", -v);
ud_asmprintf(u, "-0x%" PRIx64, -v);
} else if (v > 0) {
ud_asmprintf(u, "%s0x%" FMT64 "x", sign? "+" : "", v);
ud_asmprintf(u, "%s0x%" PRIx64, sign? "+" : "", v);
}
}
}
@@ -71,7 +71,9 @@ void HeadlessHost::SendDebugScreenshot(const u8 *pixbuf, u32 w, u32 h)
FILE *bmp = File::OpenCFile(comparisonScreenshot_, "rb");
if (bmp)
{
fread(&header, sizeof(header), 1, bmp);
if (fread(&header, sizeof(header), 1, bmp) != 1) {
SendOrCollectDebugOutput("Failed to read original screenshot header.\n");
}
fclose(bmp);
}

0 comments on commit d271a54

Please sign in to comment.