Commit graph

32 commits

Author SHA1 Message Date
water111 82fb2cc26a
Port bones.gc math to GOAL (#3425)
Reverse engineer the skinning matrix calculation and port to GOAL. This
is about 3x faster than the MIPS2c version.

As usual, there is a `*use-new-bones*` flag to go back to the old
version.

Fix for a bug in the compiler's `.div.vf` implementation (only happens
if src/dst are the same), and fix for a typo in the register allocator
that would sometimes cause it not to consider xmm8-xmm15.
2024-03-15 20:31:11 -04:00
Tyler Wilding 60db0e5ef9
deps: update fmt to latest version (#3403)
This updates `fmt` to the latest version and moves to just being a copy
of their repo to make updating easier (no editing their cmake / figuring
out which files to minimally include).

The motivation for this is now that we switched to C++ 20, there were a
ton of deprecated function usages that is going away in future compiler
versions. This gets rid of all those warnings.
2024-03-05 22:11:52 -05:00
water111 e2b7e5c001
[goalc] reduce compiler memory usage (#2247) 2023-02-24 18:32:30 -05:00
water111 70e231fa72
[jak 2] merc (#2039) 2022-11-30 22:36:09 -05:00
Tyler Wilding 4d751af38e
logs: replace every fmt::print with a lg call instead (#1368)
Favors the `lg` namespace over `fmt` directly, as this will output the
logs to a file / has log levels.

I also made assertion errors go to a file, this unfortunately means
importing `lg` and hence `fmt` which was attempted to be avoided before.
But I'm not sure how else to do this aspect without re-inventing the
file logging.

We have a lot of commented out prints as well that we should probably
cleanup at some point / switch them to trace level and default to `info`
level.

I noticed the pattern of disabling debug logs behind some boolean,
something to consider cleaning up in the future -- if our logs were more
structured (knowing where they are coming from) then a lot this
boilerplate could be eliminated.

Closes #1358
2022-10-01 11:58:36 -04:00
water111 628ce47b2e
compiler speed improvement (#1547) 2022-06-24 18:21:24 -04:00
Tyler Wilding 2d595c1ac0
lint: add include sorting config to clang-format (#1517) 2022-06-22 23:37:46 -04:00
Tyler Wilding c4a92571b2
Improve ASSERT macro, fix linux file paths in Taskfile and hopefully fix the windows release (#1295)
* ci: fix windows releases (hopefully)

* scripts: fix Taskfile file references for linux

* asserts: add `ASSERT_MSG` macro and ensure `stdout` is flushed before `abort`ing

* asserts: refactor all `assert(false);` with a preceeding message instances

* lint: format

* temp...

* fix compiler errors

* assert: allow for string literals in `ASSERT_MSG`

* lint: formatting

* revert temp change for testing
2022-04-12 18:48:27 -04:00
water111 78cde74d5a
update readme and fix always playing str (#1139)
* update readme deps

* replace assert

* bump timeout

* fix memory corruption in kernel

* use unknown if level name is invalid
2022-02-08 19:02:47 -05:00
ManDude c9204f2a9b
Fix Windows asserts (#1045)
* fix release mode asserts

* clang

* dummy
2022-01-02 18:02:10 -05:00
water111 7a5562106e
Compiler performance improvements and error clean-up (#782)
* compiler cleanup and error improvement

* fix test
2021-08-24 22:15:26 -04:00
water 21684bd104 misc bug fixes, now draw string generates dma data 2021-08-05 20:29:36 -04:00
water111 aa58d146c2
[goalc] register allocator v2 (#731)
* clean up allocator interface to be simpler

* working on functions without spills

* working for all

* fix missing includes for windows

* more windows includes

* initialize regs to zero so printing value unintiailized by game code is repeatable
2021-08-01 17:46:55 -04:00
water111 542edfb164
[compiler/decompiler] Take the address of a variable (#554)
* support taking the address of variables

* partially working stack variables

* implement type cast stuff

* remove final
2021-06-04 13:43:19 -04:00
ManDude fef9b139d7
Force-enable assert on release mode Windows build (#440) 2021-05-10 23:03:56 -04:00
water111 0a76e6e157
[Decompiler] Make matrix decompile (#341)
* small fixes

* update

* add instructions

* finish matrix

* add matrix test cases
2021-03-28 20:26:30 -04:00
water111 9074a35b9b
[Decompiler] Fix printing of lets (#314)
* fix let prints and windows warnings

* missing include for windows

* windows again
2021-03-07 12:01:59 -05:00
water111 c8d382b35c
[Compiler] Improve spills and register backups (#175)
* xmm spill

* improve getting stack variables

* improve symbol getting

* update changelog
2020-12-31 15:59:11 -05:00
water111 a80b331c27
[Compiler] In-progress support for vector float (AVX) (#171)
* begin work on vf support

* split reg kind into reg hw kind and class, use class for ireg

* try test

* clang format

* add some more ops and some example functions

* better lvf on statics

* add documentation
2020-12-30 15:33:51 -05:00
water111 e05f3ceefc
Implement gkernel: Part 2 (#155)
* update

* small fixes

* deactivate

* simple kernel test
2020-12-08 21:41:36 -05:00
water111 d86964985a
Improve Register Allocator (#154)
* before adding IRegSet stuff

* use bitsets for live analysis

* speed up

* add stack structures

* organize new better
2020-12-06 15:42:26 -05:00
water111 90e5c023f1
Basic Inline Assembly (#149)
* basic inline assembly support

* fix rlet

* clean up detail in IR and update documentation
2020-12-04 12:57:10 -05:00
water111 460ec874bb
Add support for stack integers (#135)
* add support for stack integers

* update documentation

* revise value type stack variables
2020-11-22 12:22:19 -05:00
water111 a45d180f2c
Try to speed up the build (#106)
* first attempt

* attempt 2

* windows and formatting fix
2020-10-29 21:27:52 -04:00
water111 b102d22dd9
Replace Form with goos::Object (#64)
* add pretty printing to goos form

* temp

* fix format

* fix format

* fix windows build

* again

* windows

* Revert "windows"

This reverts commit b7d448e733.

* windows again

* give up and just add a getter function
2020-10-04 17:08:10 -04:00
water111 7ffcfc4703
Merge pull request #41 from xTVaser/pragma-once
Add #pragma once to all header files
2020-09-14 20:31:41 -04:00
Tyler Wilding 345b8e30d8 Resolve a good chunk of windows compiler warnings
Mostly revolved around the new MSVC check for functions that don't cover all paths (ie. a switch statement without a default case).  It appears to not see an assert as a valid default case.

I switched assert(false) to exceptions in these cases.  I believe this should also abort the program, but will also provide a hopefully useful message?  Hopefully this is an improvement.

Resolves #32
2020-09-13 22:02:27 -04:00
Tyler Wilding 9737dfad34 Add #pragma once to all headers
Resolves #19
2020-09-13 21:36:35 -04:00
water111 90a7e9b4b9
Add addition and subtraction for integers, build macros, dgo building, and build/load test (#35)
* see if math works on windows

* add dgo

* windows debug

* windows debug 2

* one more debug try

* add extra debug print and change logic for slashes

* update

* again

* try again

* remove build game

* remove build game

* add back build-game

* remove runtime from test

* test

* reduce number of files

* go to c++ 14

* big stacks

* increase stack size again

* clean up cmake files
2020-09-12 20:41:12 -04:00
water111 d56540f8c0
Add lambda and static objects (#30)
* add some more tests for let

* support static strings

* add function calling

* add prints for windows debgu

* one test only

* try swapping r14 and r15 in windows

* swap back

* disable defun for now

* fix massive bug

* fix formatting
2020-09-12 13:11:42 -04:00
water d49b01e310 working return integer tests as part of gtest 2020-09-06 16:58:25 -04:00
water111 2075dd66b6
Add ObjectGenerator and Register Allocator (#10)
* start the ObjectFileGenerator

* finish v3 generation

* add analysis for register allocator

* add register allocator

* fix const

* fix build

* fix formatting for clang-format

* attempt to fix windows build

* windows 2

* windows 3

* windows 4

* windows 5

* windows 6
2020-09-05 16:37:37 -04:00