Commit Graph

944 Commits

Author SHA1 Message Date
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
Matthew Flatt
c103184272 repairs for unboxing
Fix nested-loop handling with union find, and fix unboxing check
to properly account for a primitive's arity.

original commit: af2f8784d96f09624b97476fb7b674a77097f9d0
2020-06-04 09:18:53 -06:00
Matthew Flatt
c9f2d1e156 i3 repairs related to fp unboxing
original commit: 0f33056b6503013237b26c09c2e9baba4377a750
2020-06-03 16:29:26 -06:00
Matthew Flatt
a1def58a46 test corrections
original commit: df411ac716894d9354448d9b53ab96ec165b33dd
2020-06-03 15:27:07 -06:00
Matthew Flatt
6d65be6234 fix places where a lambda name was fumbled
original commit: 7fc5a6c5c6ce9f7979ca88e71c79521b5f5ad408
2020-06-03 11:08:58 -06:00
Matthew Flatt
b53e6a990c fix broken use of state in cp0 for single-value and names
Preinfo recoreds were mutated under the incorrect assumption that they
were specific to a `lambda` form, which is not true, especially after
some inlining.

original commit: 489b4c732d7359b1c7c4558d41d5e6ba3a9abafa
2020-06-03 06:12:29 -06:00
Matthew Flatt
f3209ca63c fix fl comparison with more than inline-args-limit arguments
original commit: 0efbfb50b372009d0974edc01e6194179d7300ef
2020-06-01 06:59:03 -06:00
Matthew Flatt
43e2bc0327 unbreak Windows build
original commit: 999d4e9fc8b9cbeedc58b625f814a1db8172a259
2020-05-31 19:10:13 -06:00
Matthew Flatt
58282cbb5f correct GC problem with mark mode
The problem especially affects `enable-object-counts`, where mark mode
can update an old rtd instead of a copy that is already made.

original commit: 31e2df63894d39b005c6b9984745b44409198d02
2020-05-31 17:09:07 -06:00
Matthew Flatt
7768b09118 unbox local floating-point arithmetic
Avoid allocating a flonum object for floating-opint calculations
that are consumed only by other floating-point caculations.

For this first cut, unboxing applies only to fl+, fl-, fl*, fl/,
flabs, fl<, fl<=, fl=, fl>, fl>=, bytevector-ieee-double-[native-]ref,
and bytevector-ieee-double-[native-]set!. Local variables can be
unboxed in the same way as implicit temporaries, and loop arguments
can be unboxed, but values in a closure and function-call arguments
are always boxed.

arm32 support is mostly in place, but not yet right. ppc32 support is
not yet implemented.

This commit includes a small change that is incompatible with previous
Chez Scheme versions: `(fl= +nan.0)` (and similar for other
comparisons) produces true instead of false.

original commit: 36459e43f10705aa3e383376ca7d54cf2998b7ee
2020-05-31 17:08:38 -06:00
Matthew Flatt
75f287befd cp0: repair move of non-tail into 'effect context
Kent noticed the bug, where `make-nontail` used `ignored` where it
should have used `effect`. Also, Kent points out that `make-nontail`
can skip the `$values` wrapped in `effect` contexts in unsafe mode.

original commit: edd9ba3d656f3bd712e5e235b77225f756397077
2020-05-23 06:30:02 -06:00
Matthew Flatt
c5ee80bf0d adjust flonum printing to be more like %g
Adjust the choice between exponential and not.

Closes racket/racket#3195

original commit: 3a71e6fb6240d1c9e206064a613835c6eea871aa
2020-05-20 06:21:39 -06:00
Matthew Flatt
a820e425d6 cp0: don't drop 'ignored if with multiple values
Closes racket/racket#3092

original commit: 9e928cf79caf536744491e6889e5c71bcd14c264
2020-05-18 16:00:49 -06:00
Paulo Matos
a8b3c8b608 Add further archs for testing (#24)
Add testing for non-threaded x86_64, and i386 versions and remove references to travis_fold directives in testing.

original commit: 441cdb166081e96eaecd513d5f13a8796fd451b4
2020-05-18 13:19:46 +02:00
Matthew Flatt
605ae48f24 fix portability of some tests
original commit: 5b14f79d4d513b1d093084d55e3926f58e71eda8
2020-05-15 14:41:28 -06:00
Matthew Flatt
a106c50798 gc repairs
* Fix calculation of segment index for 32-bit platforms

 * Fix allocation of mark-bit and list-bit arrays in certain unusual
   cases.

 * Fix dirty sweep of records on marked pages that have non-pointer
   fields.

 * Fix allocation of eveen-sized immobile vectors; a pad word needs to
   be cleared.

 * Fix and extend the heap checker (which was used to find several of
   the other problems).

original commit: 8b5e65f5eafac5aea7394901e1dd2f2fc3ccf2bd
2020-05-15 14:40:55 -06:00
Matthew Flatt
96616baa47 unbreak non-threaded build
original commit: c077acf7dd65bcb397e846c786ac546888b5798a
2020-05-15 07:19:51 -06:00
Paulo Matos
74ee485b21 Ensure that the literal 1 is wide enough for a shift (#23)
Fixes runtime error found by ubsan.
original commit: 65e05772a1ee14d73c368f311e837b00af771a23
2020-05-07 17:34:45 +02:00
Matthew Flatt
0d225f5505 x86_64: fix popcount without POPCNT
Commit 68b2f597ec moved the argument from RDI to RCX, but the
`popcount-slow` function wasn't updated.

Related to racket/racket#3150

original commit: 80ffa4eea197a885cd647fcfb76dda720b64781d
2020-05-06 12:18:36 -06:00
Matthew Flatt
c7f4261611 fix ephemerons when dirty and reachable during counting
Part of the repair makes it ok to re-sweep an ephemeron, which is more
consistent with evertything else.

original commit: 2c11bb39129b1492108390a704eb08deaa5d6bcc
2020-04-28 09:02:44 -06:00
Paulo Matos
689a3f8abc Merge pull request #22 from pmatos/actions-ci
Move to GitHub Actions CI
original commit: 548af4b5bcc7d1201d5aabfdeb477248a65b86f2
2020-04-27 16:11:11 +02:00
Matthew Flatt
a9e37d0548 sync simpler handling of tc U, V, W, X, Y
They apparently don't need to be preserved across a GC.

original commit: 830d176bdaf0c19c44e5f4037da0de621d3d9957
2020-04-26 20:13:54 -06:00
Paulo Matos
ea2454ec7b Remove broken archs
original commit: 443c99decdffb016b6b048904f854bd183b66efc
2020-04-26 14:33:29 +02:00
Paulo Matos
63239e5d78 Fix libs
original commit: 257e00f48932fa02cf3f507adf482345edc2adc4
2020-04-26 14:15:49 +02:00
Paulo Matos
00bb57300b Install libs
original commit: 716f0eec0d1d00905e92237401aaa5bf524a4a47
2020-04-26 14:12:15 +02:00
Paulo Matos
d2fc1f4235 Fix syntax
original commit: fb2afff12c3924889a8dab383fb655f7fe726bba
2020-04-26 13:55:09 +02:00
Paulo Matos
a523d285cd download submodules
original commit: dc1e5a41955a1c9d20cff84fc03ec211226bfd47
2020-04-26 13:53:24 +02:00