Skip to content

Commit ae44040

Browse files
committed
or1k: Remove 64-bit support, it's not used and it breaks 32-bit hosts
Reported by Rich Felker when building on 32-bit hosts. Backwards jump negative offsets were not calculated correctly due to improper 32-bit to 64-bit zero-extension. The 64-bit fields are present because we are mixing 32-bit and 64-bit architectures in our cpu descriptions. Removing 64-bit fixes the issue. We don't use 64-bit, there is an architecture spec for 64-bit but no implementations or simulators. My thought is if we need them in the future we should do the proper work to support both 32-bit and 64-bit implementations co-existing then. cpu/ChangeLog: yyyy-mm-dd Stafford Horne <[email protected]> PR 25184 * or1k.cpu (arch or1k): Remove or64 and or64nd machs. (ORBIS-MACHS, ORFPX32-MACHS): Remove pmacros. (cpu or1k64bf, mach or64, mach or64nd): Remove definitions. * or1kcommon.cpu (h-fdr): Remove hardware. * or1korfpx.cpu (rDDF, rADF, rBDF): Remove operand definitions. (float-regreg-insn): Remove lf- mnemonic -d instruction pattern. (float-setflag-insn-base): Remove lf-sf mnemonic -d pattern. (float-cust-insn): Remove "lf-cust" cust-num "-d" pattern. (lf-rem-d, lf-itof-d, lf-ftoi-d, lf-madd-d): Remove.
1 parent 7e05773 commit ae44040

File tree

4 files changed

+16
-110
lines changed

4 files changed

+16
-110
lines changed

cpu/ChangeLog

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2020-05-19 Stafford Horne <[email protected]>
2+
3+
PR 25184
4+
* or1k.cpu (arch or1k): Remove or64 and or64nd machs.
5+
(ORBIS-MACHS, ORFPX32-MACHS): Remove pmacros.
6+
(cpu or1k64bf, mach or64, mach or64nd): Remove definitions.
7+
* or1kcommon.cpu (h-fdr): Remove hardware.
8+
* or1korfpx.cpu (rDDF, rADF, rBDF): Remove operand definitions.
9+
(float-regreg-insn): Remove lf- mnemonic -d instruction pattern.
10+
(float-setflag-insn-base): Remove lf-sf mnemonic -d pattern.
11+
(float-cust-insn): Remove "lf-cust" cust-num "-d" pattern.
12+
(lf-rem-d, lf-itof-d, lf-ftoi-d, lf-madd-d): Remove.
13+
114
2020-02-16 David Faust <[email protected]>
215

316
* bpf.cpu (define-cond-jump-insn): Renamed from djci.

cpu/or1k.cpu

+3-32
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
(comment "OpenRISC 1000")
3232
(default-alignment aligned)
3333
(insn-lsb0? #t)
34-
(machs or32 or32nd or64 or64nd)
34+
(machs or32 or32nd)
3535
(isas openrisc)
3636
)
3737

@@ -44,10 +44,8 @@
4444
)
4545

4646
(define-pmacro OR32-MACHS or32,or32nd)
47-
(define-pmacro OR64-MACHS or64,or64nd)
48-
(define-pmacro ORBIS-MACHS or32,or32nd,or64,or64nd)
49-
(define-pmacro ORFPX32-MACHS or32,or32nd,or64,or64nd)
50-
(define-pmacro ORFPX64-MACHS or64,or64nd)
47+
(define-pmacro ORBIS-MACHS or32,or32nd)
48+
(define-pmacro ORFPX32-MACHS or32,or32nd)
5149
(define-pmacro ORFPX64A32-MACHS or32,or32nd) ; float64 for 32-bit machs
5250

5351
(define-attr
@@ -100,33 +98,6 @@
10098
)
10199
)
102100

