Skip to content
Merged
Show file tree
Hide file tree
Changes from 121 commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
e9a396c
Start branch to rework LLVM generation
pschachte May 17, 2024
db7e36f
Remove all dependencies on llvm-hs and shim out all LLVM generation …
pschachte May 17, 2024
0a4fcec
Compiler successfully builds, but doesn't generate LLVM
pschachte May 19, 2024
e0cccb2
A couple of minor code cleanups
pschachte May 20, 2024
8dd1578
First version of prelude and set up for LLVM
pschachte May 20, 2024
374d91d
Add generated .ll file as a sample.
pschachte May 20, 2024
0b7f25d
Generate external declarations for resources.
pschachte May 21, 2024
aa201f3
Make resource globals undef instead of extern
pschachte May 23, 2024
0b366b4
Clean up resource global declaration generation
pschachte May 23, 2024
7d57433
Add code to write LPVM code into LPVM section
pschachte May 23, 2024
213f4da
Don't add 1 to specified lengths of strings
pschachte May 23, 2024
7b8dafd
Introduce LLVM state monad, currently just holding file handle
pschachte May 24, 2024
4ee2df5
Generate LLVM function signatures: start of code generation
pschachte May 24, 2024
4e108f5
Take signature info from ProcImpln (PrimProto instead of Proto)
pschachte May 27, 2024
c54ee49
pick lint
pschachte May 28, 2024
20aba8d
First go at generating LLVM proc bodies; much is wrong.
pschachte May 28, 2024
eb806d8
Generate foreign LLVM instructions and simple branches. Will need t…
pschachte May 30, 2024
db51de2
Generate proper SSA; built and disassemble tuples for multi-argument…
pschachte May 31, 2024
709ce50
Generate LLVM switches for LPVM forks with more than 2 branches.
pschachte May 31, 2024
4a036d2
Generate C code to report sizes of C types. Start work on generatin…
pschachte Jun 4, 2024
c0078a7
Generate string constants and use them when generating code.
pschachte Jun 5, 2024
8eebd76
Generate decimal integers as character constants in LLVM code.
pschachte Jun 5, 2024
c515ab3
Introduce new CPointer TypeRepresentation, used to represent opaque …
pschachte Jun 5, 2024
d0c9c27
Fix fencepost bug in switch generation.
pschachte Jun 6, 2024
2279fa0
Implement LPVM cast, load, and store
pschachte Jun 6, 2024
91d3e25
Now generates declarations of external called functions; generates g…
pschachte Jun 6, 2024
b6acab9
Define the size of a C pointer
pschachte Jun 7, 2024
a2aac0c
Generate correct form for Wybe strings; add code to generate constan…
pschachte Jun 8, 2024
589d9ca
Handle lpvm access and mutate; improve logging
pschachte Jun 11, 2024
509389c
Partially handle FlowOutByReference and FlowTakeReference
pschachte Jun 11, 2024
9d77740
Add separate partitionArgsWithRefs function to handle by-ref arguments
pschachte Jun 11, 2024
48598f7
Improve doc; start work on handling out-by-reference arguments.
pschachte Jun 12, 2024
3700e77
Reformat description of LLVM output parts
pschachte Jun 12, 2024
bb87c90
regenerate src directory README
pschachte Jun 12, 2024
b0411d6
Improve LLVM module doc
pschachte Jun 12, 2024
f0c508e
Reorganise LLVM module
pschachte Jun 13, 2024
3e34dce
More LLVM module reorg
pschachte Jun 13, 2024
14de69b
Now handle FlowTakeReference and FlowOutByReference; untested.
pschachte Jun 17, 2024
7fc2a89
Improve generated README.md
pschachte Jun 18, 2024
b89621f
fix duplicated types in type conversion exprs
pschachte Jun 18, 2024
93f9754
Fix bugs in deferring calls; add more logging
pschachte Jun 19, 2024
cbaa7c4
Bug fixes, more logging
pschachte Jun 23, 2024
0b57e4b
Slight cleanup
pschachte Jul 5, 2024
4831253
avoid use of bitcast for var = var assignment
pschachte Jul 5, 2024
b211667
Use conversion instrs except for constants
pschachte Jul 12, 2024
bbe6200
bug fix: temp counter was messed up by expansion with fusion
pschachte Jul 12, 2024
3e74e52
Properly set up LLVM monad for each proc
pschachte Jul 12, 2024
3f1fda6
Eliminate unwanted args/parameters
pschachte Jul 16, 2024
ffd6056
Be more systematic with LLVM arguments; fix bug
pschachte Jul 16, 2024
790711e
Generate HO calls
pschachte Jul 17, 2024
d9229b7
Supply new 'volatile' argument to memcpy intrinsic
pschachte Jul 25, 2024
7d9d30e
Generate LLVM for proc specialisations, too
pschachte Jul 26, 2024
b6b916b
Systematially use LLVM names for instructions
pschachte Jul 26, 2024
42b7269
typo
pschachte Jul 26, 2024
e705705
Fix type convertion during LLVM generation
pschachte Jul 27, 2024
4097550
Support switching on signed integers.
pschachte Jul 27, 2024
db1a4e1
Add XXX comments
pschachte Jul 30, 2024
1ac7ce4
Fix generation of switch defaults
pschachte Jul 30, 2024
1d1576b
Ensure SSA form by renaming assigned variables
pschachte Jul 31, 2024
ed1afba
Fix generation of unboxed mutator
pschachte Aug 1, 2024
036483f
Fix handling of load and store instructions
pschachte Aug 1, 2024
5e12865
Log LLVM code; generate .s files on request
pschachte Aug 6, 2024
52355e5
delete accidentally added file
pschachte Aug 6, 2024
0c6d3dc
Improve compatibility with old LLVM generation
pschachte Aug 6, 2024
fd7ecd4
Fix empty variable name for main LLVM section
pschachte Aug 7, 2024
cfc9835
update version number to 0.2
pschachte Aug 7, 2024
1abd35d
Fix problems with extern declarations
pschachte Aug 8, 2024
b3d8984
Write LLVM code for submodules along with parent
pschachte Aug 15, 2024
f23be39
Reduce change to logged LLVM code;
pschachte Aug 16, 2024
5b15fea
Get most tests to pass
pschachte Aug 16, 2024
fbfdc76
Delete spurious directory
pschachte Aug 16, 2024
e7f1f2d
Distinguish between wybe strings and C strings
pschachte Aug 20, 2024
0896ee1
filter out target triple when checking expected results.
pschachte Aug 20, 2024
ba8a12d
Bug fix: non-destructive lpvm mutate mutated wrong structure
pschachte Aug 22, 2024
5975ec7
bug fix: declare wybe_malloc for non-destructive lpvm mutate
pschachte Aug 22, 2024
b28a0a9
Bug fix: lpvm cast fields of unboxed constructors while constructing.
pschachte Aug 22, 2024
e1802ee
Bug fix: support resources in submodules
pschachte Aug 23, 2024
af306fc
Track whether to prefix with 'tail' or 'musttail' based on alloca calls
pschachte Aug 30, 2024
f4c5c19
Finish omitted comment
pschachte Sep 3, 2024
9f4d62c
some code reorganisation
pschachte Sep 3, 2024
122c3c9
Fix handling of HO calls; drop mustinline in defs
pschachte Sep 12, 2024
4cfbd87
Properly load outByRef value from the ref after the call, when it wa…
pschachte Sep 13, 2024
25fa304
Insert date at top of ERRS file
pschachte Sep 17, 2024
f0e7e63
Allocate closures on the heap
pschachte Sep 18, 2024
3db741c
Correct generation of HO trampoline
pschachte Sep 19, 2024
cb7efb8
Eliminate more unnecessary bitcasts
pschachte Sep 19, 2024
e7ec22d
more trivial bitcast removal test cases
pschachte Sep 19, 2024
fdff55d
XXX turn HO call to known closure into FO call
pschachte Sep 19, 2024
429480d
refactor LLVM prescanning to be monadic
pschachte Sep 20, 2024
daebd55
Rename fns to generalise from strings to consts
pschachte Sep 20, 2024
d559fbf
Generate static constants for all-constant closures
pschachte Sep 20, 2024
98bcfeb
Don't turn all HO arguments to i64
pschachte Sep 21, 2024
150b7f7
Fix duplicated externs, building dynamic closures
pschachte Sep 21, 2024
d1a02c5
Add a log message
pschachte Sep 22, 2024
8dcc68b
Store value through out-by-ref pointer as needed
pschachte Sep 24, 2024
a518123
Merge branch 'llvm-update' of https://github.com/pschachte/wybe into …
pschachte Sep 24, 2024
edb3516
Store floats in closures as floats, not ints
pschachte Sep 25, 2024
4f6c32b
Fix handling of externs for mutually recursive modules
pschachte Sep 25, 2024
26d43d9
No conversion needed for equivalent types + add doc
pschachte Sep 26, 2024
c7c6bb0
Handle conversions better
pschachte Oct 4, 2024
fa4a2a5
Ignore changes to source_filename and target triple in complex tests
pschachte Oct 5, 2024
0aae332
Fix syntax error in last commit
pschachte Oct 5, 2024
b1e94e5
Fix bug in out-by-reference call argument
pschachte Oct 8, 2024
1344ca7
Delete no-longer-used source files
pschachte Oct 8, 2024
c5bdc9a
Merge branch 'master' into llvm-update; fix compiler warning
pschachte Oct 8, 2024
fc3f575
Fix expected output for one test; fix test case to be more readable.
pschachte Oct 9, 2024
9493353
Address most of Jame's review comments
pschachte Oct 9, 2024
63ab5aa
Install llvm package for CI testing
pschachte Oct 9, 2024
b3956b2
Code cleanup, remove unused code, changesome XXX comments to TODO
pschachte Oct 9, 2024
9db92bc
Update github CI runners to recent OSes; don't specify llvm 9
pschachte Oct 9, 2024
84f9225
Try debugging CI workflow
pschachte Oct 9, 2024
1ca0dd9
Another try to debug github CI
pschachte Oct 10, 2024
6266c14
Heuristic for final-dump tests to show actual output for error cases …
pschachte Oct 11, 2024
70f073e
Explicitly specify llvm version in ubuntu CI workflow
pschachte Oct 11, 2024
af66747
Also install llvm-18-dev for CI
pschachte Oct 11, 2024
4acfc0a
Keep trying to get ubuntu workflow working
pschachte Oct 11, 2024
777842a
attempt to fix ubuntu build; normalise spaced LLVM array type syntax …
jimbxb Oct 15, 2024
2459b4f
Do LLVM type conversions (bitcasts) on call and return
pschachte Oct 16, 2024
82fd896
Fix: delete .ll file after generating a .s file.
pschachte Oct 16, 2024
8b44583
Fix generated trampolines
pschachte Oct 18, 2024
a77ac97
Delete accidental file; fix up documentation
pschachte Oct 18, 2024
936c409
Some cleanups, mostly removing commented-out code
pschachte Oct 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ on:

