Blob Blame History Raw
# HG changeset patch
# User mdoerr
# Date 1480079712 7200
#      Fri Nov 25 11:15:12 2016 -0200
# Node ID 3c499a0ba92b1affb3f473c6502e374f4785aba9
# Parent  9b9d9e11c04d5e5f64829d34752e5c94b1c7d911
8170328, PR3466, RH1498321: PPC64: Use andis instead of lis/and
Reviewed-by: goetz, mdoerr
Contributed-by: Igor Nunes <igor.nunes@eldorado.org.br>

diff --git a/src/cpu/ppc/vm/ppc.ad b/src/cpu/ppc/vm/ppc.ad
--- openjdk/hotspot/src/cpu/ppc/vm/ppc.ad
+++ openjdk/hotspot/src/cpu/ppc/vm/ppc.ad
@@ -8889,6 +8889,19 @@
   ins_pipe(pipe_class_default);
 %}
 
+// Left shifted Immediate And
+instruct andI_reg_immIhi16(iRegIdst dst, iRegIsrc src1, immIhi16  src2, flagsRegCR0 cr0) %{
+  match(Set dst (AndI src1 src2));
+  effect(KILL cr0);
+  format %{ "ANDIS   $dst, $src1, $src2.hi" %}
+  size(4);
+  ins_encode %{
+    // TODO: PPC port $archOpcode(ppc64Opcode_andis_);
+    __ andis_($dst$$Register, $src1$$Register, (int)((unsigned short)(($src2$$constant & 0xFFFF0000) >> 16)));
+  %}
+  ins_pipe(pipe_class_default);
+%}
+
 // Immediate And
 instruct andI_reg_uimm16(iRegIdst dst, iRegIsrc src1, uimmI16 src2, flagsRegCR0 cr0) %{
   match(Set dst (AndI src1 src2));