This repository has been archived by the owner on Nov 22, 2023. It is now read-only.
forked from gek169/SISA64
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ideas.txt
91 lines (59 loc) · 2.02 KB
/
ideas.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Ideas for the SISA64 architecture:
1) Multithreading
Implement multithreading by allowing dwrite() to access mutexes and make separate executions of emulate_sisa64() on some fixed number of alternate threads.
2) Tube instructions- linear execution of micro-ops. Tried and it didn't speed things up.
(CANCELLEED)
3) SIMD ops
Allow for simd operations within the gpregs. They take aligned gpreg ids, I.E., a V4 is aligned to 4, so the gpreg id's bottom 2 bits are empty.
V2 is aligned to 2, so the gpreg id's bttom bit is empty.
iv2add
iv2sub
iv2mul
iv4add
iv4sub
iv4mul
fv2add
fv2sub
fv2mul
dv2add
dv2sub
dv2mul
fv4add
fv4sub
fv4mul
dv4add
dv4sub
dv4mul
(CANCELLED)
4) Stack-relative loads and stores - IMPLEMENTED
Allow for reads and writes relative to the stack pointer, using fixed offsets.
ldspXX regid, offset
stspXX regid, offset
5) bswap instructions - IMPLEMENTED
bswap64 rid
bswap32 rid
bswap16 rid
6) mnz instruction- move if not zero. - IMPLEMENTED
mnz rid_test, rid_dest, rid_src
7) Scopes and Local variables. - IMPLEMENTED
I would like to implement scopes in SISA64, with local variables that are register allocated.
Basically, all scope variables are registers. Their names with a dollar sign in front of them
are their register IDs.
I can implement structs and arrays by having a stack allocation and having a pointer to the object
stored in a register, whose register ID is the variable's name in the assembly language.
myFunction:
//the following line modifies scope state internally.
//I've decided that I will not make it allocate anything on the stack.
//So it should be really easy to generate.
//the format of a scope start is requires a pair of parentheses,
//with an optional comma-separated list of variable definitions.
//Then a return value.
${(u64 a, u64 b) -> u64:\
u64 c; \//2
f64 mydouble; \//3
u64 i; \//4
u64 tmp1; \//5
mov $c, $a; //translates to mov 2, 0;
iadd $c, $b; //translates to iadd 2, 1;
$return $c; //translates to mov 0, 2;
$} //end scope