From 3e76ad5b5d9e7e35ad2fcbf23fd8df90bfd0de25 Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Wed, 3 Apr 2019 00:01:43 +0200 Subject: [PATCH] Follow flake8 to pass tests --- arch/zx48k/backend/__16bit.py | 30 ++++++++++++++---------------- arch/zx48k/backend/__f16.py | 10 +++++----- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/arch/zx48k/backend/__16bit.py b/arch/zx48k/backend/__16bit.py index 6297503a4..f13c50daa 100644 --- a/arch/zx48k/backend/__16bit.py +++ b/arch/zx48k/backend/__16bit.py @@ -288,15 +288,14 @@ def _divu16(ins): ''' op1, op2 = tuple(ins.quad[2:]) if is_int(op1) and int(op1) == 0: # 0 / A = 0 + if op2[0] in ('_', '$'): + output = [] # Optimization: Discard previous op if not from the stack + else: + output = _16bit_oper(op2) # Normalize stack - if op2[0] in ('_', '$'): - output = [] # Optimization: Discard previous op if not from the stack - else: - output = _16bit_oper(op2) # Normalize stack - - output.append('ld hl, 0') - output.append('push hl') - return output + output.append('ld hl, 0') + output.append('push hl') + return output if is_int(op2): op = int16(op2) @@ -349,15 +348,14 @@ def _divi16(ins): ''' op1, op2 = tuple(ins.quad[2:]) if is_int(op1) and int(op1) == 0: # 0 / A = 0 + if op2[0] in ('_', '$'): + output = [] # Optimization: Discard previous op if not from the stack + else: + output = _16bit_oper(op2) # Normalize stack - if op2[0] in ('_', '$'): - output = [] # Optimization: Discard previous op if not from the stack - else: - output = _16bit_oper(op2) # Normalize stack - - output.append('ld hl, 0') - output.append('push hl') - return output + output.append('ld hl, 0') + output.append('push hl') + return output if is_int(op2): op = int16(op2) diff --git a/arch/zx48k/backend/__f16.py b/arch/zx48k/backend/__f16.py index 6090edcbd..668c6f0ce 100644 --- a/arch/zx48k/backend/__f16.py +++ b/arch/zx48k/backend/__f16.py @@ -304,11 +304,11 @@ def _modf16(ins): op1, op2 = tuple(ins.quad[2:]) if is_float(op2) and float(op2) == 1: - output = _f16_oper(op1) - output.append('ld hl, 0') - output.append('push hl') - output.append('push hl') - return output + output = _f16_oper(op1) + output.append('ld hl, 0') + output.append('push hl') + output.append('push hl') + return output rev = not is_float(op1) and op1[0] != 't' and op2[0] == 't'