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:
data-pup
2018-05-24 17:16:25 -04:00
committed by Dan Gohman
parent 4afb28ef59
commit 191bab162b
6 changed files with 134 additions and 2 deletions

View File

@@ -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