From 38c10d20f7b0a83f4d94a92d30ca649b86b0a7cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20L=C3=A5ng?= Date: Mon, 20 Jun 2016 18:26:39 +0200 Subject: hipe_x86: Add code rewrite RA callbacks These will not only be useful for hipe_regalloc_prepass, but also, after the introduction of a mk_move/2 (or similar) callback, for the purpose of range splitting. Since the substitution needed to case over all the instructions, a new module, hipe_x86_subst, was introduced to the x86 backend. Due to differences in the 'jtab' field of a #jmp_switch{} between x86 and amd64, it regrettably needed to be duplicated to hipe_amd64_subst. --- lib/hipe/amd64/Makefile | 1 + lib/hipe/amd64/hipe_amd64_subst.erl | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 lib/hipe/amd64/hipe_amd64_subst.erl (limited to 'lib/hipe/amd64') diff --git a/lib/hipe/amd64/Makefile b/lib/hipe/amd64/Makefile index ea3559b7e6..617f6749ac 100644 --- a/lib/hipe/amd64/Makefile +++ b/lib/hipe/amd64/Makefile @@ -59,6 +59,7 @@ MODULES=hipe_amd64_assemble \ hipe_amd64_ra_sse2_postconditions \ hipe_amd64_registers \ hipe_amd64_spill_restore \ + hipe_amd64_subst \ hipe_amd64_x87 \ hipe_amd64_sse2 \ hipe_rtl_to_amd64 diff --git a/lib/hipe/amd64/hipe_amd64_subst.erl b/lib/hipe/amd64/hipe_amd64_subst.erl new file mode 100644 index 0000000000..7d0f06684b --- /dev/null +++ b/lib/hipe/amd64/hipe_amd64_subst.erl @@ -0,0 +1,21 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2016. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%% +%% %CopyrightEnd% +%% + +-include("../x86/hipe_x86_subst.erl"). -- cgit v1.2.3