Skip to content

Commit

Permalink
Lagoon jets for IEEE 754 floats. (#638)
Browse files Browse the repository at this point in the history
Pursuant to draft UIP at
https://github.com/urbit/UIPs/blob/sigilante/lagoon-reals/UIPS.

Should be released alongside corresponding Hoon code.
  • Loading branch information
pkova authored Sep 11, 2024
2 parents ea677f3 + 3d462d3 commit 5f47598
Show file tree
Hide file tree
Showing 11 changed files with 3,585 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
run: |
case "${{ matrix.target }}" in
"linux-aarch64")
sudo apt-get -y install autoconf-archive
sudo apt-get -y install autoconf-archive pkg-config
bazel run //bazel/toolchain:aarch64-linux-musl-gcc
;;
"linux-x86_64")
Expand Down
6 changes: 6 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
###############################################################################
# Bazel now uses Bzlmod by default to manage external dependencies.
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################
9 changes: 9 additions & 0 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,15 @@ versioned_http_archive(
version = "2.14",
)

versioned_http_archive(
name = "softblas",
build_file = "//bazel/third_party/softblas:softblas.BUILD",
strip_prefix = "SoftBLAS-{version}",
# sha256 = "",
url = "https://github.com/urbit/SoftBLAS/archive/{version}.tar.gz",
version = "cbffb33f19ea02f9ffbd184d445123c57929ec53",
)

