Skip to content

Instantly share code, notes, and snippets.

View HyperWinX's full-sized avatar
💭
Learn something? naaaaah. Rewrite whole world? YEAAHHH

HyperWin HyperWinX

💭
Learn something? naaaaah. Rewrite whole world? YEAAHHH
View GitHub Profile
// Import standard library
#import std;
// Make current unit importable
#export as hs_test
// Define "entry point" - function main (it's not an entry point because we exported current unit, it's just an example)
func main(argc is int, argv is char**) returns int {
// Example functionality - let's convert argv[1] to a number
var int result = call std:str_to_int(argv.at(1));
@HyperWinX
HyperWinX / calc.rs
Last active December 27, 2024 15:17
Rust calculator
use std::io::Write;
fn main() {
let mut num1: i64 = 0;
let mut num2: i64 = 0;
let mut result: i64 = 0;
let mut buffer = std::string::String::new();
print!("Enter the first number: ");
let _ = std::io::stdout().flush();
@HyperWinX
HyperWinX / gist:263099afecf1054cb90095a0142350d6
Created December 2, 2024 14:32
SSE-accelerated strcmpeq implementation
global strcmpeq
strcmpeq:
xor rax, rax
xor rdx, rdx
.loop:
movdqu xmm1, [rdi + rdx]
pcmpistri xmm1, [rsi + rdx], 0x18 ; EQUAL_EACH | NEGATIVE_POLARITY
jc .diff
jz .equal