changeset 8195:5619aa66aec1

added probabilities to Convert snippets
author Doug Simon <doug.simon@oracle.com>
date Mon, 11 Mar 2013 14:28:34 +0100
parents 75e8020ed0f5
children 4508b693afa6
files graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/snippets/AMD64ConvertSnippets.java
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/snippets/AMD64ConvertSnippets.java	Mon Mar 11 12:07:28 2013 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/snippets/AMD64ConvertSnippets.java	Mon Mar 11 14:28:34 2013 +0100
@@ -24,6 +24,7 @@
 
 import static com.oracle.graal.snippets.SnippetTemplate.*;
 import static com.oracle.graal.snippets.SnippetTemplate.Arguments.*;
+import static com.oracle.graal.snippets.nodes.BranchProbabilityNode.*;
 
 import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.meta.*;
@@ -58,6 +59,7 @@
     @Snippet
     public static int f2i(@Parameter("input") float input, @Parameter("result") int result) {
         if (result == Integer.MIN_VALUE) {
+            probability(NOT_FREQUENT_PROBABILITY);
             if (Float.isNaN(input)) {
                 // input is NaN -> return 0
                 return 0;
@@ -83,6 +85,7 @@
     @Snippet
     public static long f2l(@Parameter("input") float input, @Parameter("result") long result) {
         if (result == Long.MIN_VALUE) {
+            probability(NOT_FREQUENT_PROBABILITY);
             if (Float.isNaN(input)) {
                 // input is NaN -> return 0
                 return 0;
@@ -108,6 +111,7 @@
     @Snippet
     public static int d2i(@Parameter("input") double input, @Parameter("result") int result) {
         if (result == Integer.MIN_VALUE) {
+            probability(NOT_FREQUENT_PROBABILITY);
             if (Double.isNaN(input)) {
                 // input is NaN -> return 0
                 return 0;
@@ -133,6 +137,7 @@
     @Snippet
     public static long d2l(@Parameter("input") double input, @Parameter("result") long result) {
         if (result == Long.MIN_VALUE) {
+            probability(NOT_FREQUENT_PROBABILITY);
             if (Double.isNaN(input)) {
                 // input is NaN -> return 0
                 return 0;