Exemplo n.º 1
0
def execute_fmax_d( s, inst ):
  a, b = s.fp[inst.rs1], s.fp[inst.rs2]
  # TODO: s.fp[ inst.rd ] = sfp.isNaNF64UI(b) || ...
  s.fp[ inst.rd ] = a if sfp.f64_le_quiet(b,a) else b
  s.fcsr          = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 2
0
def execute_fmax_s( s, inst ):
  a, b = trim_32( s.fp[inst.rs1] ), trim_32( s.fp[inst.rs2] )
  # TODO: s.fp[ inst.rd ] = sfp.isNaNF32UI(b) || ...
  s.fp[ inst.rd ] = a if sfp.f32_le_quiet(b,a) else b
  s.fcsr          = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 3
0
def execute_fmax_s(s, inst):
    a, b = trim_32(s.fp[inst.rs1]), trim_32(s.fp[inst.rs2])
    # TODO: s.fp[ inst.rd ] = sfp.isNaNF32UI(b) || ...
    s.fp[inst.rd] = a if sfp.f32_le_quiet(b, a) else b
    s.fcsr = sfp.get_flags()
    sfp.set_flags(0)
    s.pc += 4
Exemplo n.º 4
0
def execute_fcvt_d_l(s, inst):
    a = signed(s.rf[inst.rs1], 64)
    s.fp[inst.rd] = sfp.i64_to_f64(a)
    s.fcsr = sfp.get_flags()
    sfp.set_flags(0)
    s.pc += 4
Exemplo n.º 5
0
def execute_fsub_s( s, inst ):
  a, b = trim_32( s.fp[inst.rs1] ), trim_32( s.fp[inst.rs2] )
  s.fp[ inst.rd ] = sext_32( sfp.f32_sub( a, b ) )
  s.fcsr          = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 6
0
def execute_fmadd_s( s, inst ):
  a, b, c = s.fp[inst.rs1], s.fp[inst.rs2], s.fp[inst.rs3]
  s.fp[ inst.rd ] = sfp.f32_mulAdd( a, b, c )
  s.fcsr          = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 7
0
def execute_fcvt_s_w( s, inst ):
  a = signed( s.rf[inst.rs1], 32 )
  s.fp[inst.rd] = sfp.i32_to_f32( a )
  s.fcsr        = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 8
0
def execute_fcvt_wu_s( s, inst ):
  s.rf[inst.rd] = sext_32(sfp.f32_to_ui32( s.fp[inst.rs1], inst.rm, True ))
  s.fcsr        = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 9
0
def execute_fsqrt_s( s, inst ):
  a = trim_32( s.fp[inst.rs1] )
  s.fp[ inst.rd ] = sext_32( sfp.f32_sqrt( a ) )
  s.fcsr          = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 10
0
def execute_fsqrt_s(s, inst):
    a = trim_32(s.fp[inst.rs1])
    s.fp[inst.rd] = sext_32(sfp.f32_sqrt(a))
    s.fcsr = sfp.get_flags()
    sfp.set_flags(0)
    s.pc += 4
Exemplo n.º 11
0
def execute_fcvt_d_l( s, inst ):
  a = signed( s.rf[inst.rs1], 64 )
  s.fp[inst.rd] = sfp.i64_to_f64( a )
  s.fcsr        = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 12
0
def execute_fsub_d( s, inst ):
  a, b = s.fp[inst.rs1], s.fp[inst.rs2]
  s.fp[ inst.rd ] = sfp.f64_sub( a, b )
  s.fcsr          = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 13
0
def execute_fnmsub_d( s, inst ):
  a, b, c = s.fp[inst.rs1], s.fp[inst.rs2], s.fp[inst.rs3]
  s.fp[ inst.rd ] = sfp.f64_mulAdd( fp_neg(a,64), b, c )
  s.fcsr          = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 14
0
def execute_fcvt_d_s( s, inst ):
  s.fp[inst.rd] = sfp.f32_to_f64( trim_32(s.fp[inst.rs1]) )
  s.fcsr        = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 15
0
def execute_fcvt_s_d( s, inst ):
  s.fp[inst.rd] = sfp.f64_to_f32( s.fp[inst.rs1] )
  s.fcsr        = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 16
0
def execute_fcvt_l_s( s, inst ):
  s.rf[inst.rd] = sfp.f32_to_i64( s.fp[inst.rs1], inst.rm, True )
  s.fcsr        = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 17