jobs:
build:
runs-on: macos-10.15
runs-on: macos-14

steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
brew install llvm
brew install bdw-gc
brew install llvm-hs/llvm/llvm-9
brew install dwdiff
brew install coreutils

Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,32 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get install llvm
sudo apt-get install clang
sudo apt-get install libgc-dev
sudo apt-get install llvm-9-dev
sudo apt-get install libtinfo-dev
sudo apt-get install dwdiff

# GitHub-hosted runners provide Haskell Stack
# https://github.com/actions/virtual-environments/blob/master/images/linux/Ubuntu1804-README.md
# - name: Install Haskell Stack
# run: wget -qO- https://get.haskellstack.org/ | sh

- name: Verify dependencies
run: |
dpkg -s llvm
dpkg -s clang
dpkg -s libgc-dev
dpkg -s dwdiff
llvm-config --version
llc --version
clang --version

# cache Haskell Stack stuff
- name: Cache stack global package db
uses: actions/cache@v1
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ README.html
dist-newstyle
stack.yaml.lock
LOG*
src/c_config
src/CConfig.hs
40 changes: 27 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
INSTALLBIN=/usr/local/bin
INSTALLLIB=/usr/local/lib/wybe

# Configure any extra C library and include directories
EXTRALIBS=-L /usr/local/lib -L /opt/homebrew/lib
EXTRAINCLUDES=-I /usr/local/include -I /opt/homebrew/include


