Worst Phobos documentation evar!

Manu via Digitalmars-d digitalmars-d at puremagic.com
Sat Jan 3 20:21:08 PST 2015


On 4 January 2015 at 13:48, Walter Bright via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On 1/2/2015 2:05 AM, Manu via Digitalmars-d wrote:
>>
>> This:
>>    @uda(Arg) void function(Arg)()
>>    {
>>    }
>>
>> I need to be able to supply a template arg to a UDA. The runtime cpuid
>> branching tech depends on it, and thus the whole API design depends on
>> it.
>>
>> So, yeah they're all coming back to me now slowly :)
>> There were a number of things I was blocked on. If I can't prove that
>> my API approach works, then it needs to completely change.
>> These things were blocking me from proving the design actually works.
>>
>> Can this one be addressed?
>
>
> template function(Arg)
> {
>     @uda(Arg) void function() { ... }
> }

Ah, interesting. I've never written a template function like that.
Hmmm, is that how code is rewritten when compiling? If so, why doesn't
it just work already?


>> Well, it kinda does. Swapping register types is one of the biggest
>> performance hazards there is.
>> Use of SIMD opcodes will generate use of xmm regs. As much as I preach
>> best practise is to commit 100% to SIMD, people will inevitably find
>> themselves moving float data into SIMD regs. x64 should actually be
>> the most tolerant of that sort of code, because float data *should*
>> already be in xmm regs, but I think in our case we're going to see
>> some pretty ordinary simd benchmarks whenever floats appear. The
>> register swapping will very probably result in code that is slower
>> than just issuing sequential float ops.
>
>
> The best thing to do is make the library work, and then we go about making
> it faster.
>
> The thing is,
>
>
> M: Implement feature X and then I can deliver fantastic library A 2 years
> later.
> W: Ok, but I've got to first implement Y because it's blocking delivery of
> fantastic library B today.
>
>
> M: Implement feature X and then I can deliver fantastic library A tomorrow!
> W: Ok, it's at the top of the queue!

Don't get me wrong, I'm not trying to rearrange priorities. The stuff
going on at the moment is super important!

I'm just saying where I'm at with it. It got stuck on problems I
didn't-know-how/couldn't to resolve.
I need to know my design is sound (ie, works), otherwise committing to
the design is the wrong thing to do.


More information about the Digitalmars-d mailing list