Skip to content

Commit

Permalink
Adjusted text on compiler support
Browse files Browse the repository at this point in the history
Provided some additional details and information in getting SIMD types
to work at a compiler level

Fix spelling issue

Fix spelling issue

Fixing multiplication example

In the table below, multiplication is not defined by SIMD int4 types. I
have not been able to get the example to compile as a result. However,
this seems to work.

Removing text related to version(D_SIMD)

Apparently version(D_SIMD) is not supposed to be used in this case. Made some other small modifications to the text to make it flow better with the other stuff removed.

Fixing -m64 flag

Incorporating andralex's recommendation to replace a code line for -m64
for something inline.

Changing Conversion text

Bringing the float4 text back to int4, but changing the multiplication
to addition (because that works).

Removing example for DMD

Having some issues with building this with DMD reference. Just removing
text and keeping it more general.
  • Loading branch information
jmh530 committed Aug 15, 2015
1 parent d7e1cfb commit b2219c6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions simd.dd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $(SPEC_S Vector Extensions,
operations, sometimes called "media instructions".
Vector types are a fixed array of floating or integer types, and
vector operations operate simultaneously on them, thus achieving
great speedups.)
great speed-ups.)

$(P When the compiler takes advantage of these instructions with standard D code
to speed up loops over arithmetic data, this is called auto-vectorization.
Expand Down Expand Up @@ -57,9 +57,14 @@ import core.simd;
---

$(P These types and operations will be the ones defined for the architecture
the compiler is targetting. If a particular CPU family has varying
the compiler is targeting. If a particular CPU family has varying
support for vector types, an additional runtime check may be necessary.
The compiler does not emit runtime checks; those must be done by the programmer.
The compiler does not emit runtime checks; those must be done by the
programmer.
)

$(P Depending on the architecture, compiler flags may be required to
activate support for SIMD types.
)

$(P The types defined will all follow the naming convention:)
Expand Down Expand Up @@ -93,7 +98,7 @@ $(H3 Conversions)

---
int4 v = 7;
v = 3 * v; // multiply each element in v by 3
v = 3 + v; // add 3 to each element in v
---

$(H3 Accessing Individual Vector Elements)
Expand Down

0 comments on commit b2219c6

Please sign in to comment.