# You shouldn't need to edit anything below here
VERSION = 0.1
VERSION = 0.2
SRCDIR = src
LIBDIR = wybelibs
WYBELIBS = wybe.o command_line.o logging.o random.o benchmark.o
Expand Down Expand Up @@ -40,7 +44,7 @@ install: wybemk
"$(INSTALLBIN)/wybemk" --force-all $(addsuffix ", $(addprefix "$(INSTALLLIB)/,$(WYBELIBS)))


wybemk: $(SRCDIR)/*.hs $(SRCDIR)/Version.lhs
wybemk: $(SRCDIR)/*.hs $(SRCDIR)/CConfig.hs $(SRCDIR)/Version.lhs
stack -j3 build && cp "`stack path --local-install-root`/bin/$@" "$@"

libs: $(addprefix $(LIBDIR)/,$(LIBS))
Expand All @@ -53,37 +57,46 @@ $(LIBDIR)/wybe.o: wybemk $(LIBDIR)/wybe/*.wybe


$(LIBDIR)/wybe/cbits.o: $(LIBDIR)/wybe/cbits.c
clang $(ISSYSROOT) -I /usr/local/include -c "$<" -o "$@"
clang $(ISSYSROOT) $(EXTRAINCLUDES) -c "$<" -o "$@"


$(SRCDIR)/Version.lhs: $(addprefix $(SRCDIR)/,*.hs)
@echo -e "Generating Version.lhs for version $(VERSION)"
@rm -f "$@"
@printf "Version.lhs automatically generated: DO NOT EDIT\n" > "$@"
@printf "\n" >> "$@"
@printf "> module Version (version,gitHash,buildDate,libDir) where\n\n" >> "$@"
@printf "> module Version (version,gitHash,buildDate,libDir,defaultTriple) where\n\n" >> "$@"
@printf "> version :: String\n> version = \"%s\"\n\n" "$(VERSION)" >> "$@"
@printf "> gitHash :: String\n> gitHash = \"%s\"\n\n" "`git rev-parse --short HEAD`" >> "$@"
@printf "> buildDate :: String\n> buildDate = \"%s\"\n\n" "`date`" >> "$@"
@printf "> libDir :: String\n> libDir = \"%s\"\n\n" "$(INSTALLLIB)" >> "$@"
@printf "> defaultTriple :: String\n> defaultTriple = \"" >> "$@"
@clang --version | sed -n 's/Target: *\(.*\)/\1\"/p' >> "$@"
@printf "\n\n" >> "$@"

$(SRCDIR)/CConfig.hs: $(SRCDIR)/c_config
$< > $@

$(SRCDIR)/c_config: $(SRCDIR)/c_config.c
clang $(ISSYSROOT) $(EXTRAINCLUDES) -o $@ $<


.PHONY: doc
doc: src/README.md


# Assemble README markdown source file automatically
src/README.md: src/*.hs Makefile src/README.md.intro src/README.md.outro
src/README.md: src/*.hs Makefile src/README.md.intro src/README.md.outro \
src/Compiler.png src/Detail.png
cat src/README.md.intro > "$@"

printf "The source files in this directory and their purposes are:\n\n" >> "$@"
printf "| File " >> "$@"
printf "| Purpose |\n" >> "$@"
printf "| ---------------------------- " >> "$@"
printf "| -------------------------------------------------------- |\n" >> "$@"
printf "| File | Purpose |\n" >> "$@"
printf "| ---- | -------------------------------------------- |\n" >> "$@"
for f in src/*.hs ; do \
b=`basename $$f` ; \
m=`basename $$f .hs` ; \
printf "| `printf '%-29s' [$$b]\(#$$m\)`| " ; \
printf "| `printf '%-20s' [$$b]\(#$$m\)` | " ; \
sed -n "s/^-- *Purpose *: *\(.*\)/\1/p" $$f | tr -d '\n' ; \
printf " |\n" ; \
done >> "$@"
Expand All @@ -92,15 +105,16 @@ src/README.md: src/*.hs Makefile src/README.md.intro src/README.md.outro
for f in src/*.hs ; do \
m=`basename $$f .hs` ; \
echo -e ; \
sed -E -e '/^-- *Purpose *:/{s/^-- *Purpose *:/## '"$$m -- "'/; G; p;}' -e '/BEGIN MAJOR DOC/,/END MAJOR DOC/{//d ; s/^-- ? ?//p;}' -e 'd' <$$f ; \
echo -e "## $$m <a id="$$m"></a>" ; \
sed -E -e '/BEGIN MAJOR DOC/,/END MAJOR DOC/{//d ; s/^-- ? ?//p;}' -e 'd' <$$f ; \
done >> "$@"

printf "\n\n" >> "$@"
cat src/README.md.outro >> "$@"


test: wybemk
@rm -f ERRS ; touch ERRS
@rm -f ERRS ; printf "Testing run " > ERRS ; date >> ERRS
@rm -f $(LIBDIR)/*.o $(LIBDIR)/wybe/*.o
@echo -e "Building $(LIBDIR)/wybe/cbits.o"
@make $(LIBDIR)/wybe/cbits.o
Expand All @@ -111,4 +125,4 @@ test: wybemk

clean:
stack clean
rm -f $(SRCDIR)/*.o $(SRCDIR)/*.hi $(SRCDIR)/Version.lhs documentation/*.pdf publications/*.pdf $(LIBDIR)/*.o $(LIBDIR)/wybe/*.o test-cases/*.o
rm -f $(SRCDIR)/*.o $(SRCDIR)/*.hi $(SRCDIR)/Version.lhs $(SRCDIR)/CConfig.hs documentation/*.pdf publications/*.pdf $(LIBDIR)/*.o $(LIBDIR)/wybe/*.o test-cases/*.o
10 changes: 3 additions & 7 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


## Error checking:
* Error if foreign call has no outputs; suggest use !I/O.
* Error if foreign call has no outputs; suggest `use !io` or make it impure.
* Ensure no statement binds the same variable multiple times


Expand All @@ -38,11 +38,8 @@
* Fix the syntax!
* Support curley braces to specify sets and maps
* Interpolation (in strings, arrays, sets, and maps)
* "...@foo..." means "..." `,,` foo `,,` "..."
* "...@(foo(bar,baz))..." means "..." `,,` foo(bar,baz) `,,` "..."
* [foo,@bar(baz),zip] means [foo] `,,` bar(baz) `,,` [zip]
* if `,,` can run backwards, then [?foo,@?bar] and [@?foo,bar] can be patterns
* with this, do we need `[ ... | ...]` syntax?
* "...$(foo(bar,baz))..." means "..." `,,` foo(bar,baz) `,,` "..."
* [foo,$bar(baz),zip] means [foo] `,,` bar(baz) `,,` [zip]
* Support "commutative" resources, which don't need to be threaded everywhere
* Support unicode
* Investigate situation calculus
Expand Down Expand Up @@ -86,5 +83,4 @@


## Porting:
* to Windows
* Rewrite compiler in Wybe
63 changes: 44 additions & 19 deletions WYBE.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ Hello, World!

Note that `wybemk` is like `make` in that you give it the name of the
file you want it to build, and it figures out what files it needs
to compile.
to compile. Currently, the Wybe compiler can generate an executable file, an
object (.o) file, an LLVM assembler (.ll) file, an LLVM bitcode (.bc), and a
native assembly language (.s) file from a wybe source file.

### Compiler Options

Expand All @@ -108,8 +110,8 @@ can be found with the following:

#### Optimisation Options

The `--llvm-opt-level` (`-O`) options specifies the level of optimisation used
within the LLVM compiler during the compilations stage of a Wybe module. By default, this is set to 3, yet supports the values 0, 1, 2, or 3. More information
The `--llvm-opt-level` (-O) option specifies the level of optimisation used
within the LLVM compiler during the compilation stage of a Wybe module. By default, this is set to 3, yet supports the values 0, 1, 2, or 3. More information
can be found [here](https://llvm.org/docs/CommandGuide/llc.html#id1).


Expand Down Expand Up @@ -2243,18 +2245,38 @@ Floating point multiplication
Floating point division
- `foreign llvm frem(`arg1:float, arg2:float`)`:float
Floating point remainder
- `foreign llvm fcmp_eq(`arg1:float, arg2:float`)`:bool
- `foreign llvm fcmp_ord(`arg1:float, arg2:float`)`:bool
Floating point ordered (neither is a NaN)
- `foreign llvm fcmp_oeq(`arg1:float, arg2:float`)`:bool
Floating point equality
- `foreign llvm fcmp_ne(`arg1:float, arg2:float`)`:bool
- `foreign llvm fcmp_one(`arg1:float, arg2:float`)`:bool
Floating point disequality
- `foreign llvm fcmp_slt(`arg1:float, arg2:float`)`:bool
- `foreign llvm fcmp_olt(`arg1:float, arg2:float`)`:bool
Floating point (signed) strictly less
- `foreign llvm fcmp_sle(`arg1:float, arg2:float`)`:bool
- `foreign llvm fcmp_ole(`arg1:float, arg2:float`)`:bool
Floating point (signed) less or equal
- `foreign llvm fcmp_sgt(`arg1:float, arg2:float`)`:bool
- `foreign llvm fcmp_ogt(`arg1:float, arg2:float`)`:bool
Floating point (signed) strictly greater
- `foreign llvm fcmp_sge(`arg1:float, arg2:float`)`:bool
- `foreign llvm fcmp_oge(`arg1:float, arg2:float`)`:bool
Floating point (signed) greater or equal
- `foreign llvm fcmp_ord(`arg1:float, arg2:float`)`:bool
Floating point unordered (either is a NaN)
- `foreign llvm fcmp_ueq(`arg1:float, arg2:float`)`:bool
Floating point unordered or equal
- `foreign llvm fcmp_une(`arg1:float, arg2:float`)`:bool
Floating point unordered or not equal
- `foreign llvm fcmp_ult(`arg1:float, arg2:float`)`:bool
Floating point unordered or strictly less
- `foreign llvm fcmp_ule(`arg1:float, arg2:float`)`:bool
Floating point unordered or less or equal
- `foreign llvm fcmp_ugt(`arg1:float, arg2:float`)`:bool
Floating point unordered or strictly greater
- `foreign llvm fcmp_uge(`arg1:float, arg2:float`)`:bool
Floating point unordered or greater or equal
- `foreign llvm fcmp_true(`arg1:float, arg2:float`)`:bool
Always returns true with no comparison
- `foreign llvm fcmp_false(`arg1:float, arg2:float`)`:bool
Always returns false with no comparison

##### <a name="conversion"></a>Integer/floating point conversion

Expand Down Expand Up @@ -2282,16 +2304,19 @@ declaration has the form:
where *rep* has one of these forms:

- `address`
the type is a machine address, similar to the `void *` type in C.
- *n* `bit` *numbertype*
a primitive number type comprising *n* bits, where *n* is any non-negative
integer and *numbertype* is one of:
- `signed`
a signed integer type
- `unsigned`
an unsigned integer type
- `float`
a floating point number; *n* must be 16, 32, 64, or 128.
the type is the address of a Wybe data structure. Foreign code should not
treat this as an ordinary pointer.
- `opaque`
the type is a machine address, similar to the `void *` type in C. Wybe treats such values as opaque.
- *n* `bit signed`
a signed primitive number type comprising *n* bits, where *n* is any non-negative
integer. Represents integers between -2<sup>*n*-1</sup> and 2<sup>*n*-1</sup>-1 inclusive.
- *n* `bit unsigned`
an unsigned primitive number type comprising *n* bits, where *n* is any non-negative
integer. Represents integers between 0 and 2<sup>*n*</sup>-1 inclusive.
- *n* `bit float`
a floating point number type comprising *n* bits, where *n* is one of 16, 32,
64, or 128.

Like a `constructor` declaration, a `representation` declaration makes the
enclosing module into type. Also like a `constructor` declaration, a submodule
Expand Down
15 changes: 15 additions & 0 deletions hello.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-macosx14.0.0"

; Declare the string constant as a global constant.
@.1 = private unnamed_addr constant [17 x i8] c"hello from LLVM!\00"

; External declaration of the puts function
declare i32 @puts(ptr nocapture) nounwind

; Definition of main function
define i32 @main() {
; Call puts function to write out the string to stdout.
call i32 @puts(ptr @.1)
ret i32 0
}
6 changes: 0 additions & 6 deletions hie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ cradle:
- path: "./src/BinaryFactory.hs"
component: "wybe:exe:wybemk"

- path: "./src/Blocks.hs"
component: "wybe:exe:wybemk"

- path: "./src/BodyBuilder.hs"
component: "wybe:exe:wybemk"

Expand All @@ -24,9 +21,6 @@ cradle:
- path: "./src/Clause.hs"
component: "wybe:exe:wybemk"

- path: "./src/Codegen.hs"
component: "wybe:exe:wybemk"

- path: "./src/Config.hs"
component: "wybe:exe:wybemk"

Expand Down
83 changes: 83 additions & 0 deletions logging.ll

Large diffs are not rendered by default.

Loading
Loading