sbcl Log

Commit Date  
[60deeb] by Paul Khuong Paul Khuong

Simpler word-sized variable right shifts on x86 and x86-64

* Known negative shifts are converted to another function that
only handles machine-friendly right shifts.

* The transforms and VOPs are conditionalised on ash-right-vops,
so other platforms aren't penalised.

* The new transforms trigger a lot of notes; this is suboptimal,
and one test had to be adjusted.

2013-05-22 03:46:32 Tree
[11dc84] by Paul Khuong Paul Khuong

Simplify (- (- x)) for rationals

The transform is trivial enough to execute without a real pattern
matching framework, but we're close to the limit.

2013-05-22 03:43:03 Tree
[46602b] by Paul Khuong Paul Khuong

Evaluate global inline functions via their fdefinition

* When inlinable global functions are evaluated for value, emit
code to refer to their fdefinition, rather than to a bogus
entry point.

* Make sure we only generate code to refer to XEPs and fail early
otherwise, rather than after backpatching.

* Fixes lp#1035721.

2013-05-21 23:49:19 Tree
[c1ec38] by Paul Khuong Paul Khuong

Truthful error reporting for complicated compile-time type mismatches

Type mismatches for multiple-use LVARs (i.e. resulting from conditional
expressions) can't be pinpointed to a single source for the value(s).

Such expressions used to be reported as type mismatches with the constant
NIL. Instead, switch to a more complex format with the lowest common source
form, if any (hopefully the conditional), and the nodes that may deliver
the form's value.

Do the same when warning about non-EQ-comparable CATCH tags.

2013-05-21 21:57:04 Tree
[09f925] by Paul Khuong Paul Khuong

Implement EQ of unboxed characters and small integers on x86oids

More important now that we actually weaken EQL of EQ-comparable
types into EQ. We just have to re-purpose pre-existing EQL and
CHAR= templates (and adjust the generic test's cost to be less
attractive), but I can't test on !x86oids.

Spotted by Douglas Katzman.

2013-05-21 20:20:40 Tree
[1d68d8] by Paul Khuong Paul Khuong

Complete SSE instruction definitions for x86-64

* New instruction formats:
- 2-byte instructions with GP/mem source and XMM destination.
- 1- and 2-byte instructions with XMM source and GP/mem destination.
- F3-escape instructions GP/mem source and GP destination.
- 2-byte instructions with GP/mem source and GP destination.

* Complete support for SSE instruction sets:
- SSE3
- SSE4.1
- SSE4.2

* Fix definition of pblendvb, blendvps, blendvpd: These require a third operand,
implicitly in XMM0.

* PEXTRW has a new 2-byte encoding in SSE4.1 which allows a memory address as
the destination operand. The new encoding is only used when dst is a memory
address, otherwise the old backward-compatible encoding is used.

* Fix 64-bit popcnt (F3 still comes REX.W), and make it check for operand sizes,
like the new CRC32.

* Slightly adapted from Jonathan Armond to work with Douglas Katzman's F3-specific
r, r/m instruction format.

2013-05-21 19:12:58 Tree
[d94ff3] by Paul Khuong Paul Khuong

Export SB-SIMD-PACK symbols from SB-EXT

Export the SIMD-PACK type, the SIMD-PACK-P predicate,
%make-simd-pack-{ub32,ub64,single,double}, and

These are far from useful yet, but at least future extensions
can work with SB-EXT instead of SB-KERNEL.

Also, says so in NEWS.

2013-05-21 19:12:46 Tree
[bd1a7d] by Paul Khuong Paul Khuong

SB-SIMD-PACK on x86-64

* Enable them by default on x86-64;

* And run some smoke tests, at least.

2013-05-21 19:12:26 Tree
[829ced] by Paul Khuong Paul Khuong

Additional niceties and middle end support for short vector SIMD packs

* Allow FASL loading/dumping of (boxed) SIMD packs, and mark them as
trivially (i.e. without going through make-load-form) dumpable.

* SIMD packs print nicely, and take the element type into account while
doing so.

* (C)TYPE-OF is more accurate for SIMD packs; this enables IR2 conversion
to choose the right primitive type and storage class for constants.

The FASL code was kept on life support by Alexander Gavrilov for too many years,
and the printing logic is a very light adaptation of the output code he developed
for his branch.

2013-05-21 19:11:54 Tree
[3031b2] by Paul Khuong Paul Khuong

Back end work for short vector SIMD packs

* Platform-agnostic changes:
- Declare type testing/checking routines.
- Define three primitive types: simd-pack-double for packs
of doubles, simd-pack-single for packs of singles, and
simd-pack-int for packs of integer/unknown.
- Define a heap-representation for 128-bit SIMD packs,
along with reserving a widetag and filling the corresponding
entries in gencgc's tables.
- Make the simd-pack class definition fully concrete.
- Teach IR1 how to expand SIMD-PACK type checks.
- IR2-conversion maps SIMD-PACK types to the right primitive type.
- Increase the limit on the number of storage classes: SIMD packs
went way past the previous (arbitrary?) limit of 40.

