Esempio n. 1
0
File: isa.py Progetto: cfbolz/pydgin
def execute_trunc_w_s(s, inst):
    # TODO: check for overflow
    x = bits2float(s.rf[inst.fs()])
    s.rf[inst.fd()] = trim(int(x))  # round down
    s.pc += 4
Esempio n. 2
0
File: isa.py Progetto: cfbolz/pydgin
def execute_c_le_s(s, inst):
    a = bits2float(s.rf[inst.fs()])
    b = bits2float(s.rf[inst.ft()])
    s.rf[inst.fd()] = 1 if a <= b else 0
    s.pc += 4
Esempio n. 3
0
File: isa.py Progetto: cfbolz/pydgin
def execute_cvt_w_s(s, inst):
    x = bits2float(s.rf[inst.fs()])
    s.rf[inst.fd()] = trim(int(x))
    s.pc += 4
Esempio n. 4
0
File: isa.py Progetto: cfbolz/pydgin
def execute_div_s(s, inst):
    a = bits2float(s.rf[inst.fs()])
    b = bits2float(s.rf[inst.ft()])
    s.rf[inst.fd()] = float2bits(a / b)
    s.pc += 4