[Issue 15228] New: Expose architecture specific feature sets at compile-time

2015-10-20 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15228

  Issue ID: 15228
   Summary: Expose architecture specific feature sets at
compile-time
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: marco.le...@gmx.de

GDC and LLVM allow you to target a specific CPU model or activate additional
feature sets like SSE4 on the command line. This allows them to use different
instructions for intrinsics internally and better optimize the code. For
example some newer x86 CPUs have a "count-leading-zeroes" instruction that
other models need to emulate.

If these were exposed in D at compile-time we could replace indirect function
calls to either a generic or SSE4 based function with an inlinable call to the
SSE4 function on later CPUs. This can come into effect everywhere a program is
compiled from source for local use as in Vibe.d, Source only Linux
distributions or personal projects, but also when distributing "SSE enhanced
versions" of programs.

As these flags are only relevant to subsets of the supported architectures they
should probably be implemented as "version(SSE4_2)" etc. Existing code using
-version=SSE4_2 on the command-line will in all likeliness continue to work as
intended. I understand that since DMD always creates generic builds it is
mostly a matter of documenting the version defines on
http://dlang.org/version.html#PredefinedVersions. Though "extensions" available
on all x64 CPUs like SSE2 should still be advertised when building with -m64,
adding some benefit even there.

--


[Issue 15210] [REG2.064][ICE] (glue.c at 1489) with tuples and AAs

2015-10-20 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15210

Kenji Hara  changed:

   What|Removed |Added

   Severity|enhancement |regression

--


[Issue 6343] std.math.nextPow2

2015-10-20 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6343

Jack Stouffer  changed:

   What|Removed |Added

 CC||j...@jackstouffer.com

--- Comment #4 from Jack Stouffer  ---
https://github.com/D-Programming-Language/phobos/pull/3755

--


[Issue 15210] [REG2.064][ICE] (glue.c at 1489) with tuples and AAs

2015-10-20 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15210

--- Comment #2 from Kenji Hara  ---
Reduced test case:

struct BigInt {}

alias AliasSeq(T...) = T;

template Tuple(Types)
{
struct Tuple
{
Types expand;
alias field = expand;
}
}

void main()
{
alias Foo = Tuple!BigInt;
Foo[BigInt] cache;

auto x = Foo();

BigInt[] arr;
foreach (y; arr)
cache[y] = x;
}

--


[Issue 15210] [REG2.064][ICE] (glue.c at 1489) with tuples and AAs

2015-10-20 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15210

--- Comment #3 from Kenji Hara  ---
(In reply to Kenji Hara from comment #2)
> Reduced test case:

Sorry I was wrong, correct version is:

struct BigInt {}

template Tuple(Types...)
{
struct Tuple
{
Types field;

void opAssign(R)(R rhs)
{
field = rhs.field;
}
}
}

void main()
{
alias Foo = Tuple!BigInt;

Foo[BigInt] cache;

auto x = Foo();

cache[BigInt()] = x;
}

--


[Issue 15210] [REG2.064][ICE] (glue.c at 1489) with tuples and AAs

2015-10-20 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15210

Kenji Hara  changed:

   What|Removed |Added

   Keywords||ice, pull
   Hardware|x86_64  |All
 OS|Windows |All

--- Comment #4 from Kenji Hara  ---
https://github.com/D-Programming-Language/dmd/pull/5209

--


[Issue 6343] std.math.nextPow2

2015-10-20 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6343

--- Comment #5 from bearophile_h...@eml.cc ---
(In reply to Jack Stouffer from comment #4)
> https://github.com/D-Programming-Language/phobos/pull/3755

size_t w = 8;
int[nextPow2(w)][6] mat;

nextPow2(8) needs to be 8.

If you think the name of the function is wrong, then change its name, don't
change the semantics :)

--


[Issue 6343] std.math.nextPow2

2015-10-20 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6343

--- Comment #6 from bearophile_h...@eml.cc ---
(In reply to bearophile_hugs from comment #5)

> If you think the name of the function is wrong, then change its name

ceilPow2 sounds OK.

--


[Issue 6343] std.math.ceilPow2

2015-10-20 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6343

bearophile_h...@eml.cc changed:

   What|Removed |Added

Summary|std.math.nextPow2   |std.math.ceilPow2

--


[Issue 15094] [REG2.063] __traits(getMember) fails when the source is a struct/class field

2015-10-20 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15094

Kenji Hara  changed:

   What|Removed |Added

   Keywords||rejects-valid

--- Comment #2 from Kenji Hara  ---
(In reply to Vladimir Panteleev from comment #1)
> This appears to be a regression.
> 
> Introduced in https://github.com/D-Programming-Language/dmd/pull/1687

Not correct. With 2.062, compiling example code with `dmd -c` will make:

test.d(16): Error: need 'this' to access member foo

PR 1687 had moved many "need this" errors in glue layer to front-end, but such
the field access is not yet supported. I think it's a reject-valid bug.

--


[Issue 15094] __traits(getMember) fails when the source is a struct/class field

2015-10-20 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15094

Vladimir Panteleev  changed:

   What|Removed |Added

Summary|[REG2.063]  |__traits(getMember) fails
   |__traits(getMember) fails   |when the source is a
   |when the source is a|struct/class field
   |struct/class field  |

--- Comment #3 from Vladimir Panteleev  ---
(In reply to Kenji Hara from comment #2)
> PR 1687 had moved many "need this" errors in glue layer to front-end, but
> such the field access is not yet supported. I think it's a reject-valid bug.

Oh, OK.

--


[Issue 15207] [REG2.069.0-b1] Wrong codegen with -inline

2015-10-20 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15207

Kenji Hara  changed:

   What|Removed |Added

   Keywords||pull, wrong-code
   Hardware|x86 |All
Summary|[REG2.069b2] Wrong codegen  |[REG2.069.0-b1] Wrong
   |with -inline|codegen with -inline

--- Comment #2 from Kenji Hara  ---
https://github.com/D-Programming-Language/dmd/pull/5206

--