Jump to content
• Advertisement

# Working on 8 bit animation engine for javascript want to know what 12-16bit varible will be simplified and compressed with interpolation and JIT

This topic is 692 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

http://stackoverflow.com/questions/41643234/how-to-generate-4-bit-hex-codes-at-random-from-compressed-codec-to-read-into-ima

How would I output 12 bits(3 sets of 4) from this to pre-compile with JIT

B1=0000 zeroes(bitwidth) 0bit
B2=0001= edram(zeroes(bitwidth)) 0bit
B3=0010= sigmund(bitwidth) 0bit
B4=0011= J 0bit
B5=0100= bitwidth 0bit
B6=0101= edram(bitwidth) 0bit
B7=0110= shift(J,Q) 0bit
B8=0111= shift(J,Q)++ 0bit
S9=1000=shift(bitwidth,Q) 0bit
S10=1001= shift(bitwidth,Q)++ 0bit
S11=1010=shift(edram(bitwidth),Q) 0bits
S12=1011=shift(edram(bitwidth)),Q)++0bit
S13=1100=shift(edram2S(bitwidth)),Q) 0bit
S14=1101=shift(edram2S(bitwidth)),Q)++;0bit
S15=1110=shift(ones(J),Q) 0bit
S16=1111=shift(ones(J),Q)++ 0bit

#### Share this post

##### Share on other sites
Advertisement

https://en.wikipedia.org/wiki/Just-in-time_compilation

https://en.wikipedia.org/wiki/Interpreter_(computing)

https://en.wikipedia.org/wiki/Bytecode

https://en.wikipedia.org/wiki/Machine_code

https://en.wikipedia.org/wiki/Intermediate_representation

I have a switch and was wondering what 12 bits from the compressed code to put in to Trigger Just in Time compiler I could use other data structure if necessary but I need to still convert from Hexidecimal value compression

Basically

Switch(a){

case:0

???12 bits from groups of 4 to trigger JIT

break;

default:

??? 12 bits from groups of 4 to trigger JIT

}

Edited by Infinity8378

#### Share this post

##### Share on other sites

Shouldn't you start with the global design of the engine first?

You get speed mostly by doing the right stuff at the higher levels.

You won't win the war by doing low level stuff optimal (for some unknown value of "optimal"), but making a mess at the higher level because it gets too complicated with all the premature optimizations that you try to add now.

#### Share this post

##### Share on other sites
Let's be honest, javascript interpreters vary from browser to browser and JIT isn't the norm.

On the off chance you manage to make this work for example in chrome it probably won't in edge, Firefox, IE, opera etc.

Don't sweat the small stuff, premature optimisation is the root of all evil...

#### Share this post

##### Share on other sites

https://en.wikipedia.org/wiki/Just-in-time_compilation
https://en.wikipedia.org/wiki/Interpreter_(computing)
https://en.wikipedia.org/wiki/Bytecode
https://en.wikipedia.org/wiki/Machine_code
https://en.wikipedia.org/wiki/Intermediate_representation

I have a switch and was wondering what 12 bits from the compressed code to put in to Trigger Just in Time compiler I could use other data structure if necessary but I need to still convert from Hexidecimal value compression

Basically
Switch(a){
case:0
???12 bits from groups of 4 to trigger JIT
break;
default:
??? 12 bits from groups of 4 to trigger JIT
}

I know what JIT, IR, etc are. I don't know what YOU are trying to do.

Are you customizing a Javascript execution engine like V8 or Crankshaft? If not, then you don't control the JIT and should not think about it AT ALL. If you are actually modifying an execution engine, then you'll need to read the documentation for how that particular engine works. Each one of them is going to be different internally.

It *looks* like you're trying to process a stream of data as instruction/operand pairs packed into 4+12 bits of 16-bit values. Just use bit manipulation to get the values you want and finish your switch statement. That should be all you need.

If that's not what you're doing then you need to actually explain it instead of using terminology that doesn't makes sense in the way you're trying to use it. Edited by Nypyren

#### Share this post

##### Share on other sites

Fine what's the fastest at least 15-20Million OPs per second to convert 3 4bit values and handle the 3 Compression Shifts to in a 12bit or 16bit value

https://en.wikipedia.org/wiki/Just-in-time_compilation
https://en.wikipedia.org/wiki/Interpreter_(computing)
https://en.wikipedia.org/wiki/Bytecode
https://en.wikipedia.org/wiki/Machine_code
https://en.wikipedia.org/wiki/Intermediate_representation

I have a switch and was wondering what 12 bits from the compressed code to put in to Trigger Just in Time compiler I could use other data structure if necessary but I need to still convert from Hexidecimal value compression

Basically
Switch(a){
case:0
???12 bits from groups of 4 to trigger JIT
break;
default:
??? 12 bits from groups of 4 to trigger JIT
}

I know what JIT, IR, etc are. I don't know what YOU are trying to do.

Are you customizing a Javascript execution engine like V8 or Crankshaft? If not, then you don't control the JIT and should not think about it AT ALL. If you are actually modifying an execution engine, then you'll need to read the documentation for how that particular engine works. Each one of them is going to be different internally.

It *looks* like you're trying to process a stream of data as instruction/operand pairs packed into 4+12 bits of 16-bit values. Just use bit manipulation to get the values you want and finish your switch statement. That should be all you need.

If that's not what you're doing then you need to actually explain it instead of using terminology that doesn't makes sense in the way you're trying to use it.

I basically writing a faster 12bit HSLA engine for javascript that reads data like shaders

#### Share this post

##### Share on other sites

I basically writing a faster 12bit HSLA engine for javascript that reads data like shaders

What's an HSLA engine??

#### Share this post

##### Share on other sites
Sounds like it might be hue, saturation, luminance and alpha?

Why not RGBA?

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5
• Advertisement

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633736
• Total Posts
3013598
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!