103-
(if (keep-mach? (or64 or64nd))
104-
(begin
105-
(define-cpu
106-
(name or1k64bf)
107-
(comment "OpenRISC 1000 64-bit CPU family")
108-
(insn-endian big)
109-
(data-endian big)
110-
(word-bitsize 64)
111-
(file-transform "64")
112-
)
113-
114-
(define-mach
115-
(name or64)
116-
(comment "Generic OpenRISC 1000 64-bit CPU")
117-
(cpu or1k64bf)
118-
(bfd-name "or1k64")
119-
)
120-
121-
(define-mach
122-
(name or64nd)
123-
(comment "Generic OpenRISC 1000 ND 64-bit CPU with no branch delay slot")
124-
(cpu or1k64bf)
125-
(bfd-name "or1k64nd")
126-
)
127-
)
128-
)
129-
130101
(include "or1kcommon.cpu")
131102
(include "or1korbis.cpu")
132103
(include "or1korfpx.cpu")

cpu/or1kcommon.cpu

-14
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,6 @@
114114
(set (index newval) (set UWI (reg h-gpr index) (zext UWI (subword SI newval 0))))
115115
)
116116

117-
;
118-
; Hardware: virtual registerts for FPU (double precision)
119-
; mapped to GPRs
120-
;
121-
(define-hardware
122-
(name h-fdr)
123-
(comment "or64 floating point registers (double, virtual)")
124-
(attrs VIRTUAL (MACH ORFPX64-MACHS))
125-
(type register DF (32))
126-
(indices keyword "" REG-INDICES)
127-
(get (index) (subword DF (trunc DI (reg h-gpr index)) 0))
128-
(set (index newval) (set UDI (reg h-gpr index) (zext UDI (subword DI newval 0))))
129-
)
130-
131117
;
132118
; Register pairs are offset by 2 for registers r16 and above. This is to
133119
; be able to allow registers to be call saved in GCC across function calls.

cpu/or1korfpx.cpu

-64
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@
8484
(dnop rASF "source register A (single floating point mode)" ((MACH ORFPX32-MACHS)) h-fsr f-r2)
8585
(dnop rBSF "source register B (single floating point mode)" ((MACH ORFPX32-MACHS)) h-fsr f-r3)
8686

