Optimize 0.0 floating point constants. (#344)
* Optimize 0.0 floating point constants. Rather than using the existing process of emitting bit patterns and moving them into floating point registers, use the `xorps` instruction to zero out the register. * is_zero predicate function will not accept negative zero. Fixed formatting for encoding recipe and filetests.
This commit is contained in:
@@ -262,6 +262,38 @@ class IsEqual(FieldPredicate):
|
||||
self.value = value
|
||||
|
||||
|
||||
class IsZero32BitFloat(FieldPredicate):
|
||||
"""
|
||||
Instruction predicate that checks if an immediate instruction format field
|
||||
is equal to zero.
|
||||
|
||||
:param field: `FormatField` to be checked.
|
||||
:param value: The constant value to check.
|
||||
"""
|
||||
|
||||
def __init__(self, field):
|
||||
# type: (FormatField) -> None
|
||||
super(IsZero32BitFloat, self).__init__(field,
|
||||
'is_zero_32_bit_float',
|
||||
())
|
||||
|
||||
|
||||
class IsZero64BitFloat(FieldPredicate):
|
||||
"""
|
||||
Instruction predicate that checks if an immediate instruction format field
|
||||
is equal to zero.
|
||||
|
||||
:param field: `FormatField` to be checked.
|
||||
:param value: The constant value to check.
|
||||
"""
|
||||
|
||||
def __init__(self, field):
|
||||
# type: (FormatField) -> None
|
||||
super(IsZero64BitFloat, self).__init__(field,
|
||||
'is_zero_64_bit_float',
|
||||
())
|
||||
|
||||
|
||||
class IsSignedInt(FieldPredicate):
|
||||
"""
|
||||
Instruction predicate that checks if an immediate instruction format field
|
||||
|
||||
Reference in New Issue
Block a user