Skip to content

Commit

Permalink
Merge pull request #582 from ELENA-LANG/develop
Browse files Browse the repository at this point in the history
Iteration16 (#581)
  • Loading branch information
arakov authored Jun 26, 2023
2 parents 9a17e96 + 4386cf4 commit 39965f5
Show file tree
Hide file tree
Showing 216 changed files with 12,919 additions and 8,153 deletions.
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
## ELENA 6.0.4b
*27.06.2023*

- ELENE
- fixing variadic multimethod dispatcher

- ELENAVM
- (re)implementing loading classes / symbols / messages / message names

- API
- system'dynamic'DynamicTape
- system'dynamic'expressions'Expression

- SAMPLES
- pi sample
- calc sample

- Tools
- #553 : elt crash fixed

- Misc
- #579 : adding missing files to the installation package

## ELENA 6.0.3b
*30.05.2023*

- ELENA
- #508 : multi-value
- fixing an issue with call stack information : incorrect / missing source code information
- fixing conversion uint to string and back
- fixing number of bugs
- migrating rest of API to ELENA 6.0
- fix implementation of abstract method with the stack allocated returning value

- IDE
- ide : fixing go to source routine

## ELENA 6.0.2b
*31.03.2023*

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.1
6.0.4
75 changes: 68 additions & 7 deletions asm/aarch64/core60.asm
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ define VOIDPTR 2000Eh
define CORE_THREAD_TABLE 2000Fh

define ACTION_ORDER 9
define ARG_MASK 05Fh
define ARG_COUNT_MASK 01Fh
define ARG_MASK 01Fh
define ARG_ACTION_MASK 1DFh

// ; --- Object header fields ---
define elSizeOffset 0004h
Expand Down Expand Up @@ -633,7 +633,7 @@ end
// ; mlen
inline % 15h

and x9, x9, ARG_COUNT_MASK
and x9, x9, ARG_MASK

end

Expand Down Expand Up @@ -740,7 +740,7 @@ end
inline % 20h

cmp x10, #0
csel x10, x0, x10, eq
csel x10, x0, x10, eq

end

Expand Down Expand Up @@ -836,8 +836,61 @@ inline %79h

end

// ; fexp
// ; fexpdp
inline %07Ah

//; static double expo(double n) {
//; int a = 0, b = n > 0;
//; double c = 1, d = 1, e = 1;
//; for (b || (n = -n); e + .00001 < (e += (d *= n) / (c *= ++a)););
//; // approximately 15 iterations
//; return b ? e : 1 / e;

mov x15, #0
fmov d14, #"1E-4" // ; diff = 0.00001

ldr d7, [x0] // ; n

fcmp d7, #0
blt labSkip
fneg d7, d7
mov x15, #1

labSkip:
mov x4, #0 // ; a = 0

fmov d3, #"1E0" // ; e = 1
fmov d5, d3 // ; c = 1
fmov d6, d3 // ; d = 1

// ; e = d3 a = x4, c = d5, d = d6 ; n = d7

labNext:
// ; e + .00001 < (e += (d *= n) / (c *= ++a))
fmov d13, d3

add x4, x4, #1 // ; ++a
fmov d4, x4
frintx d4, d4

fmul d5, d5, d4 // ; c *= (++a)
fmul d6, d6, d7 // ; d *= n
fdiv d12, d6, d5 // ; (d *= n) / (c *= ++a)
fadd d3, d3, d12 // ; e += (d *= n) / (c *= ++a)

fsub d13, d13, d3
fcmp d13, d14
bgt labNext

cmp x15, #0
fmov d16, #"1E0"
bne labSkip2
fdiv d3, d16, d3

labSkip2:
add x19, x29, __arg12_1
str d3, [x19]

end

// ; fln
Expand Down Expand Up @@ -1631,6 +1684,14 @@ labEnd:

end

// ; xstorei
inline % 0AEh

add x11, x10, __arg12_1
ldr x0, [x11]

end

// ; callr
inline %0B0h

Expand Down Expand Up @@ -1662,7 +1723,7 @@ inline %0B5h

end

// ; redirect
// ; xredirect
inline % 0B6h //; (r15 - object, r14 - message)

mov x20, x9
Expand All @@ -1674,7 +1735,7 @@ inline % 0B6h //; (r15 - object, r14 - message)

movz x14, __arg32lo_1
movk x14, __arg32hi_1, lsl #16
and x9, x9, ARG_MASK
and x9, x9, ARG_ACTION_MASK
movz x16, ~ARG_MASK
movk x16, #0FFFFh, lsl #16
and x14, x14, x16
Expand Down
1 change: 1 addition & 0 deletions asm/aarch64/core60_lnx.asm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ procedure % INVOKER
mov x0, x1

blr x8
mov x0, x10

add sp, sp, #16
ldp x29, x30, [sp], #16
Expand Down
32 changes: 23 additions & 9 deletions asm/amd64/core60.asm
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ define CORE_THREAD_TABLE 2000Fh

define ACTION_ORDER 9
define ACTION_MASK 1E0h
define ARG_MASK 05Fh
define ARG_COUNT_MASK 01Fh
define ARG_MASK 01Fh
define ARG_ACTION_MASK 1DFh

// ; --- Object header fields ---
define elSizeOffset 0004h
Expand Down Expand Up @@ -526,7 +526,7 @@ end
// ; mlen
inline % 15h

and edx, ARG_COUNT_MASK
and edx, ARG_MASK

end

Expand All @@ -552,6 +552,13 @@ inline % 17h

end

// ; xassignsp
inline % 117h

lea rbx, [rsp + 8]

end

// ; dtrans
inline %18h

Expand Down Expand Up @@ -1363,14 +1370,14 @@ end
// ; xflushsi 0
inline %1A4h

mov [rsp+8], r10
mov [rsp+__arg32_1], r10

end

// ; xflushsi 1
inline %2A4h

mov [rsp+16], r11
mov [rsp+__arg32_1], r11

end

Expand Down Expand Up @@ -1403,14 +1410,14 @@ end
// ; xrefreshsi 0
inline %1A7h

mov r10, [rsp+8]
mov r10, [rsp+__arg32_1]

end

// ; xrefreshsi 1
inline %2A7h

mov [rsp+16], r11
mov r11, [rsp+__arg32_1]

end

Expand Down Expand Up @@ -1496,6 +1503,13 @@ inline % 1ADh

end

// ; xstorei
inline % 0AEh

mov r10, [rbx + __arg32_1]

end

// ; callr
inline %0B0h

Expand All @@ -1519,14 +1533,14 @@ inline % 0B5h

end

// ; redirect
// ; xredirect
inline % 0B6h // (rbx - object, rdx - message, r10 - arg0, r11 - arg1)

mov r15, rdx
mov r14, [rbx - elVMTOffset]
xor ecx, ecx

and edx, ARG_MASK
and edx, ARG_ACTION_MASK
mov eax, __arg32_1
and ecx, ~ARG_MASK
or edx, ecx
Expand Down
2 changes: 1 addition & 1 deletion asm/amd64/core60_lnx.asm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ procedure % INVOKER

call rax
add rsp, 32 // ; clear FrameHeader+arg
xor eax, eax
mov rax, rbx

// ; restore registers
pop r15
Expand Down
2 changes: 1 addition & 1 deletion asm/amd64/core60_win.asm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ procedure % INVOKER

call rax
add rsp, 32 // ; clear FrameHeader+arg
xor eax, eax
mov rax, rbx

// ; restore registers
pop r15
Expand Down
20 changes: 14 additions & 6 deletions asm/ppc64le/core60.asm
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ define CORE_THREAD_TABLE 2000Fh

define ACTION_ORDER 9
define ACTION_MASK 1E0h
define ARG_MASK 05Fh
define ARG_COUNT_MASK 01Fh
define ARG_MASK 01Fh
define ARG_ACTION_MASK 1DFh

// ; TOC TABLE OFFSETS
define toc_import 0000h
Expand Down Expand Up @@ -689,7 +689,7 @@ end
// ; mlen
inline % 15h

andi. r14, r14, ARG_COUNT_MASK
andi. r14, r14, ARG_MASK

end

Expand Down Expand Up @@ -898,8 +898,9 @@ inline %079h

end

// ; fexp
// ; fexpdp
inline %07Ah

end

// ; fln
Expand Down Expand Up @@ -1679,6 +1680,13 @@ labEnd:

end

// ; xstorei
inline % 0AEh

addi r16, r15, __arg16_1
ld r3, 0(r16)

end

// ; callr
inline %0B0h
Expand Down Expand Up @@ -1711,7 +1719,7 @@ inline % 0B5h

end

// ; redirect
// ; xredirect
inline % 0B6h //; (r15 - object, r14 - message)

mr r20, r14
Expand All @@ -1722,7 +1730,7 @@ inline % 0B6h //; (r15 - object, r14 - message)

lis r18, __arg32hi_1
addi r18, r18, __arg32lo_1
andi. r14, r14, ARG_MASK
andi. r14, r14, ARG_ACTION_MASK

li r19, ~ARG_MASK
addis r19, r19, 0FFFFh
Expand Down
2 changes: 2 additions & 0 deletions asm/ppc64le/core60_lnx.asm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ procedure % INVOKER
mr r3, r4
bctrl // ; and call it

mr r3, r15

addi r1, r1, 16

ld r31, 168(r1)
Expand Down
Loading

0 comments on commit 39965f5

Please sign in to comment.