public class AMD64ConvertSnippets extends Object implements Snippets
Modifier and Type | Class and Description |
---|---|
static class |
AMD64ConvertSnippets.Templates |
Constructor and Description |
---|
AMD64ConvertSnippets() |
Modifier and Type | Method and Description |
---|---|
static int |
d2i(double input,
int result)
Converts a double to an int.
|
static long |
d2l(double input,
long result)
Converts a double to a long.
|
static int |
f2i(float input,
int result)
Converts a float to an int.
|
static long |
f2l(float input,
long result)
Converts a float to a long.
|
public AMD64ConvertSnippets()
public static int f2i(float input, int result)
This snippet accounts for the semantics of the x64 CVTTSS2SI instruction used to do the
conversion. If the float value is a NaN, infinity or if the result of the conversion is
larger than Integer.MAX_VALUE
then CVTTSS2SI returns Integer.MIN_VALUE
and
extra tests are required on the float value to return the correct int value.
input
- the float being convertedresult
- the result produced by the CVTTSS2SI instructionpublic static long f2l(float input, long result)
This snippet accounts for the semantics of the x64 CVTTSS2SI instruction used to do the
conversion. If the float value is a NaN or infinity then CVTTSS2SI returns
Long.MIN_VALUE
and extra tests are required on the float value to return the correct
long value.
input
- the float being convertedresult
- the result produced by the CVTTSS2SI instructionpublic static int d2i(double input, int result)
This snippet accounts for the semantics of the x64 CVTTSD2SI instruction used to do the
conversion. If the double value is a NaN, infinity or if the result of the conversion is
larger than Integer.MAX_VALUE
then CVTTSD2SI returns Integer.MIN_VALUE
and
extra tests are required on the double value to return the correct int value.
input
- the double being convertedresult
- the result produced by the CVTTSS2SI instructionpublic static long d2l(double input, long result)
This snippet accounts for the semantics of the x64 CVTTSD2SI instruction used to do the
conversion. If the double value is a NaN, infinity or if the result of the conversion is
larger than Long.MAX_VALUE
then CVTTSD2SI returns Long.MIN_VALUE
and extra
tests are required on the double value to return the correct long value.
input
- the double being convertedresult
- the result produced by the CVTTSS2SI instruction