Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Herb Sutter on Heterosexual Computing

Name: Anonymous 2011-06-17 7:51

Looks like Microsoft is tired of HomogenousHomosexual Computing (ie. Apple/Macs) and paints a possible future of mainstream HeterogenousHeterosexual Computing.
 
http://media.ch9.ms/ch9/7655/e3d5a308-d1fb-4693-998e-9f04000f7655/AMDFusionHerbSutterKeynoteAMP_high_ch9.mp4

It's a bit Microsoft biased, made me cringe a bit in a few spots, but the bulk of the talk is rather interesting. Herb Sutter used to be the chairperson of the ISO/IEC C and C++ language committees, by the way. I wonder how the Linux kernel will adapt to heterogeneous computing? We already have OpenCL, but the kernel isn't using it itself--is there any application for this kind of stuff inside of a kernel?

Name: Anonymous 2011-06-17 10:19

>>8
I just tried. GCC failed to optimize the tail calls, Clang/LLVM optimized:
(int) -> (int,int)
(int,int) -> (int)
(int,int) -> (int,int,int)
but not (int,int,int) -> (int,int).

Here's the code:

#include <iostream>
int fact(int);
int fact_iter(int,int);
int fact_iter2(int,int,int);
int fact(int a) {
    return fact_iter(a,1);
}

int fact_iter(int a, int r) {
    if (a==0) return r;
    else return fact_iter2(a,r*a,1);
}

int fact_iter2(int a, int r, int s) {
    return fact_iter(a-s,r);
}

int main() {
    std::cout << fact(5);
    return 0;
}


It also miscompiled:
void f() { return f() }
int main() { f(); return 0; }

to just return 0; instead of an infinite loop.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List