! Copyright (C) 2020 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators cpu.arm.assembler.opcodes kernel
-math math.bitwise namespaces sequences combinators.extras ;
+math math.bitwise namespaces sequences ;
IN: cpu.arm.assembler
! pre-index mode: computed addres is the base-register + offset
: LSRi64 ( imm6 Rn Rd -- ) LSRi64-encode >out ;
: with-new-arm64-offset ( offset quot -- arm64-assembler )
- [ <arm64-assembler> \ arm64-assembler ] dip with-output-variable ; inline
+ [ <arm64-assembler> \ arm64-assembler ] dip
+ '[ _ \ arm64-assembler get ] with-variable ; inline
: with-new-arm64 ( quot -- arm64-assembler )
- [ 0 <arm64-assembler> \ arm64-assembler ] dip with-output-variable ; inline
+ [ 0 <arm64-assembler> \ arm64-assembler ] dip
+ '[ _ \ arm64-assembler get ] with-variable ; inline
: offset-test-arm64 ( offset quot -- instuctions )
with-new-arm64-offset out>> ; inline
: with-retries ( retries quot -- result )
[ current-retries ] dip dup '[
- [
+ f [
+ drop
current-retries get next-retry [
[ sleep ] unless-zero
_ [ f ] compose [
] [
current-retries get _ retries-failed
] if
- ] smart-loop
+ ] loop
] with-variable ; inline
: retries ( quot time-strategy n/seq -- result )