Esempio n. 1
0
"""
This module provides the B-format B.MI instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if proc.N:
        proc.reg["PC"].set(proc.labels[BR_address])


B_MI = B(97, operation)
Esempio n. 2
0
"""
This module provides the B-format B.LT instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not proc.N == proc.V:
        proc.reg["PC"].set(proc.labels[BR_address])


B_LT = B(97, operation)
Esempio n. 3
0
"""
This module provides the B-format B.LS instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not (proc.C and (not proc.Z)):
        proc.reg["PC"].set(proc.labels[BR_address])


B_LS = B(97, operation)
Esempio n. 4
0
"""
This module provides the B-format B.GT instruction
"""
from armv8_isa import B

#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if (not proc.Z) and (proc.N==proc.V):
        proc.reg["PC"].set(proc.labels[BR_address])

B_GT = B(97, operation)
Esempio n. 5
0
"""
This module provides the B-format B.VS instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if proc.V:
        proc.reg["PC"].set(proc.labels[BR_address])


B_VS = B(97, operation)
Esempio n. 6
0
"""
This module provides the B-format B.NV instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if (proc.Z) or (proc.C) or (proc.V) or (proc.N):
        proc.reg["PC"].set(proc.labels[BR_address])


B_NV = B(97, operation)
Esempio n. 7
0
"""
This module provides the B-format B.EQ instruction
"""
from armv8_isa import B

#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if proc.Z:
        proc.reg["PC"].set(proc.labels[BR_address])

B_EQ = B(98, operation)
Esempio n. 8
0
"""
This module provides the B-format B.HS instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if proc.C:
        proc.reg["PC"].set(proc.labels[BR_address])


B_HS = B(96, operation)
Esempio n. 9
0
"""
This module provides the B-format B.HI instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if (not proc.Z) and (proc.C):
        proc.reg["PC"].set(proc.labels[BR_address])


B_HI = B(97, operation)
Esempio n. 10
0
"""
This module provides the B-format B.PL instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not proc.N:
        proc.reg["PC"].set(proc.labels[BR_address])


B_PL = B(97, operation)
Esempio n. 11
0
"""
This module provides the B-format B.GE instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not proc.N == proc.V:
        proc.reg["PC"].set(proc.labels[BR_address])


B_GE = B(97, operation)
Esempio n. 12
0
"""
This module provides the B-format B.LO instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not proc.C:
        proc.reg["PC"].set(proc.labels[BR_address])


B_LO = B(95, operation)
Esempio n. 13
0
"""
This module provides the B-format B.AL instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if (proc.Z) or (proc.C) or (proc.V) or (proc.N):
        proc.reg["PC"].set(proc.labels[BR_address])


B_AL = B(97, operation)
Esempio n. 14
0
"""
This module provides the B-format B.LE instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not ((not proc.Z) and (proc.N == proc.V)):
        proc.reg["PC"].set(proc.labels[BR_address])


B_LE = B(97, operation)
Esempio n. 15
0
"""
This module provides the B-format B.NE instruction
"""
from armv8_isa import B

#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not proc.Z:
        proc.reg["PC"].set(proc.labels[BR_address])

B_NE = B(97, operation)
Esempio n. 16
0
"""
This module provides the B-format B.VC instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not proc.V:
        proc.reg["PC"].set(proc.labels[BR_address])


B_VC = B(97, operation)