• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂6ce26ac7c381c78858b9a7bac344b5cd04bfb03e (tree)
時間2019-06-13 06:16:18
作者Stafford Horne <shorne@gmai...>
CommiterStafford Horne

Log Message

cpu/or1k: Add support for orfp64a32 spec

This patch adds support for OpenRISC 64-bit FPU operations on 32-bit cores by
using register pairs. The functionality has been added to OpenRISC architecture
specification version 1.3 as per architecture proposal 14[0].

For supporting assembly of both 64-bit and 32-bit precision instructions we have
defined CGEN_VALIDATE_INSN_SUPPORTED. This allows cgen to use 64-bit bit
architecture assembly parsing on 64-bit toolchains and 32-bit architecture
assembly parsing on 32-bit toolchains. Without this the assembler has issues
parsing register pairs.

This patch also contains a few fixes to the symantics for existing OpenRISC
single and double precision FPU operations.

[0] https://openrisc.io/proposals/orfpx64a32

cpu/ChangeLog:

yyyy-mm-dd Andrey Bacherov <avbacherov@opencores.org>
Stafford Horne <shorne@gmail.com>

* or1k.cpu (ORFPX64A32-MACHS): New pmacro.
(ORFPX-MACHS): Removed pmacro.
* or1k.opc (or1k_cgen_insn_supported): New function.
(CGEN_VALIDATE_INSN_SUPPORTED): Define macro.
(parse_regpair, print_regpair): New functions.
* or1kcommon.cpu (h-spr, spr-shift, spr-address, h-gpr): Reorder
and add comments.
(h-fdr): Update comment to indicate or64.
(reg-pair-reg-lo, reg-pair-reg-hi): New pmacros for register pairs.
(h-fd32r): New hardware for 64-bit fpu registers.
(h-i64r): New hardware for 64-bit int registers.
* or1korbis.cpu (f-resv-8-1): New field.
* or1korfpx.cpu (rDSF, rASF, rBSF): Update attribute to ORFPX32-MACHS.
(rDDF, rADF, rBDF): Update operand comment to indicate or64.
(f-rdoff-10-1, f-raoff-9-1, f-rboff-8-1): New fields.
(h-roff1): New hardware.
(double-field-and-ops mnemonic): New pmacro to generate operations
rDD32F, rAD32F, rBD32F, rDDI and rADI.
(float-regreg-insn): Update single precision generator to MACH
ORFPX32-MACHS. Add generator for or32 64-bit instructions.
(float-setflag-insn): Update single precision generator to MACH
ORFPX32-MACHS. Fix double instructions from single to double
precision. Add generator for or32 64-bit instructions.
(float-cust-insn cust-num): Update single precision generator to MACH
ORFPX32-MACHS. Add generator for or32 64-bit instructions.
(lf-rem-s, lf-itof-s, lf-ftoi-s, lf-madd-s): Update MACH to
ORFPX32-MACHS.
(lf-rem-d): Fix operation from mod to rem.
(lf-rem-d32, lf-itof-d32, lf-ftoi-d32, lf-madd-d32): New instruction.
(lf-itof-d): Fix operands from single to double.
(lf-ftoi-d): Update operand mode from DI to WI.

Change Summary

差異

