Fixed g++ with Vortex, _start stil not initializing propoerly

This commit is contained in:
fares 2019-11-16 14:35:45 -05:00
parent 19dba43849
commit d5763a8ae7
13 changed files with 32773 additions and 200846 deletions

View file

@ -3,6 +3,10 @@
#define VX_INTRINSICS
#ifdef __cplusplus
extern "C" {
#endif
// Spawns Warps
void vx_wspawn (unsigned numWarps, unsigned PC_spawn);
@ -39,5 +43,8 @@ void vx_resetStack(void);
#define __endif vx_join();
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,6 +1,10 @@
#include "vx_io.h"
#ifdef __cplusplus
extern "C" {
#endif
void vx_print_hex(unsigned f)
{
// vx_print_str(hextoa[f]);
@ -27,4 +31,8 @@ void vx_printf(char * c, unsigned f)
vx_print_str(c);
vx_print_hex(f);
vx_print_str("\n");
}
}
#ifdef __cplusplus
}
#endif

View file

@ -3,8 +3,17 @@
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
static char * hextoa[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
void vx_print_hex(unsigned);
void vx_print_str(char *);
void vx_printf(char *, unsigned);
void vx_printc(unsigned, char c);
void vx_printc(unsigned, char c);
#ifdef __cplusplus
}
#endif

View file

@ -1,5 +1,5 @@
COMP = ~/dev/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-gcc
COMP = ~/dev/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-g++
# CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,linker.ld -ffreestanding -nostdlib
CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,linker.ld -ffreestanding -nostartfiles -nostdlib
@ -7,7 +7,7 @@ DMP = ~/dev/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-objdump
CPY = ~/dev/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-objcopy
NEWLIB = ../../newlib/newlib.c ../../newlib/newlib_notimp.c ../../newlib/newlib.s
NEWLIB = ../../newlib/newlib.c
VX_STR = ../../startup/vx_start.s
VX_INT = ../../intrinsics/vx_intrinsics.s
VX_IO = ../../io/vx_io.s ../../io/vx_io.c

View file

@ -54,6 +54,10 @@ typedef struct {
static int g_num_kernels = 0;
static kernel_info_t g_kernels [MAX_KERNELS];
#ifdef __cplusplus
extern "C" {
#endif
int _pocl_register_kernel(const char* name, const void* pfn, uint32_t num_args, uint32_t num_locals, const uint8_t* arg_types, const uint32_t* local_sizes) {
printf("******** _pocl_register_kernel\n");
printf("Name to register: %s\n", name);
@ -100,6 +104,10 @@ int _pocl_query_kernel(const char* name, const void** p_pfn, uint32_t* p_num_arg
return -1;
}
#ifdef __cplusplus
}
#endif
int exitcode = 0;
cl_context context = NULL;
cl_command_queue commandQueue = NULL;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -18,6 +18,9 @@
#define FILE_IO_WRITE 0x71000000
#define FILE_IO_READ 0x72000000
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*funct_t)(void);
@ -257,3 +260,6 @@ void _link()
#ifdef __cplusplus
}
#endif

View file

@ -1,182 +0,0 @@
# .type __lttf2, @function
# .global __lttf2
# __lttf2:
# ret
# .type __extenddftf2, @function
# .global __extenddftf2
# __extenddftf2:
# ret
# .type __trunctfdf2, @function
# .global __trunctfdf2
# __trunctfdf2:
# ret
# .type __multf3, @function
# .global __multf3
# __multf3:
# ret
# .type __fixtfsi, @function
# .global __fixtfsi
# __fixtfsi:
# ret
# .type __floatsitf, @function
# .global __floatsitf
# __floatsitf:
# ret
# .type __subtf3, @function
# .global __subtf3
# __subtf3:
# ret
# .type __gttf2, @function
# .global __gttf2
# __gttf2:
# ret
# .type __eqtf2, @function
# .global __eqtf2
# __eqtf2:
# ret
# .type __netf2, @function
# .global __netf2
# __netf2:
# ret
# define __udivdi3 __udivsi3
# define __umoddi3 __umodsi3
# define __divdi3 __divsi3
# define __moddi3 __modsi3
# .type __udivsi3, @function
# .global __udivsi3
# __udivsi3:
# move t0, ra
# jal __udivdi3
# jr t0
# .type __umodsi3, @function
# .global __umodsi3
# __umodsi3:
# move t0, ra
# jal __udivdi3
# mv a0, a1
# jr t0
# .type __divsi3, @function
# .global __divsi3
# __divsi3:
# ret
# #endif
# .type __divdi3, @function
# .global __divdi3
# __divdi3:
# bltz a0, .L10
# bltz a1, .L11
# /* Since the quotient is positive, fall into __udivdi3. */
# .type __udivdi3, @function
# .global __udivdi3
# __udivdi3:
# mv a2, a1
# mv a1, a0
# li a0, -1
# beqz a2, .L5
# li a3, 1
# bgeu a2, a1, .L2
# .L1:
# blez a2, .L2
# slli a2, a2, 1
# slli a3, a3, 1
# bgtu a1, a2, .L1
# .L2:
# li a0, 0
# .L3:
# bltu a1, a2, .L4
# sub a1, a1, a2
# or a0, a0, a3
# .L4:
# srli a3, a3, 1
# srli a2, a2, 1
# bnez a3, .L3
# .L5:
# ret
# .type __umoddi3, @function
# .global __umoddi3
# __umoddi3:
# move t0, ra
# jal __udivdi3
# move a0, a1
# jr t0
# .L10:
# neg a0, a0
# bgez a1, .L12 /* Compute __udivdi3(-a0, a1), then negate the result. */
# neg a1, a1
# j __udivdi3 /* Compute __udivdi3(-a0, -a1). */
# .L11: /* Compute __udivdi3(a0, -a1), then negate the result. */
# neg a1, a1
# .L12:
# move t0, ra
# jal __udivdi3
# neg a0, a0
# jr t0
# .type __moddi3, @function
# .global __moddi3
# __moddi3:
# move t0, ra
# bltz a1, .L31
# bltz a0, .L32
# .L30:
# jal __udivdi3 /* The dividend is not negative. */
# move a0, a1
# jr t0
# .L31:
# neg a1, a1
# bgez a0, .L30
# .L32:
# neg a0, a0
# jal __udivdi3 /* The dividend is hella negative. */
# neg a0, a1
# jr t0
# .type __modsi3, @function
# .global __modsi3
# __modsi3:
# move t0, ra
# bltz a1, .L34
# bltz a0, .L35
# .L33:
# jal __udivdi3 /* The dividend is not negative. */
# move a0, a1
# jr t0
# .L34:
# neg a1, a1
# bgez a0, .L30
# .L35:
# neg a0, a0
# jal __udivdi3 /* The dividend is hella negative. */
# neg a0, a1
# jr t0

View file

@ -2,6 +2,9 @@
#include "../intrinsics/vx_intrinsics.h"
#include "vx_api.h"
#ifdef __cplusplus
extern "C" {
#endif
func_t global_function_pointer;
@ -36,7 +39,9 @@ void vx_spawnWarps(unsigned numWarps, unsigned numThreads, func_t func_ptr, void
}
#ifdef __cplusplus
}
#endif
// void vx_cl_spawnWarps(char * args, char * pocl_context, long group_x, long group_y, long group_z)
// {
// if (group_z != 1)

View file

@ -3,6 +3,9 @@
#define VX_API_
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*func_t)(void *);
@ -15,7 +18,9 @@ void vx_cl_spawnWarps (char * /* args */,
long /* group_y */,
long /* group_z */);
#ifdef __cplusplus
}
#endif
#endif