예제 #1
0
	def get(self, x, y, z):
		value = self.inner[0].get(x, y, z)
		op = self.op
		v = None
		if op == "not": v = e.not64(value)
		elif op == "shr1": v = e.shr1(value)
		elif op == "shr4": v = e.shr4(value)
		elif op == "shr16": v = e.shr16(value)
		elif op == "shl1": v = e.shl1(value)
		else: assert False, "unknown operator: " + op
		return v
예제 #2
0
  for g in base :
    print g[0].dump(),g[1]
    

if __name__ == "__main__":

  k=1
  xv=[]
  yv=[]
  for i in range(200):
    x=make_rand_input(N=10,maxi=random.randint(0,64))
    if i<20:
      x=make_rand_input(N=10,maxi=16)
    if i<50:
      x=make_rand_input(N=10,maxi=32)
      #x=random.randint(0,2**32)
    xv.append(x)
    #yv.append(e.plus(e.shr16(x),e.shl1(e.shr4(x))))
    #yv.append(e.not64(e.shr4(x)) | e.plus(e.shr16(x),e.shl1(e.shr4(x))))
    #yv.append(e.not64(e.shr4(x)) | (e.shr16(x) & e.shl1(e.shl1(e.shr4(x)))))
    #yv.append(e.not64(e.shr4(x)) & (e.shr16(x) | e.shl1(e.shr4(x))))
    yv.append(e.not64(e.if0(e.shr16(e.shr16(x)), e.not64(e.shr1(x)), e.shl1(e.shr4(x)))))

  gen_graphs(zip(xv,yv))

  #shifts=ft_vec(xv,yv)
  #for s in xrange(-64,64):
  #  if shifts[s]>5:
  #    print s,shifts[s]