Commit Graph

979 Commits

Author SHA1 Message Date
Matthew Flatt
56049bcd47 update and expand IMPLEMENTATION.md
Incorporate text and explanation from Andy Keep at

  https://groups.google.com/d/msg/chez-scheme/dz6nn-8KDQE/FUaPu695BAAJ

original commit: 5b8a00fc3ef9b892de9af1ae05352fa204e72270
2020-07-24 14:30:43 -06:00
Matthew Flatt
f78dc5724e add pb (portable bytecode) backend
This commit does four things:

 * Adds "pb.ss" and "pb.c", which implement a portable bytecode
   backend and interpreter that is intended for bootstrapping. A
   single set of pb bootfiles can support bootstrapping on all
   platforms --- as long as the C compiler supports a 64-bit integer
   type. The pb machine supports foreign calls for only a small set of
   recognized prototypes, and it does not support foriegn callables.
   Use `./configure --pb` to build the pb variant.

 * Changes the kernel's casts between `ptr` and `void*` types. In a pb
   build, the `ptr` type can be a 64-bit integer type while `void*` is
   a 32-bit pointer type, so casts must go through an intermediate
   integer type.

 * Adjusts the compiler to accomodate run-time-determined endianness.
   Making the compiler agnostic to word size is not practical, but
   only a few pieces depend on the target machine's endianness, and
   those can generally be deferred to a run-time choice of byte-based
   operations. The one exception is that ftype bit fields are not
   allowed unless accompanied by an explicit endianness declaration.

 * Start reducing duplication among platform-specific makefiles. For
   example, `Mf-ta6osx` chains to `Mf-a6osx` to avoid repeating most
   of it. A lot more can be done here.

original commit: 97533fa9d8b8400b0dc1a890768c7d30c91257e0
2020-07-24 13:13:46 -06:00
Matthew Flatt
e9d01f1e4d reduce copied code among back ends
All back ends had essentially the same `define-instruction`, just with
slightly more functionality, checking, or abstraction each case. The
newly shared version better sorts out some inherent run-time checks
versus safe-mode assertions related to fp and non-fp arguments.