versioned_http_archive(
name = "softfloat",
build_file = "//bazel/third_party/softfloat:softfloat.BUILD",
Expand Down
Empty file.
117 changes: 117 additions & 0 deletions bazel/third_party/softblas/softblas.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# FILEPATH: /home/neal/lagoon/vere/bazel/third_party/softblas/softblas.BUILD

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

cc_library(
name = "softblas",
visibility = ["//visibility:public"],
deps = select({
"@platforms//cpu:aarch64": [":softblas_aarch64"],
"@platforms//cpu:x86_64": [":softblas_x86_64"],
"//conditions:default": [],
}),
)

cc_library(
name = "softblas_aarch64",
visibility = ["//visibility:public"],
hdrs = ["include/softblas.h"],
includes = ["include"],
srcs = [
"include/softblas.h",
"src/softblas_state.c",
"src/blas/level1/sasum.c",
"src/blas/level1/dasum.c",
"src/blas/level1/hasum.c",
"src/blas/level1/qasum.c",
"src/blas/level1/saxpy.c",
"src/blas/level1/daxpy.c",
"src/blas/level1/haxpy.c",
"src/blas/level1/qaxpy.c",
"src/blas/level1/scopy.c",
"src/blas/level1/dcopy.c",
"src/blas/level1/hcopy.c",
"src/blas/level1/qcopy.c",
"src/blas/level1/sdot.c",
"src/blas/level1/ddot.c",
"src/blas/level1/hdot.c",
"src/blas/level1/qdot.c",
"src/blas/level1/snrm2.c",
"src/blas/level1/dnrm2.c",
"src/blas/level1/hnrm2.c",
"src/blas/level1/qnrm2.c",
"src/blas/level1/sscal.c",
"src/blas/level1/dscal.c",
"src/blas/level1/hscal.c",
"src/blas/level1/qscal.c",
"src/blas/level1/sswap.c",
"src/blas/level1/dswap.c",
"src/blas/level1/hswap.c",
"src/blas/level1/qswap.c",
"src/blas/level1/isamax.c",
"src/blas/level1/idamax.c",
"src/blas/level1/ihamax.c",
"src/blas/level1/iqamax.c",
"src/blas/level2/sgemv.c",
"src/blas/level2/dgemv.c",
"src/blas/level2/hgemv.c",
"src/blas/level2/qgemv.c",
"src/blas/level3/sgemm.c",
"src/blas/level3/dgemm.c",
"src/blas/level3/hgemm.c",
"src/blas/level3/qgemm.c"
],
deps = ["@softfloat"],
)

cc_library(
name = "softblas_x86_64",
visibility = ["//visibility:public"],
hdrs = ["include/softblas.h"],
includes = ["include"],
srcs = [
"include/softblas.h",
"src/softblas_state.c",
"src/blas/level1/sasum.c",
"src/blas/level1/dasum.c",
"src/blas/level1/hasum.c",
"src/blas/level1/qasum.c",
"src/blas/level1/saxpy.c",
"src/blas/level1/daxpy.c",
"src/blas/level1/haxpy.c",
"src/blas/level1/qaxpy.c",
"src/blas/level1/scopy.c",
"src/blas/level1/dcopy.c",
"src/blas/level1/hcopy.c",
"src/blas/level1/qcopy.c",
"src/blas/level1/sdot.c",
"src/blas/level1/ddot.c",
"src/blas/level1/hdot.c",
"src/blas/level1/qdot.c",
"src/blas/level1/snrm2.c",
"src/blas/level1/dnrm2.c",
"src/blas/level1/hnrm2.c",
"src/blas/level1/qnrm2.c",
"src/blas/level1/sscal.c",
"src/blas/level1/dscal.c",
"src/blas/level1/hscal.c",
"src/blas/level1/qscal.c",
"src/blas/level1/sswap.c",
"src/blas/level1/dswap.c",
"src/blas/level1/hswap.c",
"src/blas/level1/qswap.c",
"src/blas/level1/isamax.c",
"src/blas/level1/idamax.c",
"src/blas/level1/ihamax.c",
"src/blas/level1/iqamax.c",
"src/blas/level2/sgemv.c",
"src/blas/level2/dgemv.c",
"src/blas/level2/hgemv.c",
"src/blas/level2/qgemv.c",
"src/blas/level3/sgemm.c",
"src/blas/level3/dgemm.c",
"src/blas/level3/hgemm.c",
"src/blas/level3/qgemm.c"
],
deps = ["@softfloat"],
)
7 changes: 7 additions & 0 deletions pkg/c3/motes.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@
# define c3__corp c3_s4('c','o','r','p')
# define c3__corp c3_s4('c','o','r','p')
# define c3__cow c3_s3('c','o','w')
# define c3__cplx c3_s3('c','p','l','x')
# define c3__cpu c3_s3('c','p','u')
# define c3__crad c3_s4('c','r','a','d')
# define c3__cram c3_s4('c','r','a','m')
Expand Down Expand Up @@ -430,6 +431,7 @@
# define c3__fit c3_s3('f','i','t')
# define c3__fits c3_s4('f','i','t','s')
# define c3__fix c3_s3('f','i','x')
# define c3__fixp c3_s3('f','i','x','p')
# define c3__fl c3_s2('f','l')
# define c3__flac c3_s4('f','l','a','c')
# define c3__flag c3_s4('f','l','a','g')
Expand Down Expand Up @@ -602,6 +604,7 @@
# define c3__info c3_s4('i','n','f','o')
# define c3__init c3_s4('i','n','i','t')
# define c3__ins c3_s3('i','n','s')
# define c3__int2 c3_s4('i','n','t','2')
# define c3__into c3_s4('i','n','t','o')
# define c3__intr c3_s4('i','n','t','r')
# define c3__inuk c3_s4('i','n','u','k')
Expand All @@ -610,6 +613,7 @@
# define c3__is c3_s2('i','s')
# define c3__item c3_s4('i','t','e','m')
# define c3__ix c3_s2('i','x')
# define c3__i754 c3_s4('i','7','5','4')
# define c3__j c3_s1('j')
# define c3__jack c3_s4('j','a','c','k')
# define c3__jam c3_s3('j','a','m')
Expand Down Expand Up @@ -971,6 +975,7 @@
# define c3__rasp c3_s4('r','a','s','p')
# define c3__raw c3_s3('r','a','w')
# define c3__read c3_s4('r','e','a','d')
# define c3__real c3_s4('r','e','a','l')
# define c3__reck c3_s4('r','e','c','k')
# define c3__reef c3_s4('r','e','e','f')
# define c3__resd c3_s4('r','e','s','d')
Expand Down Expand Up @@ -1232,11 +1237,13 @@
# define c3__ubin c3_s4('u','b','i','n')
# define c3__ubit c3_s4('u','b','i','t')
# define c3__ud c3_s2('u','d')
# define c3__uint c3_s4('u','i','n','t')
# define c3__ulib c3_s4('u','l','i','b')
# define c3__un c3_s2('u','n')
# define c3__uniq c3_s4('u','n','i','q')
# define c3__unix c3_s4('u','n','i','x')
# define c3__unt c3_s3('u','n','t')
# define c3__unum c3_s3('u','n','u','m')
# define c3__up c3_s2('u','p')
# define c3__url c3_s3('u','r','l')
# define c3__urth c3_s4('u','r','t','h')
Expand Down
1 change: 1 addition & 0 deletions pkg/noun/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ vere_library(
"@openssl",
"@pdjson",
"@sigsegv",
"@softblas",
"@softfloat",
"@urcrypt",
"@zlib",
Expand Down
Loading

0 comments on commit 5f47598

Please sign in to comment.