87-
(dnop rDDF "or64 destination register (double floating point mode)" ((MACH ORFPX64-MACHS)) h-fdr f-r1)
88-
(dnop rADF "or64 source register A (double floating point mode)" ((MACH ORFPX64-MACHS)) h-fdr f-r2)
89-
(dnop rBDF "or64 source register B (double floating point mode)" ((MACH ORFPX64-MACHS)) h-fdr f-r3)
90-
9187
(define-pmacro (double-field-and-ops mnemonic reg offbit op-comment)
9288
(begin
9389
(define-multi-ifield
@@ -152,14 +148,6 @@
152148
(set SF rDSF (mnemonic SF rASF rBSF))
153149
()
154150
)
155-
(dni (.sym lf- mnemonic -d)
156-
(.str "lf." mnemonic ".d reg/reg/reg")
157-
((MACH ORFPX64-MACHS))
158-
(.str "lf." mnemonic ".d $rDDF,$rADF,$rBDF")
159-
(+ OPC_FLOAT rDDF rADF rBDF (f-resv-10-3 0) (.sym OPC_FLOAT_REGREG_ (.upcase mnemonic) _D))
160-
(set DF rDDF (mnemonic DF rADF rBDF))
161-
()
162-
)
163151
(dni (.sym lf- mnemonic -d32)
164152
(.str "lf." mnemonic ".d regpair/regpair/regpair")
165153
((MACH ORFPX64A32-MACHS))
@@ -185,15 +173,6 @@
185173
()
186174
)
187175

188-
(dni lf-rem-d
189-
"lf.rem.d reg/reg/reg"
190-
((MACH ORFPX64-MACHS))
191-
"lf.rem.d $rDDF,$rADF,$rBDF"
192-
(+ OPC_FLOAT rDDF rADF rBDF (f-resv-10-3 0) OPC_FLOAT_REGREG_REM_D)
193-
(set DF rDDF (rem DF rADF rBDF))
194-
()
195-
)
196-
197176
(dni lf-rem-d32
198177
"lf.rem.d regpair/regpair/regpair"
199178
((MACH ORFPX64A32-MACHS))
@@ -221,15 +200,6 @@
221200
()
222201
)
223202

224-
(dni lf-itof-d
225-
"lf.itof.d reg/reg"
226-
((MACH ORFPX64-MACHS))
227-
"lf.itof.d $rDDF,$rA"
228-
(+ OPC_FLOAT rDDF rA (f-r3 0) (f-resv-10-3 0) OPC_FLOAT_REGREG_ITOF_D)
229-
(set DF rDDF (float DF (get-rounding-mode) rA))
230-
()
231-
)
232-
233203
(dni lf-itof-d32
234204
"lf.itof.d regpair/regpair"
235205
((MACH ORFPX64A32-MACHS))
@@ -248,15 +218,6 @@
248218
()
249219
)
250220

251-
(dni lf-ftoi-d
252-
"lf.ftoi.d reg/reg"
253-
((MACH ORFPX64-MACHS))
254-
"lf.ftoi.d $rD,$rADF"
255-
(+ OPC_FLOAT rD rADF (f-r3 0) (f-resv-10-3 0) OPC_FLOAT_REGREG_FTOI_D)
256-
(set WI rD (fix WI (get-rounding-mode) rADF))
257-
()
258-
)
259-
260221
(dni lf-ftoi-d32
261222
"lf.ftoi.d regpair/regpair"
262223
((MACH ORFPX64A32-MACHS))
@@ -276,14 +237,6 @@
276237
(symantics rtx-mnemonic SF rASF rBSF)
277238
()
278239
)
279-
(dni (.sym lf-sf mnemonic -d)
280-
(.str "lf.sf" mnemonic ".d reg/reg")
281-
((MACH ORFPX64-MACHS))
282-
(.str "lf.sf" mnemonic ".d $rADF,$rBDF")
283-
(+ OPC_FLOAT (f-r1 0) rADF rBDF (f-resv-10-3 0) (.sym OPC_FLOAT_REGREG_SF (.upcase mnemonic) _D))
284-
(symantics rtx-mnemonic DF rADF rBDF)
285-
()
286-
)
287240
(dni (.sym lf-sf mnemonic -d32)
288241
(.str "lf.sf" mnemonic ".d regpair/regpair")
289242
((MACH ORFPX64A32-MACHS))
@@ -336,15 +289,6 @@
336289
()
337290
)
338291

339-
(dni lf-madd-d
340-
"lf.madd.d reg/reg/reg"
341-
((MACH ORFPX64-MACHS))
342-
"lf.madd.d $rDDF,$rADF,$rBDF"
343-
(+ OPC_FLOAT rDDF rADF rBDF (f-resv-10-3 0) OPC_FLOAT_REGREG_MADD_D)
344-
(set DF rDDF (add DF (mul DF rADF rBDF) rDDF))
345-
()
346-
)
347-
348292
(dni lf-madd-d32
349293
"lf.madd.d regpair/regpair/regpair"
350294
((MACH ORFPX64A32-MACHS))
@@ -364,14 +308,6 @@
364308
(nop)
365309
()
366310
)
367-
(dni (.sym "lf-cust" cust-num "-d")
368-
(.str "lf.cust" cust-num ".d")
369-
((MACH ORFPX64-MACHS))
370-
(.str "lf.cust" cust-num ".d")
371-
(+ OPC_FLOAT (f-resv-25-5 0) rADF rBDF (f-resv-10-3 0) (.sym "OPC_FLOAT_REGREG_CUST" cust-num "_D"))
372-
(nop)
373-
()
374-
)
375311
(dni (.sym "lf-cust" cust-num "-d32")
376312
(.str "lf.cust" cust-num ".d")
377313
((MACH ORFPX64A32-MACHS))

0 commit comments

Comments
 (0)