Projects
openEuler:24.03
ocaml
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 16
View file
_service:tar_scm:ocaml.spec
Changed
@@ -1,19 +1,11 @@ -%ifnarch loongarch64 %global native_compiler 1 -%else -%global native_compiler 0 -%endif -%ifnarch loongarch64 %global natdynlink 1 -%else -%global natdynlink 0 -%endif Name: ocaml Version: 4.14.1 -Release: 1 +Release: 2 Summary: OCaml compiler and programming environment License: LGPL-2.1-only URL: http://www.ocaml.org @@ -22,6 +14,7 @@ Patch0001: 0001-Don-t-add-rpaths-to-libraries.patch Patch0002: 0002-configure-Allow-user-defined-C-compiler-flags.patch Patch0003: 0003-configure-Remove-incorrect-assumption-about-cross-co.patch +Patch0004: 0004-add-loongarch64-native-support.patch BuildRequires: gcc binutils-devel ncurses-devel gdbm-devel gawk perl-interpreter BuildRequires: util-linux chrpath autoconf annobin make @@ -248,6 +241,9 @@ %{_mandir}/man3/* %changelog +* Fri Jun 07 2024 Wenlong Zhang <zhangwenlong@loongson.cn> - 4.14.1-2 +- Add LoongArch native support for ocaml + * Fri Feb 2 2024 Jingwiw <wangjingwei@iscas.ac.cn> - 4.14.1-1 - Upgrade version to 4.14.1
View file
_service:tar_scm:0004-add-loongarch64-native-support.patch
Added
@@ -0,0 +1,4160 @@ +From 0ceb8f2a8457b09a31112046aa30f144f09b153c Mon Sep 17 00:00:00 2001 +From: yala <zhaojunchao@loongson.cn> +Date: Sat, 8 Jul 2023 17:01:21 +0800 +Subject: PATCH add loongarch64 native support + +--- + Makefile | 2 +- + asmcomp/dune | 4 +- + asmcomp/loongarch64/CSE.ml | 38 + + asmcomp/loongarch64/NOTES.md | 13 + + asmcomp/loongarch64/arch.ml | 91 ++ + asmcomp/loongarch64/emit.mlp | 683 +++++++++++++++ + asmcomp/loongarch64/proc.ml | 320 +++++++ + asmcomp/loongarch64/reload.ml | 18 + + asmcomp/loongarch64/scheduling.ml | 21 + + asmcomp/loongarch64/selection.ml | 64 ++ + build-aux/config.guess | 1211 ++++++++++++++------------ + build-aux/config.sub | 124 ++- + configure.ac | 9 +- + runtime/caml/stack.h | 5 + + runtime/loongarch64.S | 443 ++++++++++ + testsuite/tools/asmgen_loongarch64.S | 75 ++ + 16 files changed, 2520 insertions(+), 601 deletions(-) + create mode 100644 asmcomp/loongarch64/CSE.ml + create mode 100644 asmcomp/loongarch64/NOTES.md + create mode 100644 asmcomp/loongarch64/arch.ml + create mode 100644 asmcomp/loongarch64/emit.mlp + create mode 100644 asmcomp/loongarch64/proc.ml + create mode 100644 asmcomp/loongarch64/reload.ml + create mode 100644 asmcomp/loongarch64/scheduling.ml + create mode 100644 asmcomp/loongarch64/selection.ml + create mode 100644 runtime/loongarch64.S + create mode 100644 testsuite/tools/asmgen_loongarch64.S + +diff --git a/Makefile b/Makefile +index 0e92785..d1d9dd7 100644 +--- a/Makefile ++++ b/Makefile +@@ -39,7 +39,7 @@ include stdlib/StdlibModules + + CAMLC=$(BOOT_OCAMLC) -g -nostdlib -I boot -use-prims runtime/primitives + CAMLOPT=$(OCAMLRUN) ./ocamlopt$(EXE) -g -nostdlib -I stdlib -I otherlibs/dynlink +-ARCHES=amd64 i386 arm arm64 power s390x riscv ++ARCHES=amd64 i386 arm arm64 power s390x riscv loongarch64 + INCLUDES=-I utils -I parsing -I typing -I bytecomp -I file_formats \ + -I lambda -I middle_end -I middle_end/closure \ + -I middle_end/flambda -I middle_end/flambda/base_types \ +diff --git a/asmcomp/dune b/asmcomp/dune +index 1a4d561..1817bc4 100644 +--- a/asmcomp/dune ++++ b/asmcomp/dune +@@ -23,6 +23,7 @@ + (glob_files power/*.ml) + (glob_files riscv/*.ml) + (glob_files s390x/*.ml)) ++ (glob_files loongarch64/*.ml) + (action (bash "cp `grep '^ARCH=' %{conf} | cut -d'=' -f2`/*.ml ."))) + + (rule +@@ -35,7 +36,8 @@ + i386/emit.mlp + power/emit.mlp + riscv/emit.mlp +- s390x/emit.mlp) ++ s390x/emit.mlp ++ loongarch64/emit.mlp) + (action + (progn + (with-stdout-to contains-input-name +diff --git a/asmcomp/loongarch64/CSE.ml b/asmcomp/loongarch64/CSE.ml +new file mode 100644 +index 0000000..dc7c66c +--- /dev/null ++++ b/asmcomp/loongarch64/CSE.ml +@@ -0,0 +1,38 @@ ++ ++(**************************************************************************) ++(* *) ++(* OCaml *) ++(* *) ++(* yala <zhaojunchao@loongson.cn> *) ++(* *) ++(* Copyright © 2008-2023 LOONGSON *) ++(* *) ++(* All rights reserved. This file is distributed under the terms of *) ++(* the GNU Lesser General Public License version 2.1, with the *) ++(* special exception on linking described in the file LICENSE. *) ++(* *) ++(**************************************************************************) ++(* CSE for the loongarch *) ++ ++open Arch ++open Mach ++open CSEgen ++ ++class cse = object (_self) ++ ++inherit cse_generic as super ++ ++method! class_of_operation op = ++ match op with ++ | Ispecific(Imultaddf _ | Imultsubf _) -> Op_pure ++ | _ -> super#class_of_operation op ++ ++method! is_cheap_operation op = ++ match op with ++ | Iconst_int n -> n <= 0x7FFF_FFFFn && n >= -0x8000_0000n ++ | _ -> false ++ ++end ++ ++let fundecl f = ++ (new cse)#fundecl f +diff --git a/asmcomp/loongarch64/NOTES.md b/asmcomp/loongarch64/NOTES.md +new file mode 100644 +index 0000000..aacca61 +--- /dev/null ++++ b/asmcomp/loongarch64/NOTES.md +@@ -0,0 +1,13 @@ ++# Supported platforms ++ ++LoongArch in 64-bit mode ++ ++Debian architecture name: `loongarch64` ++ ++# Reference documents ++ ++* Instruction set specification: ++ - https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html ++ ++* ELF ABI specification: ++ - https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html +diff --git a/asmcomp/loongarch64/arch.ml b/asmcomp/loongarch64/arch.ml +new file mode 100644 +index 0000000..8dd4abe +--- /dev/null ++++ b/asmcomp/loongarch64/arch.ml +@@ -0,0 +1,91 @@ ++ ++(**************************************************************************) ++(* *) ++(* OCaml *) ++(* *) ++(* yala <zhaojunchao@loongson.cn> *) ++(* *) ++(* Copyright © 2008-2023 LOONGSON *) ++(* *) ++(* All rights reserved. This file is distributed under the terms of *) ++(* the GNU Lesser General Public License version 2.1, with the *) ++(* special exception on linking described in the file LICENSE. *) ++(* *) ++(**************************************************************************) ++(* Specific operations for the loongarch processor *) ++ ++open Format ++ ++(* Machine-specific command-line options *) ++ ++let command_line_options = ++ ++(* Specific operations *) ++ ++type specific_operation = ++ | Imultaddf of bool (* multiply, optionally negate, and add *) ++ | Imultsubf of bool (* multiply, optionally negate, and subtract *) ++ ++(* Addressing modes *) ++ ++type addressing_mode = ++ | Iindexed of int (* reg + displ *) ++ ++let is_immediate n = ++ (n <= 0x7FF) && (n >= -0x800) ++ ++(* Sizes, endianness *) ++ ++let big_endian = false ++ ++let size_addr = 8 ++let size_int = size_addr ++let size_float = 8 ++ ++let allow_unaligned_access = false ++ ++(* Behavior of division *) ++ ++let division_crashes_on_overflow = false ++ ++(* Operations on addressing modes *) ++ ++let identity_addressing = Iindexed 0 ++ ++let offset_addressing addr delta = ++ match addr with ++ | Iindexed n -> Iindexed(n + delta) ++ ++let num_args_addressing = function ++ | Iindexed _ -> 1 ++
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2