Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Abhiroop's full-sized avatar
:electron:
"Syntactic sugar causes cancer of the semicolon."

Abhiroop Sarkar Abhiroop

:electron:
"Syntactic sugar causes cancer of the semicolon."
View GitHub Profile
-- A.hs
module A where
class Foo a where
foo :: a -> Bool
data X = X Int
-- B.hs
CFLAGS = -Wall -Wextra
ifeq ($(DEBUG),1)
GRAMINE_LOG_LEVEL = debug
CFLAGS += -g
else
GRAMINE_LOG_LEVEL = error
CFLAGS += -O3
endif
# Hello World manifest file example
loader.entrypoint = "file:{{ gramine.libos }}"
libos.entrypoint = "/helloworld"
loader.log_level = "{{ log_level }}"
loader.env.LD_LIBRARY_PATH = "/lib:/lib/x86_64-linux-gnu"
fs.mounts = [
{ path = "/lib", uri = "file:{{ gramine.runtimedir() }}" },
@Abhiroop
Abhiroop / test.c
Created November 22, 2022 13:22
Foreign Export
#include<HsFFI.h>
.
.
static void my_enter(void) __attribute__((constructor));
static void my_enter(void)
{
static char *argv[] = { "libFoo.so", 0 }, **argv_ = argv;
static int argc = 1;
hs_init(&argc, &argv_);
}

aaaa

#include <zephyr.h>
#include <device.h>
#include <drivers/gpio.h>
#include <sys/util.h>
#include <sys/printk.h>
#include <inttypes.h>
#define SLEEP_TIME_MS 1
@Abhiroop
Abhiroop / foo.java
Created January 29, 2021 07:54
foo
file
@Abhiroop
Abhiroop / FinalEvaluation.md
Last active September 11, 2018 18:34
GSoC final evaluation

Overview of Vectorization support in GHC

With the completion of GSoC 2018, this project has completed an initial step to introduce basic vectorization functions to the Glasgow Haskell Compiler. At the end of this project my branch of GHC (https://github.com/Abhiroop/ghc-1/tree/wip/simd-ncg-support) supports:

Among constructors and de-constructors

broadcastFloatX4# :: Float# -> FloatX4#
#include <stdio.h>
#include <smmintrin.h> //SSE4_1
#include <emmintrin.h> //SSE2
void print128_num(__m128i var)
{
//int64_t *v64val = (int64_t*) &var;
//printf("%.16llx %.16llx\n", v64val[1], v64val[0]);
diff --git a/compiler/cmm/CmmCallConv.hs b/compiler/cmm/CmmCallConv.hs
index e1067e9..241a8f5 100644
--- a/compiler/cmm/CmmCallConv.hs
+++ b/compiler/cmm/CmmCallConv.hs
@@ -66,7 +66,7 @@ assignArgumentsPos dflags off conv arg_ty reps = (stk_off, assignments)
| otherwise = int
where vec = case (w, regs) of
(W128, (vs, fs, ds, ls, s:ss))
- | passVectorInReg W128 dflags -> k (RegisterParam (XmmReg s), (vs, fs, ds, ls, ss))
+ | passVectorInReg W128 dflags -> k (RegisterParam (XmmReg s 4 W32), (vs, fs, ds, ls, ss))