* Platform-specific changes, in src/compiler/target/simd-pack:
- Create new storage classes (that are backed by the float-reg [i.e. SSE]
storage base): one for each of double, single and integer sse packs.
- Also create the corresponding immediate-constant and stack storage
- Teach the assembler and the inline constant code about this new kind
of registers/constants, and how to map constant SIMD-PACKs to which SC.
- Define movement/conversion VOPs for SSE packs, along with VOP routines
needed for basic creation/manipulation of SSE packs.
- The type-checking VOP in generic/late-type-vops is extremely
x86-64-specific... IIRC, there are ordering issues I do not
want to tangle with.

* Implementation idiosyncrasy: while type *tests* (i.e. TYPEP calls) consider
the element type, type *checks* (e.g. THE or DECLARE) only check for
SIMD-PACKness, without looking at the element type. This is allowed by the
standard, is similar to what Python does for FUNCTION types, and helps
code remain efficient even when type checks can't be fully elided.

The vast majority of the code is verbatim or heavily inspired by Alexander
Gavrilov's branch.

2013-05-21 19:11:26 Tree
[b38f10] by Paul Khuong Paul Khuong

Front end infrastructure for short vector SIMD packs

* new feature, sb-simd-pack.

* define a new IR1 type for SIMD packs:
- (SB!KERNEL:SIMD-PACK [eltype]), where [eltype] is a subtype
of the plaform-specific SIMD element type universe, or * (default),
the union of all these possibilities;
- Element types are always upgraded to the platform's element type
(small) universe, so we can easily manipulate unions of SIMD-PACK
types by working in terms of the element types.

* immediately specify the universe of SIMD pack element types
(sb!kernel:*simd-pack-element-types*) for x86-64, to ensure
#!+sb-simd-pack buildability.

* declare basic functions to create/manipulate SIMD packs:
- simd-pack-p is the basic type predicate;
- %simd-pack-tag returns a fixnum tag associated with each SIMD-PACK;
currently, we suppose it only encodes the element type, as the
position of the element type in *simd-pack-element-types*;
- %make-simd-pack creates a 128-bit SIMD pack from a tag and two
64 bit integers;
- %make-simd-pack-double creates an appropriately-tagged pack from
two double floats;
- %make-simd-pack-single creates a tagged pack from four single
- %make-simd-pack-ub{32,64} creates a tagged pack from four 32 bit
or two 64 bit integers;
- %simd-pack-{low,high} returns the low/high integer half of a
128 bit pack;
- %simd-pack-ub{32,64}s returns the four integer quarters or two
integer halves of a 128 bit pack;
- %simd-pack-singles returns the four singles in a 128 bit pack;
- %simd-pack-doubles returns the two doubles in a 128 bit pack.

Alexander Gavrilov kept a branch alive for the last couple years. The
creation/manipulation primitives are largely taken from that branch,
or informed by the branch's usage.

2013-05-21 19:10:50 Tree
[d142a5] by Stas Boukarev Stas Boukarev

Fix foreign-symbol-address transform on +sb-dynamic-core.

