2015-01-19 14:34:58 -05:00
|
|
|
// Inferno utils/5c/5.out.h
|
|
|
|
|
// http://code.google.com/p/inferno-os/source/browse/utils/5c/5.out.h
|
|
|
|
|
//
|
|
|
|
|
// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved.
|
|
|
|
|
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
|
|
|
|
|
// Portions Copyright © 1997-1999 Vita Nuova Limited
|
|
|
|
|
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
|
|
|
|
|
// Portions Copyright © 2004,2006 Bruce Ellis
|
|
|
|
|
// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net)
|
|
|
|
|
// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
|
|
|
|
|
// Portions Copyright © 2009 The Go Authors. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
// of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
// in the Software without restriction, including without limitation the rights
|
|
|
|
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
// copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
// furnished to do so, subject to the following conditions:
|
|
|
|
|
//
|
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
|
//
|
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
|
// THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
package arm
|
|
|
|
|
|
[dev.cc] cmd/internal/obj: reconvert from liblink
cmd/internal/obj reconverted using rsc.io/c2go rev 2a95256.
- Brings in new, more regular Prog, Addr definitions
- Add Prog* argument to oclass in liblink/asm[68].c, for c2go conversion.
- Update objwriter for change in TEXT size encoding.
- Merge 5a, 6a, 8a, 9a changes into new5a, new6a, new8a, new9a (by hand).
- Add +build ignore to cmd/asm/internal/{addr,arch,asm}, cmd/asm.
They need to be updated for the changes.
- Reenable verifyAsm in cmd/go.
- Reenable GOOBJ=2 mode by default in liblink.
All architectures build successfully again.
Change-Id: I2c845c5d365aa484b570476898171bee657b626d
Reviewed-on: https://go-review.googlesource.com/3963
Reviewed-by: Rob Pike <r@golang.org>
2015-02-05 03:57:44 -05:00
|
|
|
import "cmd/internal/obj"
|
2015-01-19 14:34:58 -05:00
|
|
|
|
|
|
|
|
// TODO(ality): remove this workaround.
|
|
|
|
|
// It's here because Pconv in liblink/list?.c references %L.
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
NSNAME = 8
|
|
|
|
|
NSYM = 50
|
|
|
|
|
NREG = 16
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
/* -1 disables use of REGARG */
|
|
|
|
|
const (
|
|
|
|
|
REGARG = -1
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
2015-02-26 17:09:16 -08:00
|
|
|
REG_R0 = obj.RBaseARM + iota
|
[dev.cc] cmd/internal/obj: reconvert from liblink
cmd/internal/obj reconverted using rsc.io/c2go rev 2a95256.
- Brings in new, more regular Prog, Addr definitions
- Add Prog* argument to oclass in liblink/asm[68].c, for c2go conversion.
- Update objwriter for change in TEXT size encoding.
- Merge 5a, 6a, 8a, 9a changes into new5a, new6a, new8a, new9a (by hand).
- Add +build ignore to cmd/asm/internal/{addr,arch,asm}, cmd/asm.
They need to be updated for the changes.
- Reenable verifyAsm in cmd/go.
- Reenable GOOBJ=2 mode by default in liblink.
All architectures build successfully again.
Change-Id: I2c845c5d365aa484b570476898171bee657b626d
Reviewed-on: https://go-review.googlesource.com/3963
Reviewed-by: Rob Pike <r@golang.org>
2015-02-05 03:57:44 -05:00
|
|
|
REG_R1
|
|
|
|
|
REG_R2
|
|
|
|
|
REG_R3
|
|
|
|
|
REG_R4
|
|
|
|
|
REG_R5
|
|
|
|
|
REG_R6
|
|
|
|
|
REG_R7
|
|
|
|
|
REG_R8
|
|
|
|
|
REG_R9
|
|
|
|
|
REG_R10
|
|
|
|
|
REG_R11
|
|
|
|
|
REG_R12
|
|
|
|
|
REG_R13
|
|
|
|
|
REG_R14
|
|
|
|
|
REG_R15
|
|
|
|
|
REG_F0
|
|
|
|
|
REG_F1
|
|
|
|
|
REG_F2
|
|
|
|
|
REG_F3
|
|
|
|
|
REG_F4
|
|
|
|
|
REG_F5
|
|
|
|
|
REG_F6
|
|
|
|
|
REG_F7
|
|
|
|
|
REG_F8
|
|
|
|
|
REG_F9
|
|
|
|
|
REG_F10
|
|
|
|
|
REG_F11
|
|
|
|
|
REG_F12
|
|
|
|
|
REG_F13
|
|
|
|
|
REG_F14
|
|
|
|
|
REG_F15
|
|
|
|
|
REG_FPSR
|
|
|
|
|
REG_FPCR
|
|
|
|
|
REG_CPSR
|
|
|
|
|
REG_SPSR
|
2015-02-26 17:09:16 -08:00
|
|
|
MAXREG
|
[dev.cc] cmd/internal/obj: reconvert from liblink
cmd/internal/obj reconverted using rsc.io/c2go rev 2a95256.
- Brings in new, more regular Prog, Addr definitions
- Add Prog* argument to oclass in liblink/asm[68].c, for c2go conversion.
- Update objwriter for change in TEXT size encoding.
- Merge 5a, 6a, 8a, 9a changes into new5a, new6a, new8a, new9a (by hand).
- Add +build ignore to cmd/asm/internal/{addr,arch,asm}, cmd/asm.
They need to be updated for the changes.
- Reenable verifyAsm in cmd/go.
- Reenable GOOBJ=2 mode by default in liblink.
All architectures build successfully again.
Change-Id: I2c845c5d365aa484b570476898171bee657b626d
Reviewed-on: https://go-review.googlesource.com/3963
Reviewed-by: Rob Pike <r@golang.org>
2015-02-05 03:57:44 -05:00
|
|
|
REGRET = REG_R0
|
|
|
|
|
REGEXT = REG_R10
|
2015-01-19 14:34:58 -05:00
|
|
|
REGG = REGEXT - 0
|
|
|
|
|
REGM = REGEXT - 1
|
2015-02-13 14:40:36 -05:00
|
|
|
REGCTXT = REG_R7
|
[dev.cc] cmd/internal/obj: reconvert from liblink
cmd/internal/obj reconverted using rsc.io/c2go rev 2a95256.
- Brings in new, more regular Prog, Addr definitions
- Add Prog* argument to oclass in liblink/asm[68].c, for c2go conversion.
- Update objwriter for change in TEXT size encoding.
- Merge 5a, 6a, 8a, 9a changes into new5a, new6a, new8a, new9a (by hand).
- Add +build ignore to cmd/asm/internal/{addr,arch,asm}, cmd/asm.
They need to be updated for the changes.
- Reenable verifyAsm in cmd/go.
- Reenable GOOBJ=2 mode by default in liblink.
All architectures build successfully again.
Change-Id: I2c845c5d365aa484b570476898171bee657b626d
Reviewed-on: https://go-review.googlesource.com/3963
Reviewed-by: Rob Pike <r@golang.org>
2015-02-05 03:57:44 -05:00
|
|
|
REGTMP = REG_R11
|
|
|
|
|
REGSP = REG_R13
|
|
|
|
|
REGLINK = REG_R14
|
|
|
|
|
REGPC = REG_R15
|
2015-01-19 14:34:58 -05:00
|
|
|
NFREG = 16
|
[dev.cc] cmd/internal/obj: reconvert from liblink
cmd/internal/obj reconverted using rsc.io/c2go rev 2a95256.
- Brings in new, more regular Prog, Addr definitions
- Add Prog* argument to oclass in liblink/asm[68].c, for c2go conversion.
- Update objwriter for change in TEXT size encoding.
- Merge 5a, 6a, 8a, 9a changes into new5a, new6a, new8a, new9a (by hand).
- Add +build ignore to cmd/asm/internal/{addr,arch,asm}, cmd/asm.
They need to be updated for the changes.
- Reenable verifyAsm in cmd/go.
- Reenable GOOBJ=2 mode by default in liblink.
All architectures build successfully again.
Change-Id: I2c845c5d365aa484b570476898171bee657b626d
Reviewed-on: https://go-review.googlesource.com/3963
Reviewed-by: Rob Pike <r@golang.org>
2015-02-05 03:57:44 -05:00
|
|
|
FREGRET = REG_F0
|
|
|
|
|
FREGEXT = REG_F7
|
|
|
|
|
FREGTMP = REG_F15
|
2015-01-19 14:34:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
/* compiler allocates register variables F0 up */
|
|
|
|
|
/* compiler allocates external registers F7 down */
|
|
|
|
|
const (
|
|
|
|
|
C_NONE = iota
|
|
|
|
|
C_REG
|
|
|
|
|
C_REGREG
|
|
|
|
|
C_REGREG2
|
|
|
|
|
C_SHIFT
|
|
|
|
|
C_FREG
|
|
|
|
|
C_PSR
|
|
|
|
|
C_FCR
|
|
|
|
|
C_RCON
|
|
|
|
|
C_NCON
|
|
|
|
|
C_SCON
|
|
|
|
|
C_LCON
|
|
|
|
|
C_LCONADDR
|
|
|
|
|
C_ZFCON
|
|
|
|
|
C_SFCON
|
|
|
|
|
C_LFCON
|
|
|
|
|
C_RACON
|
|
|
|
|
C_LACON
|
|
|
|
|
C_SBRA
|
|
|
|
|
C_LBRA
|
|
|
|
|
C_HAUTO
|
|
|
|
|
C_FAUTO
|
|
|
|
|
C_HFAUTO
|
|
|
|
|
C_SAUTO
|
|
|
|
|
C_LAUTO
|
|
|
|
|
C_HOREG
|
|
|
|
|
C_FOREG
|
|
|
|
|
C_HFOREG
|
|
|
|
|
C_SOREG
|
|
|
|
|
C_ROREG
|
|
|
|
|
C_SROREG
|
|
|
|
|
C_LOREG
|
|
|
|
|
C_PC
|
|
|
|
|
C_SP
|
|
|
|
|
C_HREG
|
|
|
|
|
C_ADDR
|
[dev.cc] cmd/internal/obj: reconvert from liblink
cmd/internal/obj reconverted using rsc.io/c2go rev 2a95256.
- Brings in new, more regular Prog, Addr definitions
- Add Prog* argument to oclass in liblink/asm[68].c, for c2go conversion.
- Update objwriter for change in TEXT size encoding.
- Merge 5a, 6a, 8a, 9a changes into new5a, new6a, new8a, new9a (by hand).
- Add +build ignore to cmd/asm/internal/{addr,arch,asm}, cmd/asm.
They need to be updated for the changes.
- Reenable verifyAsm in cmd/go.
- Reenable GOOBJ=2 mode by default in liblink.
All architectures build successfully again.
Change-Id: I2c845c5d365aa484b570476898171bee657b626d
Reviewed-on: https://go-review.googlesource.com/3963
Reviewed-by: Rob Pike <r@golang.org>
2015-02-05 03:57:44 -05:00
|
|
|
C_TEXTSIZE
|
2015-01-19 14:34:58 -05:00
|
|
|
C_GOK
|
|
|
|
|
C_NCLASS
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
[dev.cc] cmd/internal/obj: reconvert from liblink
cmd/internal/obj reconverted using rsc.io/c2go rev 2a95256.
- Brings in new, more regular Prog, Addr definitions
- Add Prog* argument to oclass in liblink/asm[68].c, for c2go conversion.
- Update objwriter for change in TEXT size encoding.
- Merge 5a, 6a, 8a, 9a changes into new5a, new6a, new8a, new9a (by hand).
- Add +build ignore to cmd/asm/internal/{addr,arch,asm}, cmd/asm.
They need to be updated for the changes.
- Reenable verifyAsm in cmd/go.
- Reenable GOOBJ=2 mode by default in liblink.
All architectures build successfully again.
Change-Id: I2c845c5d365aa484b570476898171bee657b626d
Reviewed-on: https://go-review.googlesource.com/3963
Reviewed-by: Rob Pike <r@golang.org>
2015-02-05 03:57:44 -05:00
|
|
|
AAND = obj.A_ARCHSPECIFIC + iota
|
2015-01-19 14:34:58 -05:00
|
|
|
AEOR
|
|
|
|
|
ASUB
|
|
|
|
|
ARSB
|
|
|
|
|
AADD
|
|
|
|
|
AADC
|
|
|
|
|
ASBC
|
|
|
|
|
ARSC
|
|
|
|
|
ATST
|
|
|
|
|
ATEQ
|
|
|
|
|
ACMP
|
|
|
|
|
ACMN
|
|
|
|
|
AORR
|
|
|
|
|
ABIC
|
|
|
|
|
AMVN
|
|
|
|
|
ABEQ
|
|
|
|
|
ABN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
|
|
|
ABX
|
|
|
|
|
ABXRET
|
|
|
|
|
ADWORD
|
|
|
|
|
ALDREX
|
|
|
|
|
ASTREX
|
|
|
|
|
ALDREXD
|
|
|
|
|
ASTREXD
|
|
|
|
|
APLD
|
|
|
|
|
ACLZ
|
|
|
|
|
AMULWT
|
|
|
|
|
AMULWB
|
|
|
|
|
AMULAWT
|
|
|
|
|
AMULAWB
|
|
|
|
|
ADATABUNDLE
|
|
|
|
|
ADATABUNDLEEND
|
|
|
|
|
AMRC
|
|
|
|
|
ALAST
|
[dev.cc] cmd/internal/obj: reconvert from liblink
cmd/internal/obj reconverted using rsc.io/c2go rev 2a95256.
- Brings in new, more regular Prog, Addr definitions
- Add Prog* argument to oclass in liblink/asm[68].c, for c2go conversion.
- Update objwriter for change in TEXT size encoding.
- Merge 5a, 6a, 8a, 9a changes into new5a, new6a, new8a, new9a (by hand).
- Add +build ignore to cmd/asm/internal/{addr,arch,asm}, cmd/asm.
They need to be updated for the changes.
- Reenable verifyAsm in cmd/go.
- Reenable GOOBJ=2 mode by default in liblink.
All architectures build successfully again.
Change-Id: I2c845c5d365aa484b570476898171bee657b626d
Reviewed-on: https://go-review.googlesource.com/3963
Reviewed-by: Rob Pike <r@golang.org>
2015-02-05 03:57:44 -05:00
|
|
|
AB = obj.AJMP
|
|
|
|
|
ABL = obj.ACALL
|
2015-01-19 14:34:58 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
/* scond byte */
|
|
|
|
|
const (
|
|
|
|
|
C_SCOND = (1 << 4) - 1
|
|
|
|
|
C_SBIT = 1 << 4
|
|
|
|
|
C_PBIT = 1 << 5
|
|
|
|
|
C_WBIT = 1 << 6
|
|
|
|
|
C_FBIT = 1 << 7
|
|
|
|
|
C_UBIT = 1 << 7
|
[dev.cc] cmd/internal/obj: reconvert from liblink
cmd/internal/obj reconverted using rsc.io/c2go rev 2a95256.
- Brings in new, more regular Prog, Addr definitions
- Add Prog* argument to oclass in liblink/asm[68].c, for c2go conversion.
- Update objwriter for change in TEXT size encoding.
- Merge 5a, 6a, 8a, 9a changes into new5a, new6a, new8a, new9a (by hand).
- Add +build ignore to cmd/asm/internal/{addr,arch,asm}, cmd/asm.
They need to be updated for the changes.
- Reenable verifyAsm in cmd/go.
- Reenable GOOBJ=2 mode by default in liblink.
All architectures build successfully again.
Change-Id: I2c845c5d365aa484b570476898171bee657b626d
Reviewed-on: https://go-review.googlesource.com/3963
Reviewed-by: Rob Pike <r@golang.org>
2015-02-05 03:57:44 -05:00
|
|
|
C_SCOND_XOR = 14
|
|
|
|
|
C_SCOND_EQ = 0 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_NE = 1 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_HS = 2 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_LO = 3 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_MI = 4 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_PL = 5 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_VS = 6 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_VC = 7 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_HI = 8 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_LS = 9 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_GE = 10 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_LT = 11 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_GT = 12 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_LE = 13 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_NONE = 14 ^ C_SCOND_XOR
|
|
|
|
|
C_SCOND_NV = 15 ^ C_SCOND_XOR
|
2015-01-19 14:34:58 -05:00
|
|
|
SHIFT_LL = 0 << 5
|
|
|
|
|
SHIFT_LR = 1 << 5
|
|
|
|
|
SHIFT_AR = 2 << 5
|
|
|
|
|
SHIFT_RR = 3 << 5
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* this is the ranlib header
|
|
|
|
|
*/
|
|
|
|
|
var SYMDEF string
|