--- a/cpu/ChangeLog
+++ b/cpu/ChangeLog
@@ -1,3 +1,38 @@
1+2019-06-13 Andrey Bacherov <avbacherov@opencores.org>
2+ Stafford Horne <shorne@gmail.com>
3+
4+ * or1k.cpu (ORFPX64A32-MACHS): New pmacro.
5+ (ORFPX-MACHS): Removed pmacro.
6+ * or1k.opc (or1k_cgen_insn_supported): New function.
7+ (CGEN_VALIDATE_INSN_SUPPORTED): Define macro.
8+ (parse_regpair, print_regpair): New functions.
9+ * or1kcommon.cpu (h-spr, spr-shift, spr-address, h-gpr): Reorder
10+ and add comments.
11+ (h-fdr): Update comment to indicate or64.
12+ (reg-pair-reg-lo, reg-pair-reg-hi): New pmacros for register pairs.
13+ (h-fd32r): New hardware for 64-bit fpu registers.
14+ (h-i64r): New hardware for 64-bit int registers.
15+ * or1korbis.cpu (f-resv-8-1): New field.
16+ * or1korfpx.cpu (rDSF, rASF, rBSF): Update attribute to ORFPX32-MACHS.
17+ (rDDF, rADF, rBDF): Update operand comment to indicate or64.
18+ (f-rdoff-10-1, f-raoff-9-1, f-rboff-8-1): New fields.
19+ (h-roff1): New hardware.
20+ (double-field-and-ops mnemonic): New pmacro to generate operations
21+ rDD32F, rAD32F, rBD32F, rDDI and rADI.
22+ (float-regreg-insn): Update single precision generator to MACH
23+ ORFPX32-MACHS. Add generator for or32 64-bit instructions.
24+ (float-setflag-insn): Update single precision generator to MACH
25+ ORFPX32-MACHS. Fix double instructions from single to double
26+ precision. Add generator for or32 64-bit instructions.
27+ (float-cust-insn cust-num): Update single precision generator to MACH
28+ ORFPX32-MACHS. Add generator for or32 64-bit instructions.
29+ (lf-rem-s, lf-itof-s, lf-ftoi-s, lf-madd-s): Update MACH to
30+ ORFPX32-MACHS.
31+ (lf-rem-d): Fix operation from mod to rem.
32+ (lf-rem-d32, lf-itof-d32, lf-ftoi-d32, lf-madd-d32): New instruction.
33+ (lf-itof-d): Fix operands from single to double.
34+ (lf-ftoi-d): Update operand mode from DI to WI.
35+
136 2019-05-23 Jose E. Marchesi <jose.marchesi@oracle.com>
237
338 * bpf.cpu: New file.
--- a/cpu/or1k.cpu
+++ b/cpu/or1k.cpu
@@ -1,8 +1,9 @@
11 ; OpenRISC 1000 architecture. -*- Scheme -*-
2-; Copyright 2000-2014 Free Software Foundation, Inc.
2+; Copyright 2000-2019 Free Software Foundation, Inc.
33 ; Contributed for OR32 by Johan Rydberg, jrydberg@opencores.org
44 ; Modified by Julius Baxter, juliusbaxter@gmail.com
55 ; Modified by Peter Gavin, pgavin@gmail.com
6+; Modified by Andrey Bacherov, avbacherov@opencores.org
67 ;
78 ; This program is free software; you can redistribute it and/or modify
89 ; it under the terms of the GNU General Public License as published by
@@ -42,12 +43,12 @@
4243 (base-insn-bitsize 32)
4344 )
4445
45-(define-pmacro OR32-MACHS or32,or32nd)
46-(define-pmacro OR64-MACHS or64,or64nd)
47-(define-pmacro ORBIS-MACHS or32,or32nd,or64,or64nd)
48-(define-pmacro ORFPX-MACHS or32,or32nd,or64,or64nd)
49-(define-pmacro ORFPX32-MACHS or32,or32nd,or64,or64nd)
50-(define-pmacro ORFPX64-MACHS or64,or64nd)
46+(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)
51+(define-pmacro ORFPX64A32-MACHS or32,or32nd) ; float64 for 32-bit machs
5152
5253 (define-attr
5354 (for model)
--- a/cpu/or1k.opc
+++ b/cpu/or1k.opc
@@ -40,9 +40,29 @@
4040 #undef CGEN_DIS_HASH
4141 #define CGEN_DIS_HASH(buffer, value) (((unsigned char *) (buffer))[0] >> 2)
4242
43+/* Check applicability of instructions against machines. */
44+#define CGEN_VALIDATE_INSN_SUPPORTED
45+
46+extern int or1k_cgen_insn_supported (CGEN_CPU_DESC, const CGEN_INSN *);
47+
4348 /* -- */
4449
4550 /* -- opc.c */
51+
52+/* Special check to ensure that instruction exists for given machine. */
53+
54+int
55+or1k_cgen_insn_supported (CGEN_CPU_DESC cd, const CGEN_INSN *insn)
56+{
57+ int machs = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_MACH);
58+
59+ /* No mach attribute? Assume it's supported for all machs. */
60+ if (machs == 0)
61+ return 1;
62+
63+ return ((machs & cd->machs) != 0);
64+}
65+
4666 /* -- */
4767
4868 /* -- asm.c */
@@ -415,6 +435,78 @@ parse_uimm16_split (CGEN_CPU_DESC cd, const char **strp, int opindex,
415435 return errmsg;
416436 }
417437
438+/* Parse register pairs with syntax rA,rB to a flag + rA value. */
439+
440+static const char *
441+parse_regpair (CGEN_CPU_DESC cd, const char **strp,
442+ int opindex ATTRIBUTE_UNUSED, unsigned long *valuep)
443+{
444+ long reg1_index;
445+ long reg2_index;
446+ const char *errmsg;
447+
448+ /* The first part should just be a register. */
449+ errmsg = cgen_parse_keyword (cd, strp, &or1k_cgen_opval_h_gpr,
450+ &reg1_index);
451+
452+ /* If that worked skip the comma separator. */
453+ if (errmsg == NULL)
454+ {
455+ if (**strp == ',')
456+ ++*strp;
457+ else
458+ errmsg = "Unexpected character, expected ','";
459+ }
460+
461+ /* If that worked the next part is just another register. */
462+ if (errmsg == NULL)
463+ errmsg = cgen_parse_keyword (cd, strp, &or1k_cgen_opval_h_gpr,
464+ &reg2_index);
465+
466+ /* Validate the register pair is valid and create the output value. */
467+ if (errmsg == NULL)
468+ {
469+ int regoffset = reg2_index - reg1_index;
470+
471+ if (regoffset == 1 || regoffset == 2)
472+ {
473+ unsigned short offsetmask;
474+ unsigned short value;
475+
476+ offsetmask = ((regoffset == 2 ? 1 : 0) << 5);
477+ value = offsetmask | reg1_index;
478+
479+ *valuep = value;
480+ }
481+ else
482+ errmsg = "Invalid register pair, offset not 1 or 2.";
483+ }
484+
485+ return errmsg;
486+}
487+
488+/* -- */
489+
490+/* -- dis.c */
491+
492+static void
493+print_regpair (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
494+ void * dis_info,
495+ long value,
496+ unsigned int attrs ATTRIBUTE_UNUSED,
497+ bfd_vma pc ATTRIBUTE_UNUSED,
498+ int length ATTRIBUTE_UNUSED)
499+{
500+ disassemble_info *info = dis_info;
501+ char reg1_index;
502+ char reg2_index;
503+
504+ reg1_index = value & 0x1f;
505+ reg2_index = reg1_index + ((value & (1 << 5)) ? 2 : 1);
506+
507+ (*info->fprintf_func) (info->stream, "r%d,r%d", reg1_index, reg2_index);
508+}
509+
418510 /* -- */
419511
420512 /* -- ibd.h */
--- a/cpu/or1kcommon.cpu
+++ b/cpu/or1kcommon.cpu
@@ -1,7 +1,8 @@
11 ; OpenRISC 1000 32-bit CPU hardware description. -*- Scheme -*-
2-; Copyright 2000-2014 Free Software Foundation, Inc.
2+; Copyright 2000-2019 Free Software Foundation, Inc.
33 ; Contributed for OR32 by Johan Rydberg, jrydberg@opencores.org
44 ; Modified by Julius Baxter, juliusbaxter@gmail.com
5+; Modified by Andrey Bacherov, avbacherov@opencores.org
56 ;
67 ; This program is free software; you can redistribute it and/or modify
78 ; it under the terms of the GNU General Public License as published by
@@ -71,6 +72,38 @@
7172 (fp 2))
7273 )
7374
75+;
76+; Hardware: [S]pecial [P]urpose [R]egisters
77+;
78+(define-hardware
79+ (name h-spr) (comment "special purpose registers")
80+ (attrs VIRTUAL (MACH ORBIS-MACHS))
81+ (type register UWI (#x20000))
82+ (get (index) (c-call UWI "@cpu@_h_spr_get_raw" index))
83+ (set (index newval) (c-call VOID "@cpu@_h_spr_set_raw" index newval))
84+)
85+
86+(define-pmacro spr-shift 11)
87+(define-pmacro (spr-address spr-group spr-index)
88+ (or (sll UWI (enum UWI (.sym "SPR-GROUP-" spr-group)) spr-shift)
89+ (enum UWI (.sym "SPR-INDEX-" spr-group "-" spr-index))))
90+
91+;
92+; Hardware: [G]enepral [P]urpose [R]egisters
93+;
94+(define-hardware
95+ (name h-gpr) (comment "general registers")
96+ (attrs (MACH ORBIS-MACHS))
97+ (type register UWI (32))
98+ (indices keyword "" REG-INDICES)
99+ (get (index) (reg UWI h-spr (add index (spr-address SYS GPR0))))
100+ (set (index newval) (set UWI (reg UWI h-spr (add index (spr-address SYS GPR0))) newval))
101+ )
102+
103+;
104+; Hardware: virtual registerts for FPU (single precision)
105+; mapped to GPRs
106+;
74107 (define-hardware
75108 (name h-fsr)
76109 (comment "floating point registers (single, virtual)")
@@ -81,8 +114,13 @@
81114 (set (index newval) (set UWI (reg h-gpr index) (zext UWI (subword SI newval 0))))
82115 )
83116
117+;
118+; Hardware: virtual registerts for FPU (double precision)
119+; mapped to GPRs
120+;
84121 (define-hardware
85- (name h-fdr) (comment "floating point registers (double, virtual)")
122+ (name h-fdr)
123+ (comment "or64 floating point registers (double, virtual)")
86124 (attrs VIRTUAL (MACH ORFPX64-MACHS))
87125 (type register DF (32))
88126 (indices keyword "" REG-INDICES)
@@ -90,27 +128,64 @@
90128 (set (index newval) (set UDI (reg h-gpr index) (zext UDI (subword DI newval 0))))
91129 )
92130
93-(define-hardware
94- (name h-spr) (comment "special purpose registers")
95- (attrs VIRTUAL (MACH ORBIS-MACHS))
96- (type register UWI (#x20000))
97- (get (index) (c-call UWI "@cpu@_h_spr_get_raw" index))
98- (set (index newval) (c-call VOID "@cpu@_h_spr_set_raw" index newval))
131+;
132+; Register pairs are offset by 2 for registers r16 and above. This is to
133+; be able to allow registers to be call saved in GCC across function calls.
134+;
135+(define-pmacro (reg-pair-reg-lo index)
136+ (and index (const #x1f))
99137 )
100138
101-(define-pmacro spr-shift 11)
102-(define-pmacro (spr-address spr-group spr-index)
103- (or (sll UWI (enum UWI (.sym "SPR-GROUP-" spr-group)) spr-shift)
104- (enum UWI (.sym "SPR-INDEX-" spr-group "-" spr-index))))
139+(define-pmacro (reg-pair-reg-hi index)
140+ (add (and index (const #x1f))
141+ (if (eq (sra index (const 5))
142+ (const 1))
143+ (const 2)
144+ (const 1)
145+ )
146+ )
147+)
148+
149+;
150+; Hardware: vrtual registers for double precision floating point
151+; operands on 32-bit machines
152+; mapped to GPRs
153+;
154+(define-hardware
155+ (name h-fd32r)
156+ (comment "or32 floating point registers (double, virtual)")
157+ (attrs VIRTUAL (MACH ORFPX64A32-MACHS))
158+ (type register DF (32))
159+ (get (index) (join DF SI
160+ (reg h-gpr (reg-pair-reg-lo index))
161+ (reg h-gpr (reg-pair-reg-hi index))))
162+ (set (index newval)
163+ (sequence ()
164+ (set (reg h-gpr (reg-pair-reg-lo index)) (subword SI newval 0))
165+ (set (reg h-gpr (reg-pair-reg-hi index))
166+ (subword SI newval 1))))
167+)
105168
169+;
170+; Hardware: vrtual 64-bit integer registers for conversions
171+; float64 <-> int64 on 32-bit machines
172+; mapped to GPRs
173+;
106174 (define-hardware
107- (name h-gpr) (comment "general registers")
108- (attrs (MACH ORBIS-MACHS))
109- (type register UWI (32))
110- (indices keyword "" REG-INDICES)
111- (get (index) (reg UWI h-spr (add index (spr-address SYS GPR0))))
112- (set (index newval) (set UWI (reg UWI h-spr (add index (spr-address SYS GPR0))) newval))
113- )
175+ (name h-i64r)
176+ (comment "or32 double word registers (int64, virtual)")
177+ (attrs VIRTUAL (MACH ORFPX64A32-MACHS))
178+ (type register DI (32))
179+ (get (index) (join DI SI
180+ (reg h-gpr (reg-pair-reg-lo index))
181+ (reg h-gpr (reg-pair-reg-hi index))))
182+ (set (index newval)
183+ (sequence ()
184+ (set (reg h-gpr (reg-pair-reg-lo index)) (subword SI newval 0))
185+ (set (reg h-gpr (reg-pair-reg-hi index))
186+ (subword SI newval 1))))
187+)
188+
114189
115190 (define-normal-enum
116191 except-number
--- a/cpu/or1korbis.cpu
+++ b/cpu/or1korbis.cpu
@@ -61,6 +61,7 @@
6161 (dnf f-resv-10-7 "resv-10-7" ((MACH ORBIS-MACHS) RESERVED) 10 7)
6262 (dnf f-resv-10-3 "resv-10-3" ((MACH ORBIS-MACHS) RESERVED) 10 3)
6363 (dnf f-resv-10-1 "resv-10-1" ((MACH ORBIS-MACHS) RESERVED) 10 1)
64+(dnf f-resv-8-1 "resv-8-1" ((MACH ORBIS-MACHS) RESERVED) 8 1)
6465 (dnf f-resv-7-4 "resv-7-4" ((MACH ORBIS-MACHS) RESERVED) 7 4)
6566 (dnf f-resv-5-2 "resv-5-2" ((MACH ORBIS-MACHS) RESERVED) 5 2)
6667
--- a/cpu/or1korfpx.cpu
+++ b/cpu/or1korfpx.cpu
@@ -1,6 +1,7 @@
11 ; OpenRISC 1000 architecture. -*- Scheme -*-
2-; Copyright 2000-2014 Free Software Foundation, Inc.
2+; Copyright 2000-2019 Free Software Foundation, Inc.
33 ; Contributed by Peter Gavin, pgavin@gmail.com
4+; Modified by Andrey Bacherov, avbacherov@opencores.org
45 ;
56 ; This program is free software; you can redistribute it and/or modify
67 ; it under the terms of the GNU General Public License as published by
@@ -58,19 +59,80 @@
5859 )
5960 )
6061
61-(dnop rDSF "destination register (single floating point mode)" () h-fsr f-r1)
62-(dnop rASF "source register A (single floating point mode)" () h-fsr f-r2)
63-(dnop rBSF "source register B (single floating point mode)" () h-fsr f-r3)
62+; Register offset flags, if set offset is 2 otherwise offset is 1
63+(dnf f-rdoff-10-1 "destination register pair offset flag" ((MACH ORFPX64A32-MACHS)) 10 1)
64+(dnf f-raoff-9-1 "source register A pair offset flag" ((MACH ORFPX64A32-MACHS)) 9 1)
65+(dnf f-rboff-8-1 "source register B pair offset flag" ((MACH ORFPX64A32-MACHS)) 8 1)
6466
65-(dnop rDDF "destination register (double floating point mode)" ((MACH ORFPX64-MACHS)) h-fdr f-r1)
66-(dnop rADF "source register A (double floating point mode)" ((MACH ORFPX64-MACHS)) h-fdr f-r1)
67-(dnop rBDF "source register B (double floating point mode)" ((MACH ORFPX64-MACHS)) h-fdr f-r1)
67+(dsh h-roff1 "1-bit offset flag" () (register BI))
68+
69+(dnop rDSF "destination register (single floating point mode)" ((MACH ORFPX32-MACHS)) h-fsr f-r1)
70+(dnop rASF "source register A (single floating point mode)" ((MACH ORFPX32-MACHS)) h-fsr f-r2)
71+(dnop rBSF "source register B (single floating point mode)" ((MACH ORFPX32-MACHS)) h-fsr f-r3)
72+
73+(dnop rDDF "or64 destination register (double floating point mode)" ((MACH ORFPX64-MACHS)) h-fdr f-r1)
74+(dnop rADF "or64 source register A (double floating point mode)" ((MACH ORFPX64-MACHS)) h-fdr f-r2)
75+(dnop rBDF "or64 source register B (double floating point mode)" ((MACH ORFPX64-MACHS)) h-fdr f-r3)
76+
77+(define-pmacro (double-field-and-ops mnemonic reg offbit op-comment)
78+ (begin
79+ (define-multi-ifield
80+ (name (.sym "f-r" (.downcase mnemonic) "d32"))
81+ (comment op-comment)
82+ (attrs (MACH ORFPX64A32-MACHS))
83+ (mode SI)
84+ (subfields reg offbit)
85+ ; From the multi-ifield insert the bits into subfields
86+ (insert (sequence
87+ ()
88+ (set (ifield reg)
89+ (and (ifield (.sym "f-r" (.downcase mnemonic) "d32"))
90+ (const #x1f))
91+ )
92+ (set (ifield offbit)
93+ (and (sra (ifield (.sym "f-r" (.downcase mnemonic) "d32"))
94+ (const 5))
95+ (const 1))
96+ )
97+ )
98+ )
99+ ; Extract the multi-ifield from the subfield bits
100+ (extract
101+ (set (ifield (.sym "f-r" (.downcase mnemonic) "d32"))
102+ (or (ifield reg)
103+ (sll (ifield offbit)
104+ (const 5)))
105+ )
106+ )
107+ )
108+ (define-operand
109+ (name (.sym "r" (.upcase mnemonic) "D32F"))
110+ (comment (.str op-comment " (double floating point pair)"))
111+ (attrs (MACH ORFPX64A32-MACHS))
112+ (type h-fd32r)
113+ (index (.sym "f-r" (.downcase mnemonic) "d32"))
114+ (handlers (parse "regpair") (print "regpair"))
115+ )
116+ (define-operand
117+ (name (.sym "r" (.upcase mnemonic) "DI"))
118+ (comment (.str op-comment " (double integer pair)"))
119+ (attrs (MACH ORFPX64A32-MACHS))
120+ (type h-i64r)
121+ (index (.sym "f-r" (.downcase mnemonic) "d32"))
122+ (handlers (parse "regpair") (print "regpair"))
123+ )
124+ )
125+ )
126+
127+(double-field-and-ops D f-r1 f-rdoff-10-1 "destination register")
128+(double-field-and-ops A f-r2 f-raoff-9-1 "source register A")
129+(double-field-and-ops B f-r3 f-rboff-8-1 "source register B")
68130
69131 (define-pmacro (float-regreg-insn mnemonic)
70132 (begin
71133 (dni (.sym lf- mnemonic -s)
72134 (.str "lf." mnemonic ".s reg/reg/reg")
73- ((MACH ORFPX-MACHS))
135+ ((MACH ORFPX32-MACHS))
74136 (.str "lf." mnemonic ".s $rDSF,$rASF,$rBSF")
75137 (+ OPC_FLOAT rDSF rASF rBSF (f-resv-10-3 0) (.sym OPC_FLOAT_REGREG_ (.upcase mnemonic) _S))
76138 (set SF rDSF (mnemonic SF rASF rBSF))
@@ -84,6 +146,14 @@
84146 (set DF rDDF (mnemonic DF rADF rBDF))
85147 ()
86148 )
149+ (dni (.sym lf- mnemonic -d32)
150+ (.str "lf." mnemonic ".d regpair/regpair/regpair")
151+ ((MACH ORFPX64A32-MACHS))
152+ (.str "lf." mnemonic ".d $rDD32F,$rAD32F,$rBD32F")
153+ (+ OPC_FLOAT rDD32F rAD32F rBD32F (.sym OPC_FLOAT_REGREG_ (.upcase mnemonic) _D))
154+ (set DF rDD32F (mnemonic DF rAD32F rBD32F))
155+ ()
156+ )
87157 )
88158 )
89159
@@ -94,18 +164,28 @@
94164
95165 (dni lf-rem-s
96166 "lf.rem.s reg/reg/reg"
97- ((MACH ORFPX-MACHS))
167+ ((MACH ORFPX32-MACHS))
98168 "lf.rem.s $rDSF,$rASF,$rBSF"
99169 (+ OPC_FLOAT rDSF rASF rBSF (f-resv-10-3 0) OPC_FLOAT_REGREG_REM_S)
100170 (set SF rDSF (rem SF rASF rBSF))
101171 ()
102172 )
173+
103174 (dni lf-rem-d
104175 "lf.rem.d reg/reg/reg"
105176 ((MACH ORFPX64-MACHS))
106177 "lf.rem.d $rDDF,$rADF,$rBDF"
107178 (+ OPC_FLOAT rDDF rADF rBDF (f-resv-10-3 0) OPC_FLOAT_REGREG_REM_D)
108- (set DF rDDF (mod DF rADF rBDF))
179+ (set DF rDDF (rem DF rADF rBDF))
180+ ()
181+ )
182+
183+(dni lf-rem-d32
184+ "lf.rem.d regpair/regpair/regpair"
185+ ((MACH ORFPX64A32-MACHS))
186+ "lf.rem.d $rDD32F,$rAD32F,$rBD32F"
187+ (+ OPC_FLOAT rDD32F rAD32F rBD32F OPC_FLOAT_REGREG_REM_D)
188+ (set DF rDD32F (rem DF rAD32F rBD32F))
109189 ()
110190 )
111191
@@ -120,24 +200,34 @@
120200
121201 (dni lf-itof-s
122202 "lf.itof.s reg/reg"
123- ((MACH ORFPX-MACHS))
203+ ((MACH ORFPX32-MACHS))
124204 "lf.itof.s $rDSF,$rA"
125205 (+ OPC_FLOAT rDSF rA (f-r3 0) (f-resv-10-3 0) OPC_FLOAT_REGREG_ITOF_S)
126206 (set SF rDSF (float SF (get-rounding-mode) (trunc SI rA)))
127207 ()
128208 )
209+
129210 (dni lf-itof-d
130211 "lf.itof.d reg/reg"
131212 ((MACH ORFPX64-MACHS))
132- "lf.itof.d $rDSF,$rA"
133- (+ OPC_FLOAT rDSF rA (f-r3 0) (f-resv-10-3 0) OPC_FLOAT_REGREG_ITOF_D)
213+ "lf.itof.d $rDDF,$rA"
214+ (+ OPC_FLOAT rDDF rA (f-r3 0) (f-resv-10-3 0) OPC_FLOAT_REGREG_ITOF_D)
134215 (set DF rDDF (float DF (get-rounding-mode) rA))
135216 ()
136217 )
137218
219+(dni lf-itof-d32
220+ "lf.itof.d regpair/regpair"
221+ ((MACH ORFPX64A32-MACHS))
222+ "lf.itof.d $rDD32F,$rADI"
223+ (+ OPC_FLOAT rDD32F rADI (f-r3 0) (f-resv-8-1 0) OPC_FLOAT_REGREG_ITOF_D)
224+ (set DF rDD32F (float DF (get-rounding-mode) rADI))
225+ ()
226+ )
227+
138228 (dni lf-ftoi-s
139229 "lf.ftoi.s reg/reg"
140- ((MACH ORFPX-MACHS))
230+ ((MACH ORFPX32-MACHS))
141231 "lf.ftoi.s $rD,$rASF"
142232 (+ OPC_FLOAT rD rASF (f-r3 0) (f-resv-10-3 0) OPC_FLOAT_REGREG_FTOI_S)
143233 (set WI rD (ext WI (fix SI (get-rounding-mode) rASF)))
@@ -149,7 +239,16 @@
149239 ((MACH ORFPX64-MACHS))
150240 "lf.ftoi.d $rD,$rADF"
151241 (+ OPC_FLOAT rD rADF (f-r3 0) (f-resv-10-3 0) OPC_FLOAT_REGREG_FTOI_D)
152- (set DI rD (fix DI (get-rounding-mode) rADF))
242+ (set WI rD (fix WI (get-rounding-mode) rADF))
243+ ()
244+ )
245+
246+(dni lf-ftoi-d32
247+ "lf.ftoi.d regpair/regpair"
248+ ((MACH ORFPX64A32-MACHS))
249+ "lf.ftoi.d $rDDI,$rAD32F"
250+ (+ OPC_FLOAT rDDI rAD32F (f-r3 0) (f-resv-8-1 0) OPC_FLOAT_REGREG_FTOI_D)
251+ (set DI rDDI (fix DI (get-rounding-mode) rAD32F))
153252 ()
154253 )
155254
@@ -157,7 +256,7 @@
157256 (begin
158257 (dni (.sym lf- mnemonic -s)
159258 (.str "lf.sf" mnemonic ".s reg/reg")
160- ((MACH ORFPX-MACHS))
259+ ((MACH ORFPX32-MACHS))
161260 (.str "lf.sf" mnemonic ".s $rASF,$rBSF")
162261 (+ OPC_FLOAT (f-r1 0) rASF rBSF (f-resv-10-3 0) (.sym OPC_FLOAT_REGREG_SF (.upcase mnemonic) _S))
163262 (set BI sys-sr-f (mnemonic SF rASF rBSF))
@@ -166,11 +265,19 @@
166265 (dni (.sym lf- mnemonic -d)
167266 (.str "lf.sf" mnemonic ".d reg/reg")
168267 ((MACH ORFPX64-MACHS))
169- (.str "lf.sf" mnemonic ".d $rASF,$rBSF")
170- (+ OPC_FLOAT (f-r1 0) rASF rBSF (f-resv-10-3 0) (.sym OPC_FLOAT_REGREG_SF (.upcase mnemonic) _D))
268+ (.str "lf.sf" mnemonic ".d $rADF,$rBDF")
269+ (+ OPC_FLOAT (f-r1 0) rADF rBDF (f-resv-10-3 0) (.sym OPC_FLOAT_REGREG_SF (.upcase mnemonic) _D))
171270 (set BI sys-sr-f (mnemonic DF rADF rBDF))
172271 ()
173272 )
273+ (dni (.sym lf- mnemonic -d32)
274+ (.str "lf.sf" mnemonic ".d regpair/regpair")
275+ ((MACH ORFPX64A32-MACHS))
276+ (.str "lf.sf" mnemonic ".d $rAD32F,$rBD32F")
277+ (+ OPC_FLOAT (f-r1 0) rAD32F rBD32F (f-resv-10-1 0) (.sym OPC_FLOAT_REGREG_SF (.upcase mnemonic) _D))
278+ (set BI sys-sr-f (mnemonic DF rAD32F rBD32F))
279+ ()
280+ )
174281 )
175282 )
176283
@@ -183,12 +290,13 @@
183290
184291 (dni lf-madd-s
185292 "lf.madd.s reg/reg/reg"
186- ((MACH ORFPX-MACHS))
293+ ((MACH ORFPX32-MACHS))
187294 "lf.madd.s $rDSF,$rASF,$rBSF"
188295 (+ OPC_FLOAT rDSF rASF rBSF (f-resv-10-3 0) OPC_FLOAT_REGREG_MADD_S)
189296 (set SF rDSF (add SF (mul SF rASF rBSF) rDSF))
190297 ()
191298 )
299+
192300 (dni lf-madd-d
193301 "lf.madd.d reg/reg/reg"
194302 ((MACH ORFPX64-MACHS))
@@ -198,11 +306,20 @@
198306 ()
199307 )
200308
309+(dni lf-madd-d32
310+ "lf.madd.d regpair/regpair/regpair"
311+ ((MACH ORFPX64A32-MACHS))
312+ "lf.madd.d $rDD32F,$rAD32F,$rBD32F"
313+ (+ OPC_FLOAT rDD32F rAD32F rBD32F OPC_FLOAT_REGREG_MADD_D)
314+ (set DF rDD32F (add DF (mul DF rAD32F rBD32F) rDD32F))
315+ ()
316+ )
317+
201318 (define-pmacro (float-cust-insn cust-num)
202319 (begin
203320 (dni (.sym "lf-cust" cust-num "-s")
204321 (.str "lf.cust" cust-num ".s")
205- ((MACH ORFPX-MACHS))
322+ ((MACH ORFPX32-MACHS))
206323 (.str "lf.cust" cust-num ".s $rASF,$rBSF")
207324 (+ OPC_FLOAT (f-resv-25-5 0) rASF rBSF (f-resv-10-3 0) (.sym "OPC_FLOAT_REGREG_CUST" cust-num "_S"))
208325 (nop)
@@ -216,6 +333,14 @@
216333 (nop)
217334 ()
218335 )
336+ (dni (.sym "lf-cust" cust-num "-d32")
337+ (.str "lf.cust" cust-num ".d")
338+ ((MACH ORFPX64A32-MACHS))
339+ (.str "lf.cust" cust-num ".d")
340+ (+ OPC_FLOAT (f-resv-25-5 0) rAD32F rBD32F (f-resv-10-1 0) (.sym "OPC_FLOAT_REGREG_CUST" cust-num "_D"))
341+ (nop)
342+ ()
343+ )
219344 )
220345 )
221346