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

Fastest way to single hex digit => decimal

Name: Anonymous 2012-01-06 8:46

char hexchartodec_map[256] = {
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  0,  0,  0,  0,  0,  0,
        0,  10, 11, 12, 13, 14, 15, 0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  10, 11, 12, 13, 14, 15, 0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
};

char hexchartodec(char i) {
        return hexchartodec_map[i];
}

Name: Anonymous 2012-01-08 5:27

>>116

I'd like to try doing something like this sometime for one of my games. You'd have to include all the drivers for the specific machine on the disc correct?

Name: Anonymous 2012-01-08 5:30

We already have "Bootable games", we call them console games.

Name: Anonymous 2012-01-08 5:35

>>122

implying console games don't run on an OS that provides common API/ABI for things including, but not limited to, OpenGL/DirectX

I do have to admit, really old games such as the NES are truly bootable, given that the ROM is all that runs.

Name: Anonymous 2012-01-08 9:32

>>123
Go back to the imageboards

Name: Anonymous 2012-01-08 11:09

>>118,119
windows drivers are retarded
fixed that for you!

Name: Anonymous 2012-01-09 4:10

this should be faster,especially on ARM(since shifts and rotates are folded into ops)
#define hexcharshift(x) ((((x>>6)+((x>>6)<<3))+((x<<28)>>28)))

Name: Anonymous 2012-01-09 4:18

The first ADD can be replaced by OR since its 100|1=101 or 000|000=0
#define hexcharshift2(x) ((((x>>6)|((x>>6)<<3))+((x<<28)>>28)))
VROOOOOOOOM

Name: Anonymous 2012-01-09 5:13

>>127

saying vroom vroom for optimized code considered extremely cute.

Name: Cudder !MhMRSATORI!FBeUS42x4uM+kgp 2012-01-09 5:40

>>126
No one cares, ARM doesn't even have a RDTSC equivalent.

Name: Anonymous 2013-03-05 2:15

It can be done with one instruction in System/38 assembly and that instruction can handle up to 16 MB of hex digits.
/* input in hex-digit, output in integer-form */
dcl dd binary-form char(2) auto;
dcl dd text-form char(4) auto init('000X');
dcl dd integer-form bin(2) unsgnd def(binary-form) pos(1);
dcl dd hex-digit char(1) def(text-form) pos(4);
cvtch binary-form, text-form;

Name: Anonymous 2013-03-05 5:49

>>1
Fastest way
accessing memory

/0

remember: any arithmetic operation is order of magnitude faster than a memory access

Name: Anonymous 2013-03-05 10:11

>>40
And that, kids, is why you learn assembly; faster than a hard-coded map.

Name: Anonymous 2013-03-05 14:56

>>129
Woah.
Oh my gosh.
You're the smartest person in the world.
You're amazing.

You're so SPECIAL. Clearly different than everyone else on the planet. Better, mentally faster than all the rest. Not an average or mundane sheep, but a SPECIAL human. More evolved. A master race consisting of one member.

Can I suck your dick? Maybe ingesting your semen will raise my IQ by 20 points.

Name: Anonymous 2013-03-05 15:36

>>133
Fuck off with your ironic posts.

Name: Anonymous 2013-03-05 15:40

>>133
>Can I suck your dick? Maybe ingesting your semen will raise my IQ by 20 points.
50$

Name: Anonymous 2013-03-05 18:57

lol who fuqin cares about this nerd shit ^^ just write apps in ruby and be done with it lel

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