original commit: c70836fa04eb33442fd3ca273ce9ca08ce877fec
2020-07-24 12:51:23 -06:00
Paulo Matos
7e3417aa8c Move Implementation file to Markdown
Includes repairs for typos
original commit: b4a8eaffa4173ccd29a49d0e6d4cd0f3ad9386df
2020-07-24 07:28:44 -06:00
Paulo Matos
86c56fbc46 Initial workflow for the ARM64 runner (#25)
Introduces a workflow for an ARM64 self-hosted runner.
original commit: bd5ae74834108079a485c5f3e78a7eb73fd4bcd1
2020-07-20 16:22:50 +02:00
Matthew Flatt
b8c1ce63c6 add option to omit RTD descriptions in fasl output
original commit: 294ca9da084d76aa7b649059856066a1f86fe21b
2020-07-14 20:22:59 -06:00
Matthew Flatt
ec05bac0cf add "externals" fasl support, allow non-strings in sfd
"Externals" supports fasling with some values lifted out an provided
separately.

Lifting the restriction on source file descriptor paths, formerly to
strings, means that paths can be represented in a different way, and
they can be fasled through a different means than the built-in
encodings.

original commit: b6b0ae67b08f2e9bc8b7fafe5ebad0375b6ce9db
2020-07-14 20:22:59 -06:00
Paulo Matos
f73220d0ec Update summary files for CI (#28)
Required for 6627417c0a5737cfb0d04d3ce13f52191c15c78f to work properly.
original commit: 184ecd9a2acf10746438e59dc550337b6d214ecc
2020-07-13 17:11:21 +02:00
Matthew Flatt
e4898ed85a Merge branch 'master' of github.com:racket/ChezScheme
original commit: 0f028cfa990352160698775dcb52970d882ec74c
2020-07-13 08:34:37 -06:00
Matthew Flatt
9e1c89b575 add compile-omit-concatenate-support
Perform slightly less work on every fasl or unfasl of compiled code
that does not need to support `concatenate-object-files`.

original commit: 410985b062a3e2a4cc48da583167254d4adad2d2
2020-07-13 07:38:41 -06:00
Paulo Matos
45fefb214d Add further tests to CI (#27)
original commit: 6627417c0a5737cfb0d04d3ce13f52191c15c78f
2020-07-13 15:22:21 +02:00
Matthew Flatt
fd3b903c1c sync with https://github.com/cisco/ChezScheme on fasl compression
Merge changes in the way that fasl streams are compressed. The new
approach makes compression explicit in the fasl representation, which
means that tricks like uzing zcat on a fasl file will no longer work
(at least not efficiently).

original commit: 167ac7294a2dc400821e4336f0cfc4de621efe97
2020-07-12 19:07:05 -06:00
Matthew Flatt
a4fb72e84c unbreak arm32
original commit: 83221c32b4e8654f0f7d3b3857b7efab5be2bad4
2020-07-12 06:00:00 -06:00
Matthew Flatt
802daa10b1 add memory-order-acquire and memory-order-release
original commit: ea879863f2141ac30532586ff435f16dc4339a8b
2020-07-11 10:02:32 -06:00
Matthew Flatt
32c5af0442 arm64: fix unsafe bitwise shift by 0 and unsafe $fxu< on 0
original commit: 742fe456e3b20caf02156f0c2e0f906cb6fa579f
2020-07-09 22:37:09 +00:00
Matthew Flatt
763c7981a4 add a guide implementation
This first cut is heavy on describing how backends work, because
that's fresh in mind and relevant to ongoing effort.

original commit: 964ce95dc910e6c1825b341bf05492af5903cc82
2020-07-09 14:22:43 -06:00
Matthew Flatt
b2f74f014e add AArch64 (aka Arm64) support as tarm64le
original commit: 9964f27f64cc743fd1dbff7418fce940a4291b01
2020-07-09 06:32:41 -06:00
Matthew Flatt
57a2b8511d unbreak [t]i3nt
Commit 88d57da163 incorrectly merged, because the syntax of `mref` has
changed to support unboxed floating-point arithmetic.

original commit: a8eeb536aecc0e0a363aa68d43edafa7d6c9df52
2020-07-04 10:11:32 -06:00
Matthew Flatt
ac0b1f71ca add functions to traverse a continuation without splitting
original commit: 0f3ff69d4247ec695087953892839d680ed32fff
2020-07-02 06:46:42 -06:00
Matthew Flatt
42c4a90e7c repair for arm32 foreign callables
Especially fix problems with `__collect_safe`, but also deallocate
stack space for `&` returns.

original commit: b593b0f14e7a803d8e089f49e266194245504197
2020-06-29 16:46:53 -06:00
Matthew Flatt
6fc5157f94 arm32: fix sharing domain of fence
original commit: fa32a2919cb5550eabf59b188312f2ed32c57ccf
2020-06-29 07:16:55 -06:00
Matthew Flatt
bdd1eaa874 add tarm32le
Besides adding supportt for `__collect-safe` and other repairs,
introduce a write-write fence with the write barrier, which is
intended to avoid one thread using an object created in another thread
before the object's initializing writes are visible.

original commit: 543bd16739c08e5a8f88c470b52db0f23a27d260
2020-06-29 05:55:47 -06:00
dyb
a958dec07f 16-byte alignment on non-Windows x86
Maintain 16-byte stack alignment (if incoming frames are 16-byte
aligned), because newer versions of gcc count on 16-bit alignment for
some generated SSE instructions.

[This patch is extracted from cisco/ChezScheme#518.
 Merging the rest of that change will take longer.]

original commit: 88d57da163ca287ab37534fd858361a035ce7e4a
2020-06-24 18:54:06 -06:00
Matthew Flatt
9bdc112b4d ppc32: fix icache flush
original commit: d9bf4ebbc5fe32a1d3d35ba096a54e7b78d1f33c
2020-06-22 17:35:47 -06:00
Matthew Flatt
e0a60ac950 ppc32: add missing step in double->single floating-point conversion
original commit: 62a8fbe33a3fecdad1701e3ec196dcf032a777c4
2020-06-20 08:54:15 -06:00
Matthew Flatt
257a29216e update for ppc32
Besides updating for unboxed floating point, the ppc32 build uses a
return register, and the continuation-attachments implementation was
not right for that mode.

original commit: dd2d01fb26ace819c73f258b9b53739f9dda1d34
2020-06-20 07:36:02 -06:00
Matthew Flatt
e4d5ece617 improve local-variable unboxing
Generalize the `np-unbox-fp-vars!` pass to avoid a shallow "known
flonum?" guard.

original commit: d938bac6b720c56a2592dabccafe4954d695d1f7
2020-06-16 12:48:21 -06:00
Matthew Flatt
d9621ebedf better strategy for fp register allocation
original commit: 1648c6f1f160e72991c62778e87d59b188866095
2020-06-14 19:41:40 -06:00
Matthew Flatt
4f35f62a89 fp improvements for x86_64
Specializations for operands that are the same.

original commit: 9585613deebe83366845c4ab203d1d2a4b9cda00
2020-06-14 19:33:08 -06:00
Matthew Flatt
1bc51a7ba4 cp0 loop adjustment for letrec*
original commit: b89cf40dcfd25c382bdb3190f46916ccc63a841e
2020-06-14 19:30:14 -06:00
Matthew Flatt
af04af5aa3 keep single-argument unsafe fl+ and fl* as an unboxing hint
original commit: 054d6da58ceffcce2c5caa6eda5561a122658543
2020-06-14 10:32:30 -06:00
Matthew Flatt
d1f20019ae unbox more flonum operations
Flonum operations like `fltruncate` and `flsin` are implemented by
calling functions from the C library. Unboxing these involves a
generalazation the `foreign-call` intermediate form to handle unboxing
and to work in a non-tail position (especially by telling the register
allocator that caller-saved registers will be trashed). An internal
'atomic convention on a foreign call indicates that no callback into
Scheme is possible, so some setup/teardown (including stashing
callee-saved registers) can be skipped.

original commit: fd89919634d0d5272e046b47bb81bcc66e22a741
2020-06-13 14:25:52 -06:00
Matthew Flatt
4b322677fa flush instruction cache on vfasl load
original commit: 57a7c47dcf1f602d208d14f51f456edb3e2689ae
2020-06-12 14:41:00 -06:00
Matthew Flatt
d26b54dd52 refactor np-expand-primitives unboxing
Shift addition of boxing as needed into the main loop, infer unboxed
variables and `mref`s, and centralize lifting of the `unboxed-fp`
declaration.

original commit: ed8ca4b6c77bdd436b0dee467a8350a450a44fb3
2020-06-12 09:21:46 -06:00
Matthew Flatt
1ce6d97369 fix unboxing with single-argument fl+ and fl*
original commit: 366468c7149dbb59cdf2dce67078e6511b137e9b
2020-06-12 08:07:21 -06:00
Matthew Flatt
23e3597778 fix vfasl for library/C entry 0
original commit: ab36ca79585b69db135b9edeadbc26e9a071f813
2020-06-11 17:24:17 -06:00
Matthew Flatt
4e808d249a fix bounds checking in flonum->fixnum
The comparison was off for 32-bit plaforms, because it didn't allow
fractional increments, The comparison was off for 64-bit platforms,
bbecause it didn't account for round-trip failure when starting from
the largest fixnum.

original commit: 74eb0583ae1b6212fbde459d7486c3d4a0498401
2020-06-10 07:56:37 -06:00
Matthew Flatt
69b597e496 clean up backend API for floating point
Simplify and normalize backend elements for loading, storing, and
converting floating-point numbers, taking better advantage of
new support for floating-pointer registers.

original commit: 4066af9cf3799392ef785a77da69f7cfff74d2fe
2020-06-07 20:02:00 -06:00
Matthew Flatt
a5f877f95d repair a hashtable test
original commit: 021e4e59474034a45c46fe51f4cd6c7ba2305554
2020-06-07 06:25:14 -06:00
Matthew Flatt
6395bd92ff fix foreign-callable handling of bytevector arguments
This is a follow-up to 276f8da076, where `(%tc-ref cp)` was supposed
to be preserved by moving it into %cp, but intrinisics for bytevector
arguments can kill %cp. Use a temporary to expose things properly to
the register allocator.

original commit: 3a29db06a452e46e69ebcde524b3b9acb435dec3
2020-06-06 19:44:40 -06:00
Matthew Flatt
2f5d2ab05a Revert "fix callable handling of string and bytevector arguments"
This reverts commit aa230ac79bed1efa02779bb7bbcde5c009818b74, so it
can be replaced with a solution that is less clumsy and less fragile.

original commit: 533940fdc6905d810deabb457d7004a031a3ac05
2020-06-06 19:31:38 -06:00
Matthew Flatt
a1ddeade2c suppress time-stamp-counter test for arm32le
original commit: 990f051353979049415c29af503556c5b82296e9
2020-06-06 17:57:39 -06:00
Matthew Flatt
aa17bc5d5b make sure threads from thread tests finish
original commit: baf5f3b32940f8060c535428f92b573f46dff9d4
2020-06-06 15:11:17 -06:00
Matthew Flatt
e8a52e23a9 fix ftype-lock! for arm32le
original commit: 16af3430e0f677de8de4af6b8828b9fde7a60243
2020-06-06 15:02:58 -06:00
Matthew Flatt
bbbd5a76ac fix vfasl relocation for arm32
original commit: e15c51c2c29aea545fbb4790f36b15002b7a25a5
2020-06-06 14:29:32 -06:00
Matthew Flatt
0adffe2c19 fix psuedo-random state C view for arm32
original commit: 348c1798d88eea3504961effe7953103044e3ee4
2020-06-06 12:16:11 -06:00
Matthew Flatt
cb4c035a9e fix indirect unsigned return for arm32le
original commit: 158ffeb1db8f425391193f2a205594e3f1a60e99
2020-06-06 09:28:24 -06:00
Matthew Flatt
237f0e4fa4 add a __varargs FFI convention modifier
The varargs convention differs from the fixed-argument convention on
arm32le.

original commit: b2029432e66f188911194cdb8eea2cb3725f5cd3
2020-06-06 09:28:24 -06:00
Matthew Flatt
36aa0aad01 fix callable handling of string and bytevector arguments
This is a follow-up to 276f8da076, where `(%tc-ref cp)` was preserved
by moving into `%cp`, but I missed that intrinisics for string and
bytevector arguments kill `%cp`.

original commit: aa230ac79bed1efa02779bb7bbcde5c009818b74
2020-06-06 09:28:24 -06:00
Matthew Flatt
d2069742ee repairs for arm32le
Includes a repair by @cjfrisz at cisco/ChezScheme#510

original commit: e7ee15332bd8f0e5f0887cff9f6ee45b8b38a4f1
2020-06-05 07:28:37 -06:00