Commit 168f4c34 authored by Camil Staps's avatar Camil Staps 🐧

Add some ABC documentation; update submodules; use compiler fork for use of {#} in generics

parent 86cf851f
Pipeline #17079 passed with stage
in 15 minutes and 34 seconds
...@@ -32,6 +32,8 @@ LABEL :== ABCArgument ABCTypeLabel False ...@@ -32,6 +32,8 @@ LABEL :== ABCArgument ABCTypeLabel False
LABEL_ :== ABCArgument ABCTypeLabel True LABEL_ :== ABCArgument ABCTypeLabel True
A_OFFSET :== ABCArgument ABCTypeAStackOffset False A_OFFSET :== ABCArgument ABCTypeAStackOffset False
B_OFFSET :== ABCArgument ABCTypeBStackOffset False B_OFFSET :== ABCArgument ABCTypeBStackOffset False
A_SIZE :== ABCArgument ABCTypeAStackSize False
B_SIZE :== ABCArgument ABCTypeBStackSize False
STRING :== ABCArgument ABCTypeString False STRING :== ABCArgument ABCTypeString False
STRING_ :== ABCArgument ABCTypeString True STRING_ :== ABCArgument ABCTypeString True
BOOL :== ABCArgument ABCTypeBool False BOOL :== ABCArgument ABCTypeBool False
...@@ -172,25 +174,36 @@ stack_operations = ...@@ -172,25 +174,36 @@ stack_operations =
, push_a "Char" , push_a "Char"
, push_a "Int" , push_a "Int"
, push_a "Real" , push_a "Real"
, i_pop_a
, i_pop_b
, i_push_a
, i_push_b
, i_push_a_b
, build "Bool" BOOL , build "Bool" BOOL
, build "Char" CHAR , build "Char" CHAR
, build "Int" INT , build "Int" INT
, build "Real" REAL , build "Real" REAL
, i_buildAC
, build_b "Bool" , build_b "Bool"
, build_b "Char" , build_b "Char"
, build_b "Int" , build_b "Int"
, build_b "Real" , build_b "Real"
, i_build_r
, i_build_u
, i_buildAC
, i_create_array , i_create_array
, i_create_array_ , i_create_array_
, fill "Bool" BOOL
, fill "Char" CHAR
, fill "Int" INT
, fill "Real" REAL
, fill_b "Bool"
, fill_b "Char"
, fill_b "Int"
, fill_b "Real"
, i_fill
, i_eq_desc , i_eq_desc
, i_eq_desc_b , i_eq_desc_b
, i_eq_nulldesc , i_eq_nulldesc
, i_pop_a
, i_pop_b
, i_push_a
, i_push_b
, i_push_a_b
] ]
where where
push :: !String !ABCArgument -> ABCInstructionEntry push :: !String !ABCArgument -> ABCInstructionEntry
...@@ -225,6 +238,39 @@ where ...@@ -225,6 +238,39 @@ where
, aie_description = "Builds a " + type + "-node with the value on the nth position of the B-stack on the A-stack." , aie_description = "Builds a " + type + "-node with the value on the nth position of the B-stack on the A-stack."
} }
fill :: !String !ABCArgument -> ABCInstructionEntry
fill type arg =
{ zero
& aie_instruction = "fill" + {type.[0]}
, aie_arguments = [arg, A_OFFSET]
, aie_description = "Fills the referenced A-stack node with a boxed " + type + " argument."
}
fill_b :: !String -> ABCInstructionEntry
fill_b type =
{ zero
& aie_instruction = "fill" + {type.[0]} + "_b"
, aie_arguments = [B_OFFSET, A_OFFSET]
, aie_description = "Fills the referenced A-stack node with a boxed " + type + " argument from the referenced B-stack element."
}
i_build_r =
{ zero
& aie_instruction = "build_r"
, aie_arguments = [LABEL, A_SIZE, B_SIZE, A_OFFSET, B_OFFSET]
, aie_description = "Builds a record with the specified number of arguments starting from the referenced offsets."
}
i_build_u =
{ zero
& aie_instruction = "build_u"
, aie_arguments = [LABEL, A_SIZE, B_SIZE, LABEL]
, aie_description = join " "
[ "Builds a thunk with unboxed arguments with the specified number of arguments starting from the tops of the A and B stacks."
, "The first label is for the descriptor and is typically ignored; the second label is the code address."
]
}
i_buildAC = i_buildAC =
{ zero { zero
& aie_instruction = "buildAC" & aie_instruction = "buildAC"
...@@ -311,6 +357,17 @@ where ...@@ -311,6 +357,17 @@ where
, aie_description = "Pushes the A-stack element as an integer (i.e., a pointer to the heap) on the B-stack." , aie_description = "Pushes the A-stack element as an integer (i.e., a pointer to the heap) on the B-stack."
} }
i_fill =
{ zero
& aie_instruction = "fill"
, aie_arguments = [LABEL, A_SIZE, LABEL, A_OFFSET]
, aie_description = join " "
[ "Fills the referenced A-stack node as a thunk with the specified code address and a number of elements from the top of the A-stack."
, "The arguments are popped from the A-stack."
, "The first label is the descriptor, which is typically ignored; the second is the code address."
]
}
branches :: [ABCInstructionEntry] branches :: [ABCInstructionEntry]
branches = branches =
[ i_jmp [ i_jmp
...@@ -527,7 +584,7 @@ where ...@@ -527,7 +584,7 @@ where
{ zero { zero
& aie_instruction = ".d" & aie_instruction = ".d"
, aie_arguments = [A_OFFSET, B_OFFSET, STRING_] , aie_arguments = [A_OFFSET, B_OFFSET, STRING_]
, aie_description = concat , aie_description = join " "
[ "Indicates how many stack elements are on the stack when a jump follows." [ "Indicates how many stack elements are on the stack when a jump follows."
, "The first integer is the number of elements on the A-stack; the second that of B-stack elements." , "The first integer is the number of elements on the A-stack; the second that of B-stack elements."
, "The optional third argument indicates the type of the B-stack elements, e.g. `bbi` for two booleans and an integer." , "The optional third argument indicates the type of the B-stack elements, e.g. `bbi` for two booleans and an integer."
...@@ -537,7 +594,7 @@ where ...@@ -537,7 +594,7 @@ where
{ zero { zero
& aie_instruction = ".n" & aie_instruction = ".n"
, aie_arguments = [A_OFFSET, LABEL] , aie_arguments = [A_OFFSET, LABEL]
, aie_description = concat , aie_description = join " "
[ "Indicates the arity of node entry labels." [ "Indicates the arity of node entry labels."
, "The label is the label of the corresponding descriptor, or `_` if it does not exist." , "The label is the label of the corresponding descriptor, or `_` if it does not exist."
, "\n\nThere are some special cases:\n\n" , "\n\nThere are some special cases:\n\n"
...@@ -552,7 +609,7 @@ where ...@@ -552,7 +609,7 @@ where
{ zero { zero
& aie_instruction = ".nu" & aie_instruction = ".nu"
, aie_arguments = [A_OFFSET, B_OFFSET, LABEL] , aie_arguments = [A_OFFSET, B_OFFSET, LABEL]
, aie_description = concat , aie_description = join " "
[ "Indicates the arity of node entry labels with arguments on the B-stack (otherwise, {{`.n`}} is used)." [ "Indicates the arity of node entry labels with arguments on the B-stack (otherwise, {{`.n`}} is used)."
, "The first integer is the number of A-stack arguments; the second the number of B-stack arguments." , "The first integer is the number of A-stack arguments; the second the number of B-stack arguments."
, "The label is the label of the corresponding descriptor, or `_` if it does not exist." , "The label is the label of the corresponding descriptor, or `_` if it does not exist."
...@@ -562,7 +619,7 @@ where ...@@ -562,7 +619,7 @@ where
{ zero { zero
& aie_instruction = ".o" & aie_instruction = ".o"
, aie_arguments = [A_OFFSET, B_OFFSET, STRING_] , aie_arguments = [A_OFFSET, B_OFFSET, STRING_]
, aie_description = concat , aie_description = join " "
[ "Indicates how many stack elements are 'given back' to a calling function when a {{`rtn`}} follows." [ "Indicates how many stack elements are 'given back' to a calling function when a {{`rtn`}} follows."
, "The first integer is the number of elements on the A-stack; the second that of B-stack elements." , "The first integer is the number of elements on the A-stack; the second that of B-stack elements."
, "The optional third argument indicates the type of the B-stack elements, e.g. `bbi` for two booleans and an integer." , "The optional third argument indicates the type of the B-stack elements, e.g. `bbi` for two booleans and an integer."
...@@ -621,8 +678,6 @@ other_instructions = ...@@ -621,8 +678,6 @@ other_instructions =
, "build" , "build"
, "buildF_b" , "buildF_b"
, "buildh" , "buildh"
, "build_r"
, "build_u"
, "catS" , "catS"
, "call" , "call"
, "cmpS" , "cmpS"
...@@ -637,29 +692,20 @@ other_instructions = ...@@ -637,29 +692,20 @@ other_instructions =
, "eqD_b" , "eqD_b"
, "eq_symbol" , "eq_symbol"
, "exit_false" , "exit_false"
, "fill"
, "fill1" , "fill1"
, "fill2"
, "fill3"
, "fill1_r" , "fill1_r"
, "fill2"
, "fill2_r" , "fill2_r"
, "fill3"
, "fill3_r" , "fill3_r"
, "fillF_b"
, "fill_a"
, "fill_r"
, "fill_u"
, "fillcaf" , "fillcaf"
, "fillcp" , "fillcp"
, "fillcp_u" , "fillcp_u"
, "fill_u"
, "fillh" , "fillh"
, "fillB"
, "fillB_b"
, "fillC"
, "fillC_b"
, "fillF_b"
, "fillI"
, "fillI_b"
, "fillR"
, "fillR_b"
, "fill_a"
, "fill_r"
, "floordivI" , "floordivI"
, "getWL" , "getWL"
, "get_desc_arity" , "get_desc_arity"
......
implementation module Builtin.Predef implementation module Builtin.Predef
import StdArray
import StdBool import StdBool
import StdEnum import StdEnum
import StdInt import StdInt
...@@ -46,10 +47,10 @@ builtin_classes = ...@@ -46,10 +47,10 @@ builtin_classes =
, ce_is_meta=False , ce_is_meta=False
, ce_context=[] , ce_context=[]
, ce_documentation=Nothing , ce_documentation=Nothing
, ce_members=[] , ce_members={}
, ce_instances=[] , ce_instances={}
, ce_derivations=[] , ce_derivations={}
, ce_usages=[] , ce_usages={}
} }
] ]
...@@ -113,9 +114,9 @@ where ...@@ -113,9 +114,9 @@ where
, td_rhs=TDRAbstract Nothing , td_rhs=TDRAbstract Nothing
} }
, tde_doc=Nothing , tde_doc=Nothing
, tde_instances=[] , tde_instances={}
, tde_derivations=[] , tde_derivations={}
, tde_usages=[] , tde_usages={}
} }
defc = defc =
{ cons_name="" { cons_name=""
......
Subproject commit b5525a596368e5c56dab54b011c5ef486275096f Subproject commit 0627dff252c7eccbb9dc63e8311264fab93c0ace
#!/bin/bash #!/bin/bash
set -ev set -ev
install_clean.sh 'base lib-platform lib-tcpip' 2018-12-05 PATCHCLEANBUILD="sed -i 's:clean-compiler-and-rts compiler itask:cstaps compiler master:' clean-base/linux-x64/git-sources.txt; sed -i 's:compiler-itask:compiler-master:' clean-base/linux-x64/build.sh" \
install_clean.sh 'base lib-platform lib-tcpip' 2018-12-12
PACKAGES="patch jq unzip z3" PACKAGES="patch jq unzip z3"
apt-get update -qq apt-get update -qq
......
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