0
def execute_fcvt_s_lu( s, inst ):
  a = s.rf[inst.rs1]
  s.fp[inst.rd] = sfp.ui64_to_f32( a )
  s.fcsr        = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 18
0
def execute_fcvt_wu_s(s, inst):
    s.rf[inst.rd] = sext_32(sfp.f32_to_ui32(s.fp[inst.rs1], inst.rm, True))
    s.fcsr = sfp.get_flags()
    sfp.set_flags(0)
    s.pc += 4
Exemplo n.º 19
0
def execute_fle_s(s, inst):
    a, b = trim_32(s.fp[inst.rs1]), trim_32(s.fp[inst.rs2])
    s.rf[inst.rd] = sfp.f32_le(a, b)
    s.fcsr = sfp.get_flags()
    sfp.set_flags(0)
    s.pc += 4
Exemplo n.º 20
0
def execute_fcvt_s_w(s, inst):
    a = signed(s.rf[inst.rs1], 32)
    s.fp[inst.rd] = sfp.i32_to_f32(a)
    s.fcsr = sfp.get_flags()
    sfp.set_flags(0)
    s.pc += 4
Exemplo n.º 21
0
def execute_fle_s( s, inst ):
  a, b = trim_32( s.fp[inst.rs1] ), trim_32( s.fp[inst.rs2] )
  s.rf[ inst.rd ] = sfp.f32_le( a, b )
  s.fcsr          = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 22
0
def execute_fcvt_s_wu(s, inst):
    a = trim_32(s.rf[inst.rs1])
    s.fp[inst.rd] = sfp.ui32_to_f32(a)
    s.fcsr = sfp.get_flags()
    sfp.set_flags(0)
    s.pc += 4
Exemplo n.º 23
0
def execute_fcvt_s_wu( s, inst ):
  a = trim_32(s.rf[inst.rs1])
  s.fp[inst.rd] = sfp.ui32_to_f32( a )
  s.fcsr        = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 24
0
def execute_fmadd_s(s, inst):
    a, b, c = s.fp[inst.rs1], s.fp[inst.rs2], s.fp[inst.rs3]
    s.fp[inst.rd] = sfp.f32_mulAdd(a, b, c)
    s.fcsr = sfp.get_flags()
    sfp.set_flags(0)
    s.pc += 4
Exemplo n.º 25
0
def execute_fnmadd_s( s, inst ):
  a, b, c = s.fp[inst.rs1], s.fp[inst.rs2], s.fp[inst.rs3]
  s.fp[ inst.rd ] = sfp.f32_mulAdd( fp_neg(a,32), b, fp_neg(c,32) )
  s.fcsr          = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4
Exemplo n.º 26
0
def execute_fnmadd_s(s, inst):
    a, b, c = s.fp[inst.rs1], s.fp[inst.rs2], s.fp[inst.rs3]
    s.fp[inst.rd] = sfp.f32_mulAdd(fp_neg(a, 32), b, fp_neg(c, 32))
    s.fcsr = sfp.get_flags()
    sfp.set_flags(0)
    s.pc += 4
Exemplo n.º 27
0
def execute_fcvt_lu_d(s, inst):
    s.rf[inst.rd] = sfp.f64_to_ui64(s.fp[inst.rs1], inst.rm, True)
    s.fcsr = sfp.get_flags()
    sfp.set_flags(0)
    s.pc += 4
Exemplo n.º 28
0
def execute_fadd_s(s, inst):
    a, b = trim_32(s.fp[inst.rs1]), trim_32(s.fp[inst.rs2])
    s.fp[inst.rd] = sext_32(sfp.f32_add(a, b))
    s.fcsr = sfp.get_flags()
    sfp.set_flags(0)
    s.pc += 4
Exemplo n.º 29
0
def execute_fcvt_d_lu(s, inst):
    a = s.rf[inst.rs1]
    s.fp[inst.rd] = sfp.ui64_to_f64(a)
    s.fcsr = sfp.get_flags()
    sfp.set_flags(0)
    s.pc += 4
Exemplo n.º 30
0
def execute_fsqrt_d( s, inst ):
  a = s.fp[inst.rs1]
  s.fp[ inst.rd ] = sfp.f64_sqrt( a )
  s.fcsr          = sfp.get_flags()
  sfp.set_flags( 0 )
  s.pc += 4