Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function drop(imgPtr:int, x:int, y:int, stride:int):void
- {
- var tst:FernsTest;
- var ntf:int = numTestsPerFern;
- var img:int = __cint(imgPtr + x + stride * y);
- var index:int = 0;
- var idx_ptr:int = leaves_index;
- tst = tests;
- __cint(__asm(__as3(ntf-6)));
- __asm(LookupSwitch("default", "6", "7", "8", "9", "10", "11", "12"));
- __asm("default:"); // here default will take the min op
- __asm("6:");
- while(tst != null) {
- index = 0;
- __beginRepeat(5);
- {
- index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
- index <<= 1;
- tst = tst.next;
- }
- __endRepeat();
- index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
- tst = tst.next;
- Memory.writeInt(index, idx_ptr);
- idx_ptr = __cint(idx_ptr + 4);
- }
- __asm(Jump("break"));
- __asm("7:");
- while(tst != null) {
- index = 0;
- __beginRepeat(6);
- {
- index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
- index <<= 1;
- tst = tst.next;
- }
- __endRepeat();
- index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
- tst = tst.next;
- Memory.writeInt(index, idx_ptr);
- idx_ptr = __cint(idx_ptr + 4);
- }
- __asm(Jump("break"));
- __asm("8:");
- while(tst != null) {
- index = 0;
- __beginRepeat(7);
- {
- index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
- index <<= 1;
- tst = tst.next;
- }
- __endRepeat();
- index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
- tst = tst.next;
- Memory.writeInt(index, idx_ptr);
- idx_ptr = __cint(idx_ptr + 4);
- }
- __asm(Jump("break"));
- __asm("9:");
- while(tst != null) {
- index = 0;
- __beginRepeat(8);
- {
- index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
- index <<= 1;
- tst = tst.next;
- }
- __endRepeat();
- index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
- tst = tst.next;
- Memory.writeInt(index, idx_ptr);
- idx_ptr = __cint(idx_ptr + 4);
- }
- __asm(Jump("break"));
- __asm("10:");
- while(tst != null) {
- index = 0;
- __beginRepeat(9);
- {
- index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
- index <<= 1;
- tst = tst.next;
- }
- __endRepeat();
- index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
- tst = tst.next;
- Memory.writeInt(index, idx_ptr);
- idx_ptr = __cint(idx_ptr + 4);
- }
- __asm(Jump("break"));
- __asm("11:");
- while(tst != null) {
- index = 0;
- __beginRepeat(10);
- {
- index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
- index <<= 1;
- tst = tst.next;
- }
- __endRepeat();
- index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
- tst = tst.next;
- Memory.writeInt(index, idx_ptr);
- idx_ptr = __cint(idx_ptr + 4);
- }
- __asm(Jump("break"));
- __asm("12:");
- while(tst != null) {
- index = 0;
- __beginRepeat(11);
- {
- index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
- index <<= 1;
- tst = tst.next;
- }
- __endRepeat();
- index = __cint( index + int(Memory.readUnsignedByte(img + tst.ind1) < Memory.readUnsignedByte(img + tst.ind2)) );
- tst = tst.next;
- Memory.writeInt(index, idx_ptr);
- idx_ptr = __cint(idx_ptr + 4);
- }
- __asm("break:");
- __asm(Nop);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement