@section text //////////////////////// i_random .i_random //TODO seeds ::opc_operands0 rh :opc_operands0 rl rh,rl(i) a rh,rl b ::opc_operands1 rh :opc_operands1 rl a rh,rl(i) b rh,rl //xorshift32 //state << 13 -> temp // state << 8 -> temp ::i_random_state0 rh rh,:i_random_state0 a ::i_temp rh :i_temp rl a rh,rl(i) ::i_random_state1 rh :i_random_state1 rl rh,rl(i) a ::i_temp rh a rh,:i_temp ::i_random_state1 rh rh,:i_random_state1 a ::i_temp2 rh :i_temp2 rl a rh,rl(i) 0 rh,rl // temp << 5, ignoring bottom byte ::i_temp rh :i_temp rl rh,rl(i) b bsr b bsr b bsr b 0b11100000 a and rh,rl(i) rh,rl b bsr b bsr b bsr b 0b11100000 a and rh,rl 0b00011111 a and a rh,rl(i) b or rh,rl(i) ::i_temp2 rh :i_temp2 rl rh,rl(i) b bsr b bsr b bsr b 0b11100000 a and rh,rl(i) 0b00011111 a and a ::i_temp rh rh,:i_temp b or rh,:i_temp //state = state ^ temp // high ::i_temp rh :i_temp rl rh,rl(i) a ::i_random_state0 rh :i_random_state0 rl rh,rl(i) b xor rh,rl(i) ::i_temp rh rh,:i_temp a ::i_random_state0 rh rh,:i_random_state0 b xor rh,:i_random_state0 // low ::i_temp2 rh :i_temp2 rl rh,rl(i) a ::i_random_state1 rh :i_random_state1 rl rh,rl(i) b xor rh,rl(i) ::i_temp2 rh rh,:i_temp2 a ::i_random_state1 rh rh,:i_random_state1 b xor rh,:i_random_state1 //state >> 17 -> temp // state >> 16 -> temp ::i_random_state0 rh :i_random_state0 rl rh,rl(i) a rh,rl b ::i_temp2 rh :i_temp2 rl a rh,rl(i) b rh,rl ::i_temp rh :i_temp rl 0 rh,rl(i) 0 rh,rl // temp >> 1, ignoring top 2 bytes ::i_temp2 rh :i_temp2 rl rh,rl b bsr b 0b01111111 a and rh,rl rh,rl(i) b bsr b 0b01111111 a and rh,rl(i) 0b10000000 a rh,rl b or rh,rl //state = state ^ temp // high ::i_temp rh :i_temp rl rh,rl(i) a ::i_random_state0 rh :i_random_state0 rl rh,rl(i) b xor rh,rl(i) ::i_temp rh rh,:i_temp a ::i_random_state0 rh rh,:i_random_state0 b xor rh,:i_random_state0 // low ::i_temp2 rh :i_temp2 rl rh,rl(i) a ::i_random_state1 rh :i_random_state1 rl rh,rl(i) b xor rh,rl(i) ::i_temp2 rh rh,:i_temp2 a ::i_random_state1 rh rh,:i_random_state1 b xor rh,:i_random_state1 //state << 5 -> temp FIXME optimize // state -> temp ::i_random_state0 rh :i_random_state0 rl rh,rl(i) a rh,rl b ::i_temp rh :i_temp rl a rh,rl(i) b rh,rl ::i_random_state1 rh :i_random_state1 rl rh,rl(i) a rh,rl b ::i_temp2 rh :i_temp2 rl a rh,rl(i) b rh,rl // temp << 5 ::i_temp rh :i_temp rl rh,rl(i) b bsr b bsr b bsr b 0b11100000 a and rh,rl(i) rh,rl b bsr b bsr b bsr b 0b11100000 a and rh,rl 0b00011111 a and a rh,rl(i) b or rh,rl(i) ::i_temp2 rh :i_temp2 rl rh,rl(i) b bsr b bsr b bsr b 0b11100000 a and rh,rl(i) 0b00011111 a and a ::i_temp rh rh,:i_temp b or rh,:i_temp ::i_temp2 rh :i_temp2 rl rh,rl b bsr b bsr b bsr b 0b11100000 a and rh,rl 0b00011111 a and a rh,rl(i) b or rh,rl(i) //state = state ^ temp // high ::i_temp rh :i_temp rl rh,rl(i) a ::i_random_state0 rh :i_random_state0 rl rh,rl(i) b xor rh,rl(i) ::i_temp rh rh,:i_temp a ::i_random_state0 rh rh,:i_random_state0 b xor rh,:i_random_state0 // low ::i_temp2 rh :i_temp2 rl rh,rl(i) a ::i_random_state1 rh :i_random_state1 rl rh,rl(i) b xor rh,rl(i) ::i_temp2 rh rh,:i_temp2 a ::i_random_state1 rh rh,:i_random_state1 b xor rh,:i_random_state1 ::i_random_state1 rh :i_random_state1 rl rh,rl(i) a 0b01111111 b and a rh,rl b ::opc_operands0 rh :opc_operands0 rl a rh,rl(i) b rh,rl branch :i_random_smod 1 //::__subvar rh //1 rl //0 rh,rl(i) //1 rh,rl //::opc_store_var rh //rh,:opc_store_var a //::__subvar rh //a rh,0 //call :set_var //branch :opcode_done 1 @section data //.i_random_seed //dl 0 .i_random_state0 dl 12532 .i_random_state1 dl 29249