INNER CODE UNIT · Python

gen_fp_sub

herumi/mcl · misc/gen_test.py:81

def gen_fp_sub(N):
  align(16)
  with FuncProc(f'mclb_fp_sub{N}'):
    with StackFrame(4, N-1) as sf:
      pz = sf.p[0]
      px = sf.p[1]
      py = sf.p[2]
      pp = sf.p[3]
      X = sf.t
      X.append(px)
      load_pm(X, px)   # X = px[], px is destroyed
      sub_pm(X, py)    # X = px[] - py[]
      lea(rax, rip('ZERO'))
      cmovc(rax, pp)   # X < 0 ? pp : 0
      add_pm(X, rax)
      store_mp(pz, X)

"""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…