Wanted: Intel AVX support

Bug #795404 reported by Roman Marynchak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Triaged
Wishlist
Unassigned

Bug Description

http://software.intel.com/en-us/avx/

Already present in Sandy Bridge.

AMD promises to support the same in Bulldozer.

I know that there is cl-simd, but I plan to investigate this from scratch.

Ideally, SBCL should figure out whether CPU has AVX or not, and turn the corresponding support in the compiler on/off.

Tags: compiler avx
Changed in sbcl:
assignee: nobody → Roman Marynchak (roman-marynchak)
status: New → In Progress
Revision history for this message
Stas Boukarev (stassats) wrote :

This shouldn't be limited to AVX. SBCL doesn't use even more common extensions, like SSE2 on x86 (although it does for x86_64). So what needs to be done is some general way to specialize architecture more finely, like -march for GCC

Revision history for this message
Christophe Rhodes (csr21-cantab) wrote : Re: [Bug 795404] Re: Wanted: Intel AVX support

Stas Boukarev <email address hidden> writes:

> This shouldn't be limited to AVX. SBCL doesn't use even more common
> extensions, like SSE2 on x86 (although it does for x86_64). So what
> needs to be done is some general way to specialize architecture more
> finely, like -march for GCC

There exists such a general way: sb-c::*backend-subfeatures*.

Christophe

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

And customize-backend-subfeatures.lisp-expr. They should be documented somewhat better, to say the least, though.

Re. x86/SSE2. I with Paul about this at some point, and IIRC we concluded that we should take a page from linux and have src/compiler/x86-common/ to avoid duplicating things.

Revision history for this message
Stas Boukarev (stassats) wrote :

backend-subfeatures is too low level, I meant something like specifying "core 2 duo" and it automatically selects the right subfeatures for that architecture.

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

I think it would be reasonable to have (sb-ext:detect-backend-subfeatures) that uses CPUid to decide.

I can't see us maintaining a processor name -> available subfeatures mapping, though.

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

Similarly, it would be nice to be able to have two easy build options:

* Local build: check processor and detect available subfeatures.

* Compatible build: use the lowest common denominator -- ie. no optional subfeatures.

Revision history for this message
Paul Khuong (pvk) wrote :

Looking at the plans in <http://software.intel.com/en-us/forums/showpost.php?p=152451>, AVX2 looks like a full-blown fresh port, with support for three-GPR instructions as well.

Revision history for this message
Roman Marynchak (roman-marynchak) wrote :

> Re. x86/SSE2. I with Paul about this at some point, and IIRC we concluded that we should take a page from linux and have
> src/compiler/x86-common/ to avoid duplicating things.

I agree. Will look into this in the scope of this project.

> I think it would be reasonable to have (sb-ext:detect-backend-subfeatures) that uses CPUid to decide.

Right, manual architecture tweaks are not required for SBCL.

> AVX2 looks like a full-blown fresh port

My current goal is to support AVX in Win7 x64 build (but I think that it should work on other platforms too). In case I have something to show (just started this evening, so there is nothing to show), I will mail sbcl-devel or update this page. The plan is to put 8-12 hrs/week into this, so the pace will be a bit slow :)

Changed in sbcl:
importance: Undecided → Wishlist
Revision history for this message
Douglas Katzman (dougk) wrote :

removing "in progress" state for lack of attention in 9 years

Changed in sbcl:
assignee: Roman Marynchak (roman-marynchak) → nobody
status: In Progress → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.