From 84adefa331c4159d432d22840663c38f155cd4c1 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Fri, 20 Nov 2009 14:54:40 +0000 Subject: The R13B03 release. --- lib/hipe/x86/hipe_x86.hrl | 116 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 lib/hipe/x86/hipe_x86.hrl (limited to 'lib/hipe/x86/hipe_x86.hrl') diff --git a/lib/hipe/x86/hipe_x86.hrl b/lib/hipe/x86/hipe_x86.hrl new file mode 100644 index 0000000000..3d22fb381f --- /dev/null +++ b/lib/hipe/x86/hipe_x86.hrl @@ -0,0 +1,116 @@ +%%% +%%% %CopyrightBegin% +%%% +%%% Copyright Ericsson AB 2001-2009. All Rights Reserved. +%%% +%%% The contents of this file are subject to the Erlang Public License, +%%% Version 1.1, (the "License"); you may not use this file except in +%%% compliance with the License. You should have received a copy of the +%%% Erlang Public License along with this software. If not, it can be +%%% retrieved online at http://www.erlang.org/. +%%% +%%% Software distributed under the License is distributed on an "AS IS" +%%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%%% the License for the specific language governing rights and limitations +%%% under the License. +%%% +%%% %CopyrightEnd% +%%% +%%% concrete representation of 2-address pseudo-x86 code + +%%%-------------------------------------------------------------------- +%%% x86 operands: +%%% +%%% int32 ::= +%%% reg ::= +%%% type ::= 'tagged' | 'untagged' +%%% label ::= +%%% label_type ::= 'label' | 'constant' +%%% aluop ::= +%%% term ::= +%%% cc ::= +%%% pred ::= +%%% npop ::= +%%% +%%% temp ::= {x86_temp, reg, type, allocatable} +%%% allocatable ::= 'true' | 'false' +%%% +%%% imm ::= {x86_imm, value} +%%% value ::= int32 | atom | {label, label_type} +%%% +%%% mem ::= {x86_mem, base, off, mem_type} +%%% base ::= temp | [] (XXX BUG: not quite true before RA) +%%% off ::= imm | temp +%%% mem_type ::= 'byte' | 'int16' (only valid with mov{s,z}x) +%%% | type +%%% +%%% src ::= temp | mem | imm +%%% dst ::= temp | mem +%%% arg ::= src +%%% args ::= +%%% +%%% mfa ::= {x86_mfa, atom, atom, byte} +%%% prim ::= {x86_prim, atom} +%%% fun ::= mfa | prim | temp | mem +%%% +%%% jtab ::= label (equiv. to {x86_imm,{label,'constant'}}) +%%% +%%% sdesc ::= {x86_sdesc, exnlab, fsize, arity, live} +%%% exnlab ::= [] | label +%%% fsize ::= (frame size in words) +%%% live ::= (word offsets) +%%% arity ::= int32 + +-record(x86_temp, {reg, type, allocatable}). +-record(x86_imm, {value}). +-record(x86_mem, {base, off, type}). +-record(x86_fpreg, {reg, pseudo}). +-record(x86_mfa, {m::atom(), f::atom(), a::arity()}). +-record(x86_prim, {prim}). +-record(x86_sdesc, {exnlab, fsize, arity::arity(), live::tuple()}). + +%%% Basic instructions. +%%% These follow the AT&T convention, i.e. op src,dst (dst := dst op src) +%%% After register allocation, at most one operand in a binary +%%% instruction (alu, cmp, move) may denote a memory cell. +%%% After frame allocation, every temp must denote a physical register. + +-record(alu, {aluop, src, dst}). +-record(call, {'fun', sdesc, linkage}). +-record(cmovcc, {cc, src, dst}). +-record(cmp, {src, dst}). % a 'sub' alu which doesn't update dst +-record(comment, {term}). +-record(fmove, {src, dst}). +-record(fp_binop, {op, src, dst}). +-record(fp_unop, {op, arg}). % arg may be [] :-( +-record(imul, {imm_opt, src, temp}). % imm_opt:[]|imm, src:temp|mem +-record(jcc, {cc, label}). +-record(jmp_fun, {'fun', linkage}). % tailcall, direct or indirect +-record(jmp_label, {label}). % local jmp, direct +-record(jmp_switch, {temp, jtab, labels}). % local jmp, indirect +-record(label, {label}). +-record(lea, {mem, temp}). +-record(move, {src, dst}). +-record(move64, {imm, dst}). +-record(movsx, {src, dst}). +-record(movzx, {src, dst}). +-record(pseudo_call, {'fun', sdesc, contlab, linkage}). +-record(pseudo_jcc, {cc, true_label, false_label, pred}). +-record(pseudo_spill, {args=[]}). +-record(pseudo_tailcall, {'fun', arity, stkargs, linkage}). +-record(pseudo_tailcall_prepare, {}). +-record(push, {src}). +-record(pop, {dst}). +-record(ret, {npop}). % EAX is live-in +-record(shift, {shiftop, src, dst}). +-record(test, {src, dst}). + +%%% Function definitions. + +-include("../misc/hipe_consttab.hrl"). + +-record(defun, {mfa :: mfa(), formals, code, + data :: hipe_consttab(), + isclosure :: boolean(), + isleaf :: boolean(), + var_range, label_range}). -- cgit v1.2.3