Commit d14267bf authored by John van Groningen's avatar John van Groningen

Merge branch 'arm' into 'master'

Introduce architecture dependent Platform files

See merge request !28
parents b66af631 f7858fbc
Pipeline #43181 passed with stage
in 1 minute and 17 seconds
......@@ -5,8 +5,8 @@ test:
- apt-get install -y -qq build-essential
image: "camilstaps/clean:nightly"
script:
- clm -nt -nr -h 67108864 -s 5242880 -IL ArgEnv -IL StdLib -IL Directory -I Pm -I Unix -I Util -I BatchBuild -I Interfaces/LinkerInterface -I cpm/Posix -I cpm Cpm -o cpm/cpm
- cpm CpmLinux.prj --force
- clm -nt -nr -h 67108864 -s 5242880 -IL ArgEnv -IL StdLib -IL Directory -I Pm -I Unix -I Unix/Intel -I Util -I BatchBuild -I Interfaces/LinkerInterface -I cpm/Posix -I cpm Cpm -o cpm/cpm
- cpm CpmLinuxIntel.prj --force
artifacts:
paths:
- "cpm/cpm"
clm -IL ArgEnv -IL StdLib -IL StdEnv -IL Directory -I ../Pm -I ../Util -I ../Unix -I ../Interfaces/LinkerInterface BatchBuild -o batch_build
clm -IL ArgEnv -IL StdLib -IL StdEnv -IL Directory -I ../Pm -I ../Util -I ../Unix -I ../Unix/Intel -I ../Interfaces/LinkerInterface BatchBuild -o batch_build
......@@ -49,6 +49,7 @@ Global
Path: {Project}*cpm*Posix
Path: {Project}*Pm
Path: {Project}*Unix
Path: {Project}*Unix*Arm
Path: {Project}*Util
Path: {Project}*BatchBuild
Path: {Project}*Interfaces*LinkerInterface
......
Version: 1.5
Global
ProjectRoot: .
Target: StdEnv
Exec: {Project}/cpm/cpm
ByteCode:
CodeGen
CheckStacks: False
CheckIndexes: True
OptimiseABC: False
GenerateByteCode: False
Application
HeapSize: 67108864
StackSize: 5242880
ExtraMemory: 8192
IntialHeapSize: 204800
HeapSizeMultiplier: 4096
ShowExecutionTime: False
ShowGC: False
ShowStackSize: False
MarkingCollector: False
DisableRTSFlags: False
StandardRuntimeEnv: True
Profile
Memory: False
MemoryMinimumHeapSize: 0
Time: False
Stack: False
Dynamics: False
GenericFusion: False
DescExL: False
Output
Output: NoReturnType
Font: Monaco
FontSize: 9
WriteStdErr: False
Link
LinkMethod: Static
GenerateRelocations: False
GenerateSymbolTable: False
GenerateLinkMap: False
LinkResources: False
ResourceSource:
GenerateDLL: False
ExportedNames:
StripByteCode: False
Paths
Path: {Project}*cpm
Path: {Project}*cpm*Posix
Path: {Project}*Pm
Path: {Project}*Unix
Path: {Project}*Unix*Intel
Path: {Project}*Util
Path: {Project}*BatchBuild
Path: {Project}*Interfaces*LinkerInterface
Path: {Application}*lib*ArgEnv
Path: {Application}*lib*StdLib
Path: {Application}*lib*Directory
Precompile:
Postlink:
MainModule
Name: Cpm
Dir: {Project}*cpm
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
......@@ -5,6 +5,8 @@ PlatformDependant win_linux_macosx mac :== win_linux_macosx
IF_MACOSX macosx not_macosx :== not_macosx
IF_WINDOWS windows not_windows :== not_windows
IF_ARM arm other :== arm
DirSeparator:=='/'
DirSeparatorString:=="/"
......
definition module Platform
PlatformDependant win_linux_macosx mac :== win_linux_macosx
IF_MACOSX macosx not_macosx :== not_macosx
IF_WINDOWS windows not_windows :== not_windows
IF_ARM arm other :== other
DirSeparator:=='/'
DirSeparatorString:=="/"
EnvsDirName:==""
TempDir :== "/tmp"
application_path :: !{#Char} -> {#Char}
implementation module Platform;
import StdEnv;
application_path :: !{#Char} -> {#Char};
application_path file_name
# s_p = get_appl_path_address;
# end_p = c_string_end s_p;
# s = {c_string_char p \\ p<-[s_p..end_p-1]}
= s+++("/"+++file_name);
c_string_end :: !Int -> Int;
c_string_end p
| c_string_char p<>'\0'
= c_string_end (p+1);
= p;
c_string_char :: !Int -> Char;
c_string_char p = code inline {
load_ui8 0
}
get_appl_path_address :: Int;
get_appl_path_address = code {
pushLc appl_path
}
......@@ -3,7 +3,7 @@ implementation module PmCleanSystem
import StdEnv,StdMisc,StdMaybe
from Directory import pd_StringToPath,getFileInfo,createDirectory,::Path,::FileInfo{pi_fileInfo},::PI_FileInfo{isDirectory},::DirError(..)
import UtilStrictLists
from Platform import DirSeparatorString,IF_MACOSX
from Platform import DirSeparatorString,IF_MACOSX,IF_ARM
import StdPathname
import PmTypes
from PmCompilerOptions import ::CompilerOptions(..),::ListTypes(..),instance == ListTypes
......@@ -986,7 +986,7 @@ write_options_file options_file_name flags heap_size stack_size initial_heap_siz
#! file = IF_INT_64_OR_32
(file FWI
0x464c457f FWI 0x00010102 FWI 0x00000000 FWI 0x00000000 FWI
0x003e0001 FWI 0x00000001 FWI 0x00000000 FWI 0x00000000 FWI
(IF_ARM 0x00b70001 0x003e0001) FWI 0x00000001 FWI 0x00000000 FWI 0x00000000 FWI
0x00000000 FWI 0x00000000 FWI 0x00000094 FWI 0x00000000 FWI
0x00000000 FWI 0x00000040 FWI 0x00400000 FWI 0x00040007 FWI
......
......@@ -3,37 +3,51 @@ implementation module set_return_code
import StdInt
set_return_code_world :: !Int !*World -> *World
set_return_code_world i world = IF_INT_64_OR_32 (set_return_code_world64 i world) (set_return_code_world32 i world)
set_return_code_world i world = IF_INT_64_OR_32 (set_return_code_world_64 i world) (set_return_code_world_32 i world)
set_return_code_world64 :: !Int !*World -> *World
set_return_code_world64 i world = code {
pushI 0
pushLc return_code
:xxx
pop_b 3
| mov dword ptr [rbx+r10],eax
instruction 66
instruction 137
instruction 4
instruction 19
fill_a 0 1
pop_a 1
set_return_code_world_64 :: !Int !*World -> *World
set_return_code_world_64 i world = code {
pushI 0xffffffff
and%
pushLc return_code
:xxx
| assume 4 byte aligned, little endian
| i<<32 if 8 byte misaligned
pushI 3
push_b 1
pushI 4
and%
shiftl%
push_b 2
shiftl%
update_b 0 2
pop_b 1
| pointer and not 4
pushI -5
and%
| or 8 bytes
pushI -8
addI
push_b_a 0
pop_b 1
pushI_a 0
or%
fill1_r _ 0 1 0 0
.keep 0 2
fill_a 1 2
pop_a 2
}
set_return_code_world32 :: !Int !*World -> *World
set_return_code_world32 i world = code {
fill_a 0 1
pop_a 1
pushI 0
pushLc return_code
:xxx
pop_b 3
| mov (%esp),%edx
instruction 139
instruction 20
instruction 36
| movl %edx,(%eax,%ebx,1)
instruction 137
instruction 20
instruction 24
set_return_code_world_32 :: !Int !*World -> *World
set_return_code_world_32 i world = code {
pushI -4
pushLc return_code
addI
:xxx
push_b_a 0
pop_b 1
fill1_r _ 0 1 0 0
.keep 0 2
fill_a 1 2
pop_a 2
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment