forked from tinygrad/tinygrad
ci should work now
This commit is contained in:
@@ -94,7 +94,7 @@ class ARM64Codegen(AssemblyCodegen):
|
||||
if arg == BinaryOps.MUL and out.dtype == dtypes.bool:
|
||||
ins.append(f"ands {','.join('x15' if v.__class__ is int else rtor[v.nm] for v in [out] + vin)}")
|
||||
elif arg == TernaryOps.WHERE:
|
||||
ins.append(f"fmov s0, #0.0")
|
||||
mov_imm(0.0, 's0')
|
||||
ins.append(f"{alu[arg]} {rtor[vin[0].nm]}, s0")
|
||||
ins.append(f"fcsel {rtor[out.nm]},{rtor[vin[2].nm]}, {rtor[vin[1].nm]}, eq")
|
||||
elif arg in [UnaryOps.LOG2, UnaryOps.SIN, UnaryOps.EXP2, UnaryOps.SQRT]:
|
||||
@@ -148,4 +148,4 @@ class ARM64Codegen(AssemblyCodegen):
|
||||
if out is not None and out.nm in mem_vars:
|
||||
ins.append(f"mov x15, {mem_vars[out.nm]}")
|
||||
ins.append(f"str {rtor[out.nm]}, [sp, x15]")
|
||||
return "test", "\n".join([".arch armv8-a",".text", ".global _test",".p2align 2", "_test:", "mov x19, sp"] + [f"sub sp, sp, #{offset}" for offset in compute_offsets(var_size)]+ ins + [f"add sp, sp, #{offset}" for offset in compute_offsets(var_size)] +["ret;"+"\n"])
|
||||
return "test", "\n".join([".arch armv8-a",".text", ".global test",".p2align 2", "test:", "mov x19, sp"] + [f"sub sp, sp, #{offset}" for offset in compute_offsets(var_size)]+ ins + [f"add sp, sp, #{offset}" for offset in compute_offsets(var_size)] +["ret;"+"\n"])
|
||||
@@ -22,7 +22,7 @@ class ClangProgram:
|
||||
else:
|
||||
if DEBUG >= 5: print(prg)
|
||||
if getenv('ARM64'):
|
||||
subprocess.check_output(args=('as -o '+fn+'.o').split(), input=prg.encode('utf-8'))
|
||||
subprocess.check_output(args=('as -o '+fn+'.o').split(), input=prg.encode('utf-8'))
|
||||
subprocess.check_output(args=('clang -lm -shared '+fn+'.o -o'+fn).split())
|
||||
self.lib = ctypes.CDLL(fn)
|
||||
self.fxn = self.lib[name]
|
||||
|
||||
Reference in New Issue
Block a user