Badly placed ` was resulting in a wrong result.

2013-05-21 11:05:19 Tree
[729ce5] by Paul Khuong Paul Khuong

Make some instances of IF/IF conversion more direct

When faced with CFGs that look like (if (if ...) ...), we duplicate
the outer NULL test forward in the branches (and jump to the correct
branch, so very little code is duplicated). However, this transform
depends on later ir1 optimisation to handle patterns like
(if (if ... nil t) ...). Try and get them right with a specialised
rewrite to get good code even when ir1opt doesn't run until fixpoint.

Also, refactored the code a bit while working on it.

2013-05-21 00:02:04 Tree
[9ce27b] by Paul Khuong Paul Khuong

Exploit specialised VOPs for EQL of anything/constant fixnum

By swapping constant arguments to the right ourselves before
strength reducing EQL into EQ, rather than erroneously using

Spotted by Douglas Katzman.

2013-05-20 22:14:43 Tree
[679437] by Paul Khuong Paul Khuong

More efficient integer=>word conversion and fixnump tests on x86-64

* Special-case on 63-bit fixnums to detect non-zero fixnum tag bits
with a shift right when converting fixnum-or-bignum to ub64.

* In fixnump/unsigned-byte-64, use MOVE to avoid useless mov x, x.

* In fixnump/signed-byte-64, use the conversion's left shift to
detect overflows.

* Based on a patch by Douglas Katzman.

2013-05-20 21:38:19 Tree
[39117f] by Paul Khuong Paul Khuong

Cleverer handling of medium (32 < bit width <= 64) constants on x86-64

* Exploit sign-extension for large unsigned constants.

* Always force the remaining operand and the result in a register:
in the worst case, we use a RIP-relative unboxed constant.

* Based on a patch by Douglas Katzman.

2013-05-20 20:58:30 Tree
[aae8dd] by Paul Khuong Paul Khuong

POPCNT instruction on x86-64

Patch by Douglas Katzman.

2013-05-20 19:26:44 Tree
[b67554] by Paul Khuong Paul Khuong

Fix disassembly for BT* instructions on x86oids

* A dedicated instruction format gets the details right.

* Patch by Douglas Katzman.

2013-05-20 19:17:36 Tree
[044fd6] by Paul Khuong Paul Khuong

Annotate disassembly with unboxed constant values

* Only on x86-64, for qword-sized values.

* Patch by Douglas Katzman.

2013-05-20 19:02:45 Tree
[ff68ef] by Paul Khuong Paul Khuong

Improved local call analysis for inlined higher-order functions

Locall analysis greatly benefits from forwarding function arguments to
their use site. Do that in locall and hopefully trigger further rewrites,
rather than waiting for a separate ir1opt phase to do its magic.

2013-05-20 18:49:33 Tree
[f25039] by Paul Khuong Paul Khuong

Constant-fold backquote of constant expressions

* There is no guarantee that backquote expressions cons up fresh
storage, so we are free to allocate (sub)lists or vectors at
compile-time. In addition to regular constant-folding, perform
part of LIST/LIST*/APPEND at compile-time.

* Fix one instance of CL:SORT of now-literal data.

* Implement SB!IMPL:PROPER-LIST-P because BACKQ-APPEND needed that.

* Based on a patch by James Y Knight; closes lp#1026439.

2013-05-20 18:11:48 Tree
[f21e0f] by Paul Khuong Paul Khuong

Enable (type-directed) constant folding for LOGTEST on x86oids and PPC

* COMBINATION-IMPLEMENTATION-STYLE can return :maybe. Like :default,
it enables transforms, but transforms can call C-I-S themselves to
selectively disable rewrites.

* Implement type-directed constant folding for LOGTEST. !x86oids/PPC
platforms get that for free via inlining.

* Use :maybe to enable all LOGTEST transforms except inlining.

2013-05-20 16:19:27 Tree
[0d8a5f] by Paul Khuong Paul Khuong

Exploit associativity to fold more constants

* Implement transforms for logand, logior, logxor and logtest to
detect patterns like (f (f x k1) k2) => (f x (f k1 k2)).

* Same for + and * of rational values.

* Similar logic for mask-signed-field: we only need to keep the
narrowest width.

2013-05-20 15:36:21 Tree
[09c781] by Alastair Bridgewater Alastair Bridgewater , pushed by Alastair Bridgewater Alastair Bridgewater

room: Fix reconstituting CONS cells with unbound-marker in the CAR.

* When I originally rewrote ROOM in terms of RECONSTITUTE-OBJECT,
I looked at what constitutes a valid CONS according to the runtime.
I noticed that one of the immediate types was an unbound marker
and said to myself "nobody's going to put one of those in a list".
This turned out to be a mistake.

* x86 systems (and plausibly not any others) put unbound-markers
in lists when loading FASLs. I have no real idea how or why, but
they do. This would lead to an error, "Unrecognized widetag #x4A
in reconstitute-object".

* Fix, by recording unbound-marker-widetag as being valid as the
first word of a CONS cell.

* Issue reported by "scymtym" on #sbcl.

2013-05-20 19:43:19 Tree
[c6aa07] by Alastair Bridgewater Alastair Bridgewater , pushed by Alastair Bridgewater Alastair Bridgewater

gencgc: Decide earlier about pinning large object pages.

* The old logic here called maybe_adjust_large_object(), and
then re-checked the pointer to preserve for validity. This is
non-optimal, as it means that maybe_adjust_large_object can't
promote pages to newspace directly, it instead merely adjusts the
page allocation to fit the possibly-shrunken object.

* It turns out that large_object pages can contain bignums,
vectors, code-objects, or in unusual cases instances. Neither
bignums, vectors, nor instances can contain embedded objects.
Code-objects can contain only functions or LRAs. None of these
objects have list-pointer-lowtag on their references. The "tail"
of a shrunken object is comprised of conses with both cells as
fixnum zero. The minor catch is that we allow untagged pointers
to pin code-allocated pages, but the saving grace here is that
code-objects don't shrink.

* Alter preserve_pointer() to test the lowtag and page type to
check for invalid pointers to large-object pages before calling
maybe_adjust_large_object() instead of bounds-checking the pointer
after the fact.

2013-05-19 17:00:52 Tree
Older >

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks