Fix 64 bit compile errors

This commit is contained in:
Magnus Norddahl 2016-10-01 11:47:21 +02:00
commit c960742dbd
42 changed files with 99 additions and 62 deletions

View file

@ -1,5 +1,6 @@
#include "i_system.h"
#include "r_compiler/llvm_include.h"
#include "r_compiler/fixedfunction/drawcolumncodegen.h"
#include "r_compiler/ssa/ssa_function.h"
#include "r_compiler/ssa/ssa_scope.h"

View file

@ -1,5 +1,6 @@
#include "i_system.h"
#include "r_compiler/llvm_include.h"
#include "r_compiler/fixedfunction/drawercodegen.h"
#include "r_compiler/ssa/ssa_function.h"
#include "r_compiler/ssa/ssa_scope.h"
@ -17,17 +18,17 @@ SSABool DrawerCodegen::line_skipped_by_thread(SSAInt line, SSAWorkerThread threa
SSAInt DrawerCodegen::skipped_by_thread(SSAInt first_line, SSAWorkerThread thread)
{
SSAInt pass_skip = SSAInt::MAX(thread.pass_start_y - first_line, 0);
SSAInt pass_skip = SSAInt::MAX(thread.pass_start_y - first_line, SSAInt(0));
SSAInt core_skip = (thread.num_cores - (first_line + pass_skip - thread.core) % thread.num_cores) % thread.num_cores;
return pass_skip + core_skip;
}
SSAInt DrawerCodegen::count_for_thread(SSAInt first_line, SSAInt count, SSAWorkerThread thread)
{
SSAInt lines_until_pass_end = SSAInt::MAX(thread.pass_end_y - first_line, 0);
SSAInt lines_until_pass_end = SSAInt::MAX(thread.pass_end_y - first_line, SSAInt(0));
count = SSAInt::MIN(count, lines_until_pass_end);
SSAInt c = (count - skipped_by_thread(first_line, thread) + thread.num_cores - 1) / thread.num_cores;
return SSAInt::MAX(c, 0);
return SSAInt::MAX(c, SSAInt(0));
}
SSAUBytePtr DrawerCodegen::dest_for_thread(SSAInt first_line, SSAInt pitch, SSAUBytePtr dest, SSAWorkerThread thread)

View file

@ -1,5 +1,6 @@
#include "i_system.h"
#include "r_compiler/llvm_include.h"
#include "r_compiler/fixedfunction/drawspancodegen.h"
#include "r_compiler/ssa/ssa_function.h"
#include "r_compiler/ssa/ssa_scope.h"
@ -49,9 +50,9 @@ void DrawSpanCodegen::Generate(DrawSpanVariant variant, SSAValue args)
xmask = ((SSAInt(1) << xbits) - 1) << ybits;
// 64x64 is the most common case by far, so special case it.
is_64x64 = xbits == 6 && ybits == 6;
is_simple_shade = (flags & DrawSpanArgs::simple_shade) == DrawSpanArgs::simple_shade;
is_nearest_filter = (flags & DrawSpanArgs::nearest_filter) == DrawSpanArgs::nearest_filter;
is_64x64 = xbits == SSAInt(6) && ybits == SSAInt(6);
is_simple_shade = (flags & DrawSpanArgs::simple_shade) == SSAInt(DrawSpanArgs::simple_shade);
is_nearest_filter = (flags & DrawSpanArgs::nearest_filter) == SSAInt(DrawSpanArgs::nearest_filter);
SSAIfBlock branch;
branch.if_block(is_simple_shade);
@ -90,7 +91,7 @@ void DrawSpanCodegen::LoopFilter(DrawSpanVariant variant, bool isSimpleShade, bo
SSAInt DrawSpanCodegen::Loop4x(DrawSpanVariant variant, bool isSimpleShade, bool isNearestFilter, bool is64x64)
{
SSAInt sseLength = count / 4;
stack_index.store(0);
stack_index.store(SSAInt(0));
{
SSAForBlock loop;
SSAInt index = stack_index.load();
@ -165,7 +166,7 @@ SSAVec4i DrawSpanCodegen::Sample(SSAInt xfrac, SSAInt yfrac, bool isNearestFilte
{
if (is64x64)
{
return sample_linear(source, xfrac, yfrac, 26, 26);
return sample_linear(source, xfrac, yfrac, SSAInt(26), SSAInt(26));
}
else
{

View file

@ -1,5 +1,6 @@
#include "i_system.h"
#include "r_compiler/llvm_include.h"
#include "r_compiler/fixedfunction/drawwallcodegen.h"
#include "r_compiler/ssa/ssa_function.h"
#include "r_compiler/ssa/ssa_scope.h"
@ -65,8 +66,8 @@ void DrawWallCodegen::Generate(DrawWallVariant variant, bool fourColumns, SSAVal
thread.pass_start_y = thread_data[0][2].load();
thread.pass_end_y = thread_data[0][3].load();
is_simple_shade = (flags & DrawWallArgs::simple_shade) == DrawWallArgs::simple_shade;
is_nearest_filter = (flags & DrawWallArgs::nearest_filter) == DrawWallArgs::nearest_filter;
is_simple_shade = (flags & DrawWallArgs::simple_shade) == SSAInt(DrawWallArgs::simple_shade);
is_nearest_filter = (flags & DrawWallArgs::nearest_filter) == SSAInt(DrawWallArgs::nearest_filter);
count = count_for_thread(dest_y, count, thread);
dest = dest_for_thread(dest_y, pitch, dest, thread);
@ -103,7 +104,7 @@ void DrawWallCodegen::Loop(DrawWallVariant variant, bool fourColumns, bool isSim
{
int numColumns = fourColumns ? 4 : 1;
stack_index.store(0);
stack_index.store(SSAInt(0));
{
SSAForBlock loop;
SSAInt index = stack_index.load();