Skip to content

Instantly share code, notes, and snippets.

View RealNeGate's full-sized avatar

Yasser Arguelles Snape RealNeGate

  • Washington, USA
View GitHub Profile
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "DynArray.h"
typedef enum {
TOKEN_IDENTIFIER, // abc0123
TOKEN_NUMBER, // 1738
TOKEN_STRING, // "Blah"
// The Computer Language Benchmarks Game
// https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
//
// Contributed by Mark C. Lewis.
// Modified slightly by Chad Whipkey.
// Converted from Java to C++ and added SSE support by Branimir Maksimovic.
// Converted from C++ to C by Alexey Medvedchikov.
// Modified by Jeremy Zerfas.
// Modified by Yasser Arguelles
#pragma once
#include <stdio.h>
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#define NULL_REG SIZE_MAX
typedef size_t Reg;
#pragma once
#include <stdio.h>
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
typedef float Vec3 __attribute__((ext_vector_type(3)));
#define MAX_KD_NODES 1024
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
enum {
FS_MAGIC_NUMBER = 0x666f6f64,
FS_LATEST_VERSION = 1,
};
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define STRINGIZE(arg) STRINGIZE1(arg)
#define STRINGIZE1(arg) STRINGIZE2(arg)
#define STRINGIZE2(arg) #arg
#define CONCATENATE(arg1, arg2) CONCATENATE1(arg1, arg2)
#define CONCATENATE1(arg1, arg2) CONCATENATE2(arg1, arg2)
typedef struct ParticleSet {
size_t count;
// note that each of these arrays have to be aligned to the vector
// width we'll be working with, since it always updates in multiples
// of the vector width.
float* x;
float* y;
float* z;
float* vx;
#include <x86intrin.h>
typedef struct TriangleX4 {
__m128 ax, ay, az;
__m128 bx, by, bz;
__m128 cx, cy, cz;
} TriangleX4;
typedef struct TriangleNormalX4 {
__m128 nx, ny, nz;
Everything is not a damn file:
I'm splitting up the idea of files to be "nicer" files are storage concepts, a USB device is a device, and stdout is a stream
GPUs as first class devices:
OS functionality for executing code on them, memory mapping, and overall GPU use on the userland without a graphics API or a mess
Sandboxing the file system:
Each file gets a mini filesystem and that's all they get access to by default, it makes install and uninstall nicer, gives apps a clear place to put their data into, and improves security
Unified UI renderer:
defcolor_back = 0xFF041818;
defcolor_margin = 0xFF323232;
defcolor_margin_hover = 0xFF333333;
defcolor_margin_active = 0xFF404040;
defcolor_list_item = {defcolor_margin, defcolor_back};
defcolor_list_item_hover = {defcolor_margin_hover, defcolor_margin};
defcolor_list_item_active = {defcolor_margin_active, defcolor_margin_active};
defcolor_cursor = {0xFF90EE90, 0xFF90EE90};
defcolor_at_cursor = defcolor_back;