mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
Merge remote-tracking branch 'origin/trunk' into specialize-lowlevel
This commit is contained in:
commit
564aacc1fd
19 changed files with 575 additions and 650 deletions
243
Cargo.lock
generated
243
Cargo.lock
generated
|
@ -121,11 +121,11 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ash"
|
name = "ash"
|
||||||
version = "0.31.0"
|
version = "0.32.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c69a8137596e84c22d57f3da1b5de1d4230b1742a710091c85f4d7ce50f00f38"
|
checksum = "06063a002a77d2734631db74e8f4ce7148b77fe522e6bca46f2ae7774fd48112"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libloading 0.6.7",
|
"libloading 0.7.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -263,7 +263,7 @@ checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -371,7 +371,7 @@ dependencies = [
|
||||||
"proc-macro-error",
|
"proc-macro-error",
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -424,6 +424,16 @@ dependencies = [
|
||||||
"objc",
|
"objc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "codespan-reporting"
|
||||||
|
version = "0.11.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e"
|
||||||
|
dependencies = [
|
||||||
|
"termcolor",
|
||||||
|
"unicode-width",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "colored"
|
name = "colored"
|
||||||
version = "2.0.0"
|
version = "2.0.0"
|
||||||
|
@ -758,17 +768,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d"
|
checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "d3d12"
|
name = "d3d12"
|
||||||
version = "0.3.2"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d0a60cceb22c7c53035f8980524fdc7f17cf49681a3c154e6757d30afbec6ec4"
|
checksum = "091ed1b25fe47c7ff129fc440c23650b6114f36aa00bc7212cc8041879294428"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"libloading 0.6.7",
|
"libloading 0.7.0",
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -793,7 +803,7 @@ dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"strsim",
|
"strsim",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -804,7 +814,7 @@ checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling_core",
|
"darling_core",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -815,7 +825,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1071,7 +1081,7 @@ dependencies = [
|
||||||
"proc-macro-hack",
|
"proc-macro-hack",
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1148,9 +1158,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gfx-auxil"
|
name = "gfx-auxil"
|
||||||
version = "0.8.0"
|
version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e7b33ecf067f2117668d91c9b0f2e5f223ebd1ffec314caa2f3de27bb580186d"
|
checksum = "9ccf8711c9994dfa34337466bee3ae1462e172874c432ce4eb120ab2e98d39cf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fxhash",
|
"fxhash",
|
||||||
"gfx-hal",
|
"gfx-hal",
|
||||||
|
@ -1159,15 +1169,15 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gfx-backend-dx11"
|
name = "gfx-backend-dx11"
|
||||||
version = "0.7.0"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f851d03c2e8f117e3702bf41201a4fafa447d5cb1276d5375870ae7573d069dd"
|
checksum = "6f839f27f8c8a6dc553ccca7f5b35a42009432bc25db9688bba7061cd394161f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"gfx-auxil",
|
"gfx-auxil",
|
||||||
"gfx-hal",
|
"gfx-hal",
|
||||||
"libloading 0.6.7",
|
"libloading 0.7.0",
|
||||||
"log",
|
"log",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"range-alloc",
|
"range-alloc",
|
||||||
|
@ -1181,9 +1191,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gfx-backend-dx12"
|
name = "gfx-backend-dx12"
|
||||||
version = "0.7.0"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "36dc6ba2b7647e2c2b27b8f74ff5ccdd53c703776588eee5b1de515fdcbd6bc9"
|
checksum = "3937738b0da5839bba4e33980d29f9a06dbce184d04a3a08c9a949e7953700e3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bit-set",
|
"bit-set",
|
||||||
|
@ -1197,14 +1207,15 @@ dependencies = [
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"spirv_cross",
|
"spirv_cross",
|
||||||
|
"thunderdome",
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gfx-backend-empty"
|
name = "gfx-backend-empty"
|
||||||
version = "0.7.0"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9f07ef26a65954cfdd7b4c587f485100d1bb3b0bd6a51b02d817d6c87cca7a91"
|
checksum = "2ac55ada4bfcd35479b3421eea324d36d7da5f724e2f66ecb36d4efdb7041a5e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gfx-hal",
|
"gfx-hal",
|
||||||
"log",
|
"log",
|
||||||
|
@ -1213,32 +1224,31 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gfx-backend-gl"
|
name = "gfx-backend-gl"
|
||||||
version = "0.7.1"
|
version = "0.8.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c6717c50ab601efe4a669bfb44db615e3888695ac8263222aeaa702642b9fbc2"
|
checksum = "0caa03d6e0b7b4f202aea1f20c3f3288cfa06d92d24cea9d69c9a7627967244a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"gfx-auxil",
|
"fxhash",
|
||||||
"gfx-hal",
|
"gfx-hal",
|
||||||
"glow",
|
"glow",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"khronos-egl",
|
"khronos-egl",
|
||||||
"libloading 0.6.7",
|
"libloading 0.7.0",
|
||||||
"log",
|
"log",
|
||||||
"naga",
|
"naga",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"spirv_cross",
|
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"web-sys",
|
"web-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gfx-backend-metal"
|
name = "gfx-backend-metal"
|
||||||
version = "0.7.0"
|
version = "0.8.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8dc54b456ece69ef49f8893269ebf24ac70969ed34ba2719c3f3abcc8fbff14e"
|
checksum = "340895ad544ba46433acb3bdabece0ef16f2dbedc030adbd7c9eaf2839fbed41"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
@ -1246,24 +1256,24 @@ dependencies = [
|
||||||
"cocoa-foundation",
|
"cocoa-foundation",
|
||||||
"copyless",
|
"copyless",
|
||||||
"foreign-types",
|
"foreign-types",
|
||||||
"gfx-auxil",
|
"fxhash",
|
||||||
"gfx-hal",
|
"gfx-hal",
|
||||||
"log",
|
"log",
|
||||||
"metal",
|
"metal",
|
||||||
"naga",
|
"naga",
|
||||||
"objc",
|
"objc",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
|
"profiling",
|
||||||
"range-alloc",
|
"range-alloc",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"spirv_cross",
|
|
||||||
"storage-map",
|
"storage-map",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gfx-backend-vulkan"
|
name = "gfx-backend-vulkan"
|
||||||
version = "0.7.0"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dabe88b1a5c91e0f969b441cc57e70364858066e4ba937deeb62065654ef9bd9"
|
checksum = "a353fc6fdb42ec646de49bbb74e4870e37a7e680caf33f3ac0615c30b1146d94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"ash",
|
"ash",
|
||||||
|
@ -1282,9 +1292,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gfx-hal"
|
name = "gfx-hal"
|
||||||
version = "0.7.0"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c1d9cc8d3b573dda62d0baca4f02e0209786e22c562caff001d77c389008781d"
|
checksum = "6d285bfd566f6b9134af908446ca350c0a1047495dfb9bbd826e701e8ee1d259"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"naga",
|
"naga",
|
||||||
|
@ -1300,9 +1310,9 @@ checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glow"
|
name = "glow"
|
||||||
version = "0.7.2"
|
version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "072136d2c3783f3a92f131acb227bc806d3886278e2a4dc1e9990ec89ef9e70b"
|
checksum = "4b80b98efaa8a34fce11d60dd2ce2760d5d83c373cbcc73bb87c2a3a84a54108"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"slotmap",
|
"slotmap",
|
||||||
|
@ -1351,13 +1361,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gpu-alloc"
|
name = "gpu-alloc"
|
||||||
version = "0.3.0"
|
version = "0.4.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1e7724b9aef57ea36d70faf54e0ee6265f86e41de16bed8333efdeab5b00e16b"
|
checksum = "bc76088804bb65a6f3b880bea9306fdaeffb25ebb453105fafa691282ee9fdba"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"gpu-alloc-types",
|
"gpu-alloc-types",
|
||||||
"tracing",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1378,7 +1387,6 @@ dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"gpu-descriptor-types",
|
"gpu-descriptor-types",
|
||||||
"hashbrown 0.9.1",
|
"hashbrown 0.9.1",
|
||||||
"tracing",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1539,7 +1547,7 @@ dependencies = [
|
||||||
"proc-macro-hack",
|
"proc-macro-hack",
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
"unindent",
|
"unindent",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1564,7 +1572,7 @@ source = "git+https://github.com/rtfeldman/inkwell?tag=llvm10-0.release4#9ae45f0
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1638,9 +1646,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js-sys"
|
name = "js-sys"
|
||||||
version = "0.3.46"
|
version = "0.3.51"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cf3d7383929f7c9c7c2d0fa596f325832df98c3704f2c60553080f7127a58175"
|
checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
@ -1657,12 +1665,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "khronos-egl"
|
name = "khronos-egl"
|
||||||
version = "3.0.2"
|
version = "4.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b19cc4a81304db2a0ad69740e83cdc3a9364e3f9bd6d88a87288a4c2deec927b"
|
checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"libloading 0.6.7",
|
"libloading 0.7.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1802,9 +1810,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "metal"
|
name = "metal"
|
||||||
version = "0.21.0"
|
version = "0.22.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4598d719460ade24c7d91f335daf055bf2a7eec030728ce751814c50cdd6a26c"
|
checksum = "1c12e48c737ee9a55e8bb2352bcde588f79ae308d3529ee888f7cc0f469b5777"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"block",
|
"block",
|
||||||
|
@ -1869,12 +1877,13 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "naga"
|
name = "naga"
|
||||||
version = "0.3.2"
|
version = "0.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "05089b2acdf0e6a962cdbf5e328402345a27f59fcde1a59fe97a73e8149d416f"
|
checksum = "f470a97eafcdd0dbea43d5e1a8ef3557aa31f49ba643d9430dbbf911c162b24c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bit-set",
|
"bit-set",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
"codespan-reporting",
|
||||||
"fxhash",
|
"fxhash",
|
||||||
"log",
|
"log",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
|
@ -1919,7 +1928,7 @@ dependencies = [
|
||||||
"proc-macro-crate",
|
"proc-macro-crate",
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2030,7 +2039,7 @@ dependencies = [
|
||||||
"proc-macro-crate",
|
"proc-macro-crate",
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2175,7 +2184,7 @@ checksum = "0b4b5f600e60dd3a147fb57b4547033d382d1979eb087af310e91cb45a63b1f4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2241,7 +2250,7 @@ dependencies = [
|
||||||
"pest_meta",
|
"pest_meta",
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2401,7 +2410,7 @@ dependencies = [
|
||||||
"proc-macro-error-attr",
|
"proc-macro-error-attr",
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
"version_check",
|
"version_check",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2413,7 +2422,7 @@ checksum = "8a5b4b77fdb63c1eca72173d68d24501c54ab1269409f6b672c85deb18af69de"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
"syn-mid",
|
"syn-mid",
|
||||||
"version_check",
|
"version_check",
|
||||||
]
|
]
|
||||||
|
@ -2448,6 +2457,12 @@ dependencies = [
|
||||||
"unicode-xid 0.2.1",
|
"unicode-xid 0.2.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "profiling"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c3a66d5e88679f2720126c11ee29da07a08f094eac52306b066edd7d393752d6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pulldown-cmark"
|
name = "pulldown-cmark"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
|
@ -2501,7 +2516,7 @@ checksum = "b22a693222d716a9587786f37ac3f6b4faedb5b80c23914e7303ff5a1d8016e9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3405,7 +3420,7 @@ version = "0.3.1"
|
||||||
source = "git+https://github.com/rtfeldman/rustyline?tag=prompt-fix#a6b8a20d2bf5c3793d7367848be2f4afec2f0d99"
|
source = "git+https://github.com/rtfeldman/rustyline?tag=prompt-fix#a6b8a20d2bf5c3793d7367848be2f4afec2f0d99"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3489,7 +3504,7 @@ checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3534,7 +3549,7 @@ checksum = "b2acd6defeddb41eb60bb468f8825d0cfd0c2a76bc03bfd235b6a1dc4f6a1ad5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3641,7 +3656,7 @@ checksum = "1508efa03c362e23817f96cde18abed596a25219a8b2c66e8db33c03543d315b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3708,9 +3723,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.65"
|
version = "1.0.72"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f3a1d708c221c5a612956ef9f75b37e454e88d1f7b899fbd3a18d4252012d663"
|
checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
|
@ -3725,7 +3740,7 @@ checksum = "baa8e7560a164edb1621a55d18a0c59abf49d360f47aa7b821061dd7eea7fac9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3736,7 +3751,7 @@ checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
"unicode-xid 0.2.1",
|
"unicode-xid 0.2.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -3832,7 +3847,7 @@ checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3848,9 +3863,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thunderdome"
|
name = "thunderdome"
|
||||||
version = "0.3.0"
|
version = "0.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7572415bd688d401c52f6e36f4c8e805b9ae1622619303b9fa835d531db0acae"
|
checksum = "87b4947742c93ece24a0032141d9caa3d853752e694a57e35029dd2bd08673e0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tinytemplate"
|
name = "tinytemplate"
|
||||||
|
@ -3885,38 +3900,6 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tracing"
|
|
||||||
version = "0.1.25"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if 1.0.0",
|
|
||||||
"pin-project-lite 0.2.6",
|
|
||||||
"tracing-attributes",
|
|
||||||
"tracing-core",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tracing-attributes"
|
|
||||||
version = "0.1.15"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2 1.0.26",
|
|
||||||
"quote 1.0.9",
|
|
||||||
"syn 1.0.65",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "tracing-core"
|
|
||||||
version = "0.1.17"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f"
|
|
||||||
dependencies = [
|
|
||||||
"lazy_static",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ttf-parser"
|
name = "ttf-parser"
|
||||||
version = "0.6.2"
|
version = "0.6.2"
|
||||||
|
@ -4087,9 +4070,9 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen"
|
name = "wasm-bindgen"
|
||||||
version = "0.2.69"
|
version = "0.2.74"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3cd364751395ca0f68cafb17666eee36b63077fb5ecd972bbcd74c90c4bf736e"
|
checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"wasm-bindgen-macro",
|
"wasm-bindgen-macro",
|
||||||
|
@ -4097,24 +4080,24 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-backend"
|
name = "wasm-bindgen-backend"
|
||||||
version = "0.2.69"
|
version = "0.2.74"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1114f89ab1f4106e5b55e688b828c0ab0ea593a1ea7c094b141b14cbaaec2d62"
|
checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bumpalo",
|
"bumpalo",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"log",
|
"log",
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-futures"
|
name = "wasm-bindgen-futures"
|
||||||
version = "0.4.19"
|
version = "0.4.24"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1fe9756085a84584ee9457a002b7cdfe0bfff169f45d2591d8be1345a6780e35"
|
checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
|
@ -4124,9 +4107,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro"
|
name = "wasm-bindgen-macro"
|
||||||
version = "0.2.69"
|
version = "0.2.74"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7a6ac8995ead1f084a8dea1e65f194d0973800c7f571f6edd70adf06ecf77084"
|
checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"wasm-bindgen-macro-support",
|
"wasm-bindgen-macro-support",
|
||||||
|
@ -4134,22 +4117,22 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro-support"
|
name = "wasm-bindgen-macro-support"
|
||||||
version = "0.2.69"
|
version = "0.2.74"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b5a48c72f299d80557c7c62e37e7225369ecc0c963964059509fbafe917c7549"
|
checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
"wasm-bindgen-backend",
|
"wasm-bindgen-backend",
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-shared"
|
name = "wasm-bindgen-shared"
|
||||||
version = "0.2.69"
|
version = "0.2.74"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7e7811dd7f9398f14cc76efd356f98f03aa30419dea46aa810d71e819fc97158"
|
checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasmparser"
|
name = "wasmparser"
|
||||||
|
@ -4232,9 +4215,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "web-sys"
|
name = "web-sys"
|
||||||
version = "0.3.46"
|
version = "0.3.50"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "222b1ef9334f92a21d3fb53dc3fd80f30836959a90f9274a626d7e06315ba3c3"
|
checksum = "a905d57e488fec8861446d3393670fb50d27a262344013181c2cdf9fff5481be"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
|
@ -4242,18 +4225,17 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu"
|
name = "wgpu"
|
||||||
version = "0.7.1"
|
version = "0.8.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "79a0a0a63fac9492cfaf6e7e4bdf9729c128f1e94124b9e4cbc4004b8cb6d1d8"
|
checksum = "215fd50e66f794bd16683e7e0e0b9b53be265eb10fdf02276caf5de3e5743fcf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
|
"log",
|
||||||
"naga",
|
"naga",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"syn 1.0.65",
|
|
||||||
"tracing",
|
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"wasm-bindgen-futures",
|
"wasm-bindgen-futures",
|
||||||
"web-sys",
|
"web-sys",
|
||||||
|
@ -4263,9 +4245,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu-core"
|
name = "wgpu-core"
|
||||||
version = "0.7.1"
|
version = "0.8.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c89fa2cc5d72236461ac09c5be967012663e29cb62f1a972654cbf35e49dffa8"
|
checksum = "1d56c368fc0e6f3927c711d2b55a51ad4321218efc0239c4acf69e456ab70399"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
@ -4281,29 +4263,30 @@ dependencies = [
|
||||||
"gfx-hal",
|
"gfx-hal",
|
||||||
"gpu-alloc",
|
"gpu-alloc",
|
||||||
"gpu-descriptor",
|
"gpu-descriptor",
|
||||||
|
"log",
|
||||||
"naga",
|
"naga",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
|
"profiling",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tracing",
|
|
||||||
"wgpu-types",
|
"wgpu-types",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu-types"
|
name = "wgpu-types"
|
||||||
version = "0.7.0"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "72fa9ba80626278fd87351555c363378d08122d7601e58319be3d6fa85a87747"
|
checksum = "aa248d90c8e6832269b8955bf800e8241f942c25e18a235b7752226804d21556"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu_glyph"
|
name = "wgpu_glyph"
|
||||||
version = "0.11.0"
|
version = "0.12.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "354c1f79e09923724a6006a6953c3946522b84f7a9ec202b7e8001f274fd4bd5"
|
checksum = "634570b440f4c24c2e6049ed01ec832c23d338dea3eca654d5760838017a1c8b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"glyph_brush",
|
"glyph_brush",
|
||||||
|
@ -4497,6 +4480,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d498dbd1fd7beb83c86709ae1c33ca50942889473473d287d56ce4770a18edfb"
|
checksum = "d498dbd1fd7beb83c86709ae1c33ca50942889473473d287d56ce4770a18edfb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.26",
|
"proc-macro2 1.0.26",
|
||||||
"syn 1.0.65",
|
"syn 1.0.72",
|
||||||
"synstructure",
|
"synstructure",
|
||||||
]
|
]
|
||||||
|
|
|
@ -250,6 +250,16 @@ impl Assembler<AArch64GeneralReg, AArch64FloatReg> for AArch64Assembler {
|
||||||
unimplemented!("abs_reg64_reg64 is not yet implement for AArch64");
|
unimplemented!("abs_reg64_reg64 is not yet implement for AArch64");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn abs_freg64_freg64(
|
||||||
|
_buf: &mut Vec<'_, u8>,
|
||||||
|
_relocs: &mut Vec<'_, Relocation>,
|
||||||
|
_dst: AArch64FloatReg,
|
||||||
|
_src: AArch64FloatReg,
|
||||||
|
) {
|
||||||
|
unimplemented!("abs_reg64_reg64 is not yet implement for AArch64");
|
||||||
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn add_reg64_reg64_imm32(
|
fn add_reg64_reg64_imm32(
|
||||||
buf: &mut Vec<'_, u8>,
|
buf: &mut Vec<'_, u8>,
|
||||||
|
@ -291,6 +301,16 @@ impl Assembler<AArch64GeneralReg, AArch64FloatReg> for AArch64Assembler {
|
||||||
unimplemented!("calling functions literal not yet implemented for AArch64");
|
unimplemented!("calling functions literal not yet implemented for AArch64");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn imul_reg64_reg64_reg64(
|
||||||
|
_buf: &mut Vec<'_, u8>,
|
||||||
|
_dst: AArch64GeneralReg,
|
||||||
|
_src1: AArch64GeneralReg,
|
||||||
|
_src2: AArch64GeneralReg,
|
||||||
|
) {
|
||||||
|
unimplemented!("register multiplication not implemented yet for AArch64");
|
||||||
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn jmp_imm32(_buf: &mut Vec<'_, u8>, _offset: i32) -> usize {
|
fn jmp_imm32(_buf: &mut Vec<'_, u8>, _offset: i32) -> usize {
|
||||||
unimplemented!("jump instructions not yet implemented for AArch64");
|
unimplemented!("jump instructions not yet implemented for AArch64");
|
||||||
|
|
|
@ -71,6 +71,12 @@ pub trait CallConv<GeneralReg: RegTrait, FloatReg: RegTrait> {
|
||||||
/// dst should always come before sources.
|
/// dst should always come before sources.
|
||||||
pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait> {
|
pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait> {
|
||||||
fn abs_reg64_reg64(buf: &mut Vec<'_, u8>, dst: GeneralReg, src: GeneralReg);
|
fn abs_reg64_reg64(buf: &mut Vec<'_, u8>, dst: GeneralReg, src: GeneralReg);
|
||||||
|
fn abs_freg64_freg64(
|
||||||
|
buf: &mut Vec<'_, u8>,
|
||||||
|
relocs: &mut Vec<'_, Relocation>,
|
||||||
|
dst: FloatReg,
|
||||||
|
src: FloatReg,
|
||||||
|
);
|
||||||
|
|
||||||
fn add_reg64_reg64_imm32(buf: &mut Vec<'_, u8>, dst: GeneralReg, src1: GeneralReg, imm32: i32);
|
fn add_reg64_reg64_imm32(buf: &mut Vec<'_, u8>, dst: GeneralReg, src1: GeneralReg, imm32: i32);
|
||||||
fn add_freg64_freg64_freg64(
|
fn add_freg64_freg64_freg64(
|
||||||
|
@ -124,6 +130,13 @@ pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait> {
|
||||||
fn mov_stack32_freg64(buf: &mut Vec<'_, u8>, offset: i32, src: FloatReg);
|
fn mov_stack32_freg64(buf: &mut Vec<'_, u8>, offset: i32, src: FloatReg);
|
||||||
fn mov_stack32_reg64(buf: &mut Vec<'_, u8>, offset: i32, src: GeneralReg);
|
fn mov_stack32_reg64(buf: &mut Vec<'_, u8>, offset: i32, src: GeneralReg);
|
||||||
|
|
||||||
|
fn imul_reg64_reg64_reg64(
|
||||||
|
buf: &mut Vec<'_, u8>,
|
||||||
|
dst: GeneralReg,
|
||||||
|
src1: GeneralReg,
|
||||||
|
src2: GeneralReg,
|
||||||
|
);
|
||||||
|
|
||||||
fn sub_reg64_reg64_imm32(buf: &mut Vec<'_, u8>, dst: GeneralReg, src1: GeneralReg, imm32: i32);
|
fn sub_reg64_reg64_imm32(buf: &mut Vec<'_, u8>, dst: GeneralReg, src1: GeneralReg, imm32: i32);
|
||||||
fn sub_reg64_reg64_reg64(
|
fn sub_reg64_reg64_reg64(
|
||||||
buf: &mut Vec<'_, u8>,
|
buf: &mut Vec<'_, u8>,
|
||||||
|
@ -468,6 +481,15 @@ impl<
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn build_num_abs_f64(&mut self, dst: &Symbol, src: &Symbol) -> Result<(), String> {
|
||||||
|
let dst_reg = self.claim_float_reg(dst)?;
|
||||||
|
let src_reg = self.load_to_float_reg(src)?;
|
||||||
|
|
||||||
|
ASM::abs_freg64_freg64(&mut self.buf, &mut self.relocs, dst_reg, src_reg);
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
fn build_num_add_i64(
|
fn build_num_add_i64(
|
||||||
&mut self,
|
&mut self,
|
||||||
dst: &Symbol,
|
dst: &Symbol,
|
||||||
|
@ -494,6 +516,19 @@ impl<
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn build_num_mul_i64(
|
||||||
|
&mut self,
|
||||||
|
dst: &Symbol,
|
||||||
|
src1: &Symbol,
|
||||||
|
src2: &Symbol,
|
||||||
|
) -> Result<(), String> {
|
||||||
|
let dst_reg = self.claim_general_reg(dst)?;
|
||||||
|
let src1_reg = self.load_to_general_reg(src1)?;
|
||||||
|
let src2_reg = self.load_to_general_reg(src2)?;
|
||||||
|
ASM::imul_reg64_reg64_reg64(&mut self.buf, dst_reg, src1_reg, src2_reg);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
fn build_num_sub_i64(
|
fn build_num_sub_i64(
|
||||||
&mut self,
|
&mut self,
|
||||||
dst: &Symbol,
|
dst: &Symbol,
|
||||||
|
|
|
@ -740,6 +740,24 @@ impl Assembler<X86_64GeneralReg, X86_64FloatReg> for X86_64Assembler {
|
||||||
cmovl_reg64_reg64(buf, dst, src);
|
cmovl_reg64_reg64(buf, dst, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn abs_freg64_freg64(
|
||||||
|
buf: &mut Vec<'_, u8>,
|
||||||
|
relocs: &mut Vec<'_, Relocation>,
|
||||||
|
dst: X86_64FloatReg,
|
||||||
|
src: X86_64FloatReg,
|
||||||
|
) {
|
||||||
|
movsd_freg64_rip_offset32(buf, dst, 0);
|
||||||
|
|
||||||
|
// TODO: make sure this constant only loads once instead of every call to abs
|
||||||
|
relocs.push(Relocation::LocalData {
|
||||||
|
offset: buf.len() as u64 - 4,
|
||||||
|
data: 0x7fffffffffffffffu64.to_le_bytes().to_vec(),
|
||||||
|
});
|
||||||
|
|
||||||
|
andpd_freg64_freg64(buf, dst, src);
|
||||||
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn add_reg64_reg64_imm32(
|
fn add_reg64_reg64_imm32(
|
||||||
buf: &mut Vec<'_, u8>,
|
buf: &mut Vec<'_, u8>,
|
||||||
|
@ -796,6 +814,21 @@ impl Assembler<X86_64GeneralReg, X86_64FloatReg> for X86_64Assembler {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn imul_reg64_reg64_reg64(
|
||||||
|
buf: &mut Vec<'_, u8>,
|
||||||
|
dst: X86_64GeneralReg,
|
||||||
|
src1: X86_64GeneralReg,
|
||||||
|
src2: X86_64GeneralReg,
|
||||||
|
) {
|
||||||
|
if dst == src1 {
|
||||||
|
imul_reg64_reg64(buf, dst, src2);
|
||||||
|
} else {
|
||||||
|
mov_reg64_reg64(buf, dst, src1);
|
||||||
|
imul_reg64_reg64(buf, dst, src2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn jmp_imm32(buf: &mut Vec<'_, u8>, offset: i32) -> usize {
|
fn jmp_imm32(buf: &mut Vec<'_, u8>, offset: i32) -> usize {
|
||||||
jmp_imm32(buf, offset);
|
jmp_imm32(buf, offset);
|
||||||
|
@ -976,6 +1009,21 @@ fn binop_reg64_reg64(
|
||||||
buf.extend(&[rex, op_code, 0xC0 + dst_mod + src_mod]);
|
buf.extend(&[rex, op_code, 0xC0 + dst_mod + src_mod]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn extended_binop_reg64_reg64(
|
||||||
|
op_code1: u8,
|
||||||
|
op_code2: u8,
|
||||||
|
buf: &mut Vec<'_, u8>,
|
||||||
|
dst: X86_64GeneralReg,
|
||||||
|
src: X86_64GeneralReg,
|
||||||
|
) {
|
||||||
|
let rex = add_rm_extension(dst, REX_W);
|
||||||
|
let rex = add_reg_extension(src, rex);
|
||||||
|
let dst_mod = dst as u8 % 8;
|
||||||
|
let src_mod = (src as u8 % 8) << 3;
|
||||||
|
buf.extend(&[rex, op_code1, op_code2, 0xC0 + dst_mod + src_mod]);
|
||||||
|
}
|
||||||
|
|
||||||
// Below here are the functions for all of the assembly instructions.
|
// Below here are the functions for all of the assembly instructions.
|
||||||
// Their names are based on the instruction and operators combined.
|
// Their names are based on the instruction and operators combined.
|
||||||
// You should call `buf.reserve()` if you push or extend more than once.
|
// You should call `buf.reserve()` if you push or extend more than once.
|
||||||
|
@ -1018,6 +1066,26 @@ fn addsd_freg64_freg64(buf: &mut Vec<'_, u8>, dst: X86_64FloatReg, src: X86_64Fl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn andpd_freg64_freg64(buf: &mut Vec<'_, u8>, dst: X86_64FloatReg, src: X86_64FloatReg) {
|
||||||
|
let dst_high = dst as u8 > 7;
|
||||||
|
let dst_mod = dst as u8 % 8;
|
||||||
|
let src_high = src as u8 > 7;
|
||||||
|
let src_mod = src as u8 % 8;
|
||||||
|
|
||||||
|
if dst_high || src_high {
|
||||||
|
buf.extend(&[
|
||||||
|
0x66,
|
||||||
|
0x40 + ((dst_high as u8) << 2) + (src_high as u8),
|
||||||
|
0x0F,
|
||||||
|
0x54,
|
||||||
|
0xC0 + (dst_mod << 3) + (src_mod),
|
||||||
|
])
|
||||||
|
} else {
|
||||||
|
buf.extend(&[0x66, 0x0F, 0x54, 0xC0 + (dst_mod << 3) + (src_mod)])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// r/m64 AND imm8 (sign-extended).
|
/// r/m64 AND imm8 (sign-extended).
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn and_reg64_imm8(buf: &mut Vec<'_, u8>, dst: X86_64GeneralReg, imm: i8) {
|
fn and_reg64_imm8(buf: &mut Vec<'_, u8>, dst: X86_64GeneralReg, imm: i8) {
|
||||||
|
@ -1052,6 +1120,14 @@ fn cmp_reg64_reg64(buf: &mut Vec<'_, u8>, dst: X86_64GeneralReg, src: X86_64Gene
|
||||||
binop_reg64_reg64(0x39, buf, dst, src);
|
binop_reg64_reg64(0x39, buf, dst, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// `IMUL r64,r/m64` -> Signed Multiply r/m64 to r64.
|
||||||
|
#[inline(always)]
|
||||||
|
fn imul_reg64_reg64(buf: &mut Vec<'_, u8>, dst: X86_64GeneralReg, src: X86_64GeneralReg) {
|
||||||
|
// IMUL is strange, the parameters are reversed from must other binary ops.
|
||||||
|
// The final encoding is (src, dst) instead of (dst, src).
|
||||||
|
extended_binop_reg64_reg64(0x0F, 0xAF, buf, src, dst);
|
||||||
|
}
|
||||||
|
|
||||||
/// Jump near, relative, RIP = RIP + 32-bit displacement sign extended to 64-bits.
|
/// Jump near, relative, RIP = RIP + 32-bit displacement sign extended to 64-bits.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn jmp_imm32(buf: &mut Vec<'_, u8>, imm: i32) {
|
fn jmp_imm32(buf: &mut Vec<'_, u8>, imm: i32) {
|
||||||
|
@ -1389,6 +1465,35 @@ mod tests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_andpd_freg64_freg64() {
|
||||||
|
let arena = bumpalo::Bump::new();
|
||||||
|
let mut buf = bumpalo::vec![in &arena];
|
||||||
|
|
||||||
|
for ((dst, src), expected) in &[
|
||||||
|
(
|
||||||
|
(X86_64FloatReg::XMM0, X86_64FloatReg::XMM0),
|
||||||
|
vec![0x66, 0x0F, 0x54, 0xC0],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
(X86_64FloatReg::XMM0, X86_64FloatReg::XMM15),
|
||||||
|
vec![0x66, 0x41, 0x0F, 0x54, 0xC7],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
(X86_64FloatReg::XMM15, X86_64FloatReg::XMM0),
|
||||||
|
vec![0x66, 0x44, 0x0F, 0x54, 0xF8],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
(X86_64FloatReg::XMM15, X86_64FloatReg::XMM15),
|
||||||
|
vec![0x66, 0x45, 0x0F, 0x54, 0xFF],
|
||||||
|
),
|
||||||
|
] {
|
||||||
|
buf.clear();
|
||||||
|
andpd_freg64_freg64(&mut buf, *dst, *src);
|
||||||
|
assert_eq!(&expected[..], &buf[..]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_xor_reg64_reg64() {
|
fn test_xor_reg64_reg64() {
|
||||||
let arena = bumpalo::Bump::new();
|
let arena = bumpalo::Bump::new();
|
||||||
|
@ -1460,6 +1565,34 @@ mod tests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_imul_reg64_reg64() {
|
||||||
|
let arena = bumpalo::Bump::new();
|
||||||
|
let mut buf = bumpalo::vec![in &arena];
|
||||||
|
for ((dst, src), expected) in &[
|
||||||
|
(
|
||||||
|
(X86_64GeneralReg::RAX, X86_64GeneralReg::RAX),
|
||||||
|
[0x48, 0x0F, 0xAF, 0xC0],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
(X86_64GeneralReg::RAX, X86_64GeneralReg::R15),
|
||||||
|
[0x49, 0x0F, 0xAF, 0xC7],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
(X86_64GeneralReg::R15, X86_64GeneralReg::RAX),
|
||||||
|
[0x4C, 0x0F, 0xAF, 0xF8],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
(X86_64GeneralReg::R15, X86_64GeneralReg::R15),
|
||||||
|
[0x4D, 0x0F, 0xAF, 0xFF],
|
||||||
|
),
|
||||||
|
] {
|
||||||
|
buf.clear();
|
||||||
|
imul_reg64_reg64(&mut buf, *dst, *src);
|
||||||
|
assert_eq!(expected, &buf[..]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_jmp_imm32() {
|
fn test_jmp_imm32() {
|
||||||
let arena = bumpalo::Bump::new();
|
let arena = bumpalo::Bump::new();
|
||||||
|
|
|
@ -184,6 +184,9 @@ where
|
||||||
Symbol::NUM_ATAN => {
|
Symbol::NUM_ATAN => {
|
||||||
self.build_run_low_level(sym, &LowLevel::NumAtan, arguments, layout)
|
self.build_run_low_level(sym, &LowLevel::NumAtan, arguments, layout)
|
||||||
}
|
}
|
||||||
|
Symbol::NUM_MUL => {
|
||||||
|
self.build_run_low_level(sym, &LowLevel::NumMul, arguments, layout)
|
||||||
|
}
|
||||||
Symbol::NUM_POW_INT => self.build_run_low_level(
|
Symbol::NUM_POW_INT => self.build_run_low_level(
|
||||||
sym,
|
sym,
|
||||||
&LowLevel::NumPowInt,
|
&LowLevel::NumPowInt,
|
||||||
|
@ -237,6 +240,7 @@ where
|
||||||
// TODO: when this is expanded to floats. deal with typecasting here, and then call correct low level method.
|
// TODO: when this is expanded to floats. deal with typecasting here, and then call correct low level method.
|
||||||
match layout {
|
match layout {
|
||||||
Layout::Builtin(Builtin::Int64) => self.build_num_abs_i64(sym, &args[0]),
|
Layout::Builtin(Builtin::Int64) => self.build_num_abs_i64(sym, &args[0]),
|
||||||
|
Layout::Builtin(Builtin::Float64) => self.build_num_abs_f64(sym, &args[0]),
|
||||||
x => Err(format!("layout, {:?}, not implemented yet", x)),
|
x => Err(format!("layout, {:?}, not implemented yet", x)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,6 +265,15 @@ where
|
||||||
LowLevel::NumAtan => {
|
LowLevel::NumAtan => {
|
||||||
self.build_fn_call(sym, bitcode::NUM_ATAN.to_string(), args, &[*layout], layout)
|
self.build_fn_call(sym, bitcode::NUM_ATAN.to_string(), args, &[*layout], layout)
|
||||||
}
|
}
|
||||||
|
LowLevel::NumMul => {
|
||||||
|
// TODO: when this is expanded to floats. deal with typecasting here, and then call correct low level method.
|
||||||
|
match layout {
|
||||||
|
Layout::Builtin(Builtin::Int64) => {
|
||||||
|
self.build_num_mul_i64(sym, &args[0], &args[1])
|
||||||
|
}
|
||||||
|
x => Err(format!("layout, {:?}, not implemented yet", x)),
|
||||||
|
}
|
||||||
|
}
|
||||||
LowLevel::NumPowInt => self.build_fn_call(
|
LowLevel::NumPowInt => self.build_fn_call(
|
||||||
sym,
|
sym,
|
||||||
bitcode::NUM_POW_INT.to_string(),
|
bitcode::NUM_POW_INT.to_string(),
|
||||||
|
@ -302,6 +315,10 @@ where
|
||||||
/// It only deals with inputs and outputs of i64 type.
|
/// It only deals with inputs and outputs of i64 type.
|
||||||
fn build_num_abs_i64(&mut self, dst: &Symbol, src: &Symbol) -> Result<(), String>;
|
fn build_num_abs_i64(&mut self, dst: &Symbol, src: &Symbol) -> Result<(), String>;
|
||||||
|
|
||||||
|
/// build_num_abs_f64 stores the absolute value of src into dst.
|
||||||
|
/// It only deals with inputs and outputs of f64 type.
|
||||||
|
fn build_num_abs_f64(&mut self, dst: &Symbol, src: &Symbol) -> Result<(), String>;
|
||||||
|
|
||||||
/// build_num_add_i64 stores the sum of src1 and src2 into dst.
|
/// build_num_add_i64 stores the sum of src1 and src2 into dst.
|
||||||
/// It only deals with inputs and outputs of i64 type.
|
/// It only deals with inputs and outputs of i64 type.
|
||||||
fn build_num_add_i64(
|
fn build_num_add_i64(
|
||||||
|
@ -320,6 +337,15 @@ where
|
||||||
src2: &Symbol,
|
src2: &Symbol,
|
||||||
) -> Result<(), String>;
|
) -> Result<(), String>;
|
||||||
|
|
||||||
|
/// build_num_mul_i64 stores `src1 * src2` into dst.
|
||||||
|
/// It only deals with inputs and outputs of i64 type.
|
||||||
|
fn build_num_mul_i64(
|
||||||
|
&mut self,
|
||||||
|
dst: &Symbol,
|
||||||
|
src1: &Symbol,
|
||||||
|
src2: &Symbol,
|
||||||
|
) -> Result<(), String>;
|
||||||
|
|
||||||
/// build_num_sub_i64 stores the `src1 - src2` difference into dst.
|
/// build_num_sub_i64 stores the `src1 - src2` difference into dst.
|
||||||
/// It only deals with inputs and outputs of i64 type.
|
/// It only deals with inputs and outputs of i64 type.
|
||||||
fn build_num_sub_i64(
|
fn build_num_sub_i64(
|
||||||
|
|
|
@ -75,6 +75,19 @@ mod gen_num {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn gen_mul_i64() {
|
||||||
|
assert_evals_to!(
|
||||||
|
indoc!(
|
||||||
|
r#"
|
||||||
|
2 * 4 * 6
|
||||||
|
"#
|
||||||
|
),
|
||||||
|
48,
|
||||||
|
i64
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
#[ignore]
|
||||||
fn i64_force_stack() {
|
fn i64_force_stack() {
|
||||||
|
@ -248,24 +261,6 @@ mod gen_num {
|
||||||
-1,
|
-1,
|
||||||
i64
|
i64
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_evals_to!(
|
|
||||||
indoc!(
|
|
||||||
r#"
|
|
||||||
limitedNegate = \num ->
|
|
||||||
if num == 1 then
|
|
||||||
-1
|
|
||||||
else if num == -1 then
|
|
||||||
1
|
|
||||||
else
|
|
||||||
num
|
|
||||||
|
|
||||||
limitedNegate 1
|
|
||||||
"#
|
|
||||||
),
|
|
||||||
-1,
|
|
||||||
i64
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -289,6 +284,12 @@ mod gen_num {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn f64_abs() {
|
||||||
|
assert_evals_to!("Num.abs -4.7", 4.7, f64);
|
||||||
|
assert_evals_to!("Num.abs 5.8", 5.8, f64);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#[test]
|
#[test]
|
||||||
fn f64_sqrt() {
|
fn f64_sqrt() {
|
||||||
|
@ -311,11 +312,7 @@ mod gen_num {
|
||||||
assert_evals_to!("Num.round 3.6", 4, i64);
|
assert_evals_to!("Num.round 3.6", 4, i64);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn f64_abs() {
|
|
||||||
assert_evals_to!("Num.abs -4.7", 4.7, f64);
|
|
||||||
assert_evals_to!("Num.abs 5.8", 5.8, f64);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn gen_float_eq() {
|
fn gen_float_eq() {
|
||||||
|
@ -389,32 +386,6 @@ mod gen_num {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn gen_sub_i64() {
|
|
||||||
assert_evals_to!(
|
|
||||||
indoc!(
|
|
||||||
r#"
|
|
||||||
1 - 2 - 3
|
|
||||||
"#
|
|
||||||
),
|
|
||||||
-4,
|
|
||||||
i64
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn gen_mul_i64() {
|
|
||||||
assert_evals_to!(
|
|
||||||
indoc!(
|
|
||||||
r#"
|
|
||||||
2 * 4 * 6
|
|
||||||
"#
|
|
||||||
),
|
|
||||||
48,
|
|
||||||
i64
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn gen_div_i64() {
|
fn gen_div_i64() {
|
||||||
assert_evals_to!(
|
assert_evals_to!(
|
||||||
|
|
|
@ -28,13 +28,13 @@ arraystring = "0.3.0"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
page_size = "0.4"
|
page_size = "0.4"
|
||||||
winit = "0.24"
|
winit = "0.24"
|
||||||
wgpu = "0.7"
|
wgpu = "0.8"
|
||||||
glyph_brush = "0.7"
|
glyph_brush = "0.7"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
zerocopy = "0.3"
|
zerocopy = "0.3"
|
||||||
env_logger = "0.8"
|
env_logger = "0.8"
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
wgpu_glyph = "0.11"
|
wgpu_glyph = "0.12"
|
||||||
cgmath = "0.18.0"
|
cgmath = "0.18.0"
|
||||||
snafu = { version = "0.6", features = ["backtraces"] }
|
snafu = { version = "0.6", features = ["backtraces"] }
|
||||||
colored = "2"
|
colored = "2"
|
||||||
|
@ -62,11 +62,3 @@ quickcheck = "1.0"
|
||||||
quickcheck_macros = "1.0"
|
quickcheck_macros = "1.0"
|
||||||
criterion = "0.3"
|
criterion = "0.3"
|
||||||
rand = "0.8.2"
|
rand = "0.8.2"
|
||||||
|
|
||||||
[[bench]]
|
|
||||||
name = "file_benchmark"
|
|
||||||
harness = false
|
|
||||||
|
|
||||||
[[bench]]
|
|
||||||
name = "edit_benchmark"
|
|
||||||
harness = false
|
|
||||||
|
|
|
@ -1,216 +0,0 @@
|
||||||
use bumpalo::Bump;
|
|
||||||
use criterion::{criterion_group, criterion_main, Criterion};
|
|
||||||
use rand::rngs::StdRng;
|
|
||||||
use rand::{Rng, SeedableRng};
|
|
||||||
use roc_editor::mvc::app_model::AppModel;
|
|
||||||
use roc_editor::mvc::ed_model::{EdModel, Position, RawSelection};
|
|
||||||
use roc_editor::mvc::update::handle_new_char;
|
|
||||||
use roc_editor::text_buffer;
|
|
||||||
use roc_editor::text_buffer::TextBuffer;
|
|
||||||
use ropey::Rope;
|
|
||||||
use std::cmp::min;
|
|
||||||
use std::path::Path;
|
|
||||||
|
|
||||||
// duplicate inside mvc::update
|
|
||||||
fn mock_app_model(
|
|
||||||
text_buf: TextBuffer,
|
|
||||||
caret_pos: Position,
|
|
||||||
selection_opt: Option<RawSelection>,
|
|
||||||
) -> AppModel {
|
|
||||||
AppModel {
|
|
||||||
ed_model_opt: Some(EdModel {
|
|
||||||
text_buf,
|
|
||||||
caret_pos,
|
|
||||||
selection_opt,
|
|
||||||
glyph_dim_rect_opt: None,
|
|
||||||
has_focus: true,
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn text_buffer_from_str(lines_str: &str) -> TextBuffer {
|
|
||||||
TextBuffer {
|
|
||||||
text_rope: Rope::from_str(lines_str),
|
|
||||||
path_str: "".to_owned(),
|
|
||||||
arena: Bump::new(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn char_insert_bench(c: &mut Criterion) {
|
|
||||||
let text_buf = text_buffer_from_str("");
|
|
||||||
|
|
||||||
let caret_pos = Position { line: 0, column: 0 };
|
|
||||||
|
|
||||||
let selection_opt: Option<RawSelection> = None;
|
|
||||||
let mut app_model = mock_app_model(text_buf, caret_pos, selection_opt);
|
|
||||||
c.bench_function("single char insert, small buffer", |b| {
|
|
||||||
b.iter(|| handle_new_char(&mut app_model, &'a'))
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
fn bench_resource_path(nr_lines: usize) -> String {
|
|
||||||
let resource_path_res = std::env::var("BENCH_RESOURCE_PATH");
|
|
||||||
let resource_path_str = if let Ok(resource_path) = resource_path_res {
|
|
||||||
resource_path
|
|
||||||
} else {
|
|
||||||
"benches/resources/".to_owned()
|
|
||||||
};
|
|
||||||
|
|
||||||
format!("{}{}_lines.roc", resource_path_str, nr_lines)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn char_pop_bench(c: &mut Criterion) {
|
|
||||||
let nr_lines = 50000;
|
|
||||||
let mut text_buf = buf_from_dummy_file(nr_lines);
|
|
||||||
|
|
||||||
let mut rand_gen_pos = StdRng::seed_from_u64(44);
|
|
||||||
|
|
||||||
c.bench_function(
|
|
||||||
&format!("single char pop, {} lines", text_buf.nr_of_lines()),
|
|
||||||
|b| {
|
|
||||||
b.iter(|| {
|
|
||||||
let max_line_nr = text_buf.nr_of_lines();
|
|
||||||
let rand_line_nr = rand_gen_pos.gen_range(0..max_line_nr);
|
|
||||||
let max_col = text_buf
|
|
||||||
.line_len(rand_line_nr)
|
|
||||||
.expect("Failed to retrieve line length.");
|
|
||||||
|
|
||||||
let caret_pos = Position {
|
|
||||||
line: rand_line_nr,
|
|
||||||
column: rand_gen_pos.gen_range(0..max_col),
|
|
||||||
};
|
|
||||||
|
|
||||||
text_buf.pop_char(caret_pos);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_all_lines_helper(nr_lines: usize, c: &mut Criterion) {
|
|
||||||
let text_buf = buf_from_dummy_file(nr_lines);
|
|
||||||
|
|
||||||
let arena = Bump::new();
|
|
||||||
|
|
||||||
c.bench_function(
|
|
||||||
&format!("get all {:?} lines from textbuffer", nr_lines),
|
|
||||||
|b| b.iter(|| text_buf.all_lines(&arena)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_all_lines_bench(c: &mut Criterion) {
|
|
||||||
get_all_lines_helper(10000, c)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_line_len_helper(nr_lines: usize, c: &mut Criterion) {
|
|
||||||
let text_buf = buf_from_dummy_file(nr_lines);
|
|
||||||
|
|
||||||
let mut rand_gen = StdRng::seed_from_u64(45);
|
|
||||||
|
|
||||||
c.bench_function(
|
|
||||||
&format!("get random line len from {:?}-line textbuffer", nr_lines),
|
|
||||||
|b| b.iter(|| text_buf.line_len(rand_gen.gen_range(0..nr_lines)).unwrap()),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_line_len_bench(c: &mut Criterion) {
|
|
||||||
get_line_len_helper(10000, c)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_line_helper(nr_lines: usize, c: &mut Criterion) {
|
|
||||||
let text_buf = buf_from_dummy_file(nr_lines);
|
|
||||||
|
|
||||||
let mut rand_gen = StdRng::seed_from_u64(46);
|
|
||||||
|
|
||||||
c.bench_function(
|
|
||||||
&format!("get random line from {:?}-line textbuffer", nr_lines),
|
|
||||||
|b| {
|
|
||||||
b.iter(|| {
|
|
||||||
let rand_indx = rand_gen.gen_range(0..nr_lines);
|
|
||||||
text_buf.line(rand_indx).unwrap()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_line_bench(c: &mut Criterion) {
|
|
||||||
get_line_helper(10000, c)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn del_select_bench(c: &mut Criterion) {
|
|
||||||
let nr_lines = 25000000;
|
|
||||||
let mut text_buf = buf_from_dummy_file(nr_lines);
|
|
||||||
|
|
||||||
let mut rand_gen = StdRng::seed_from_u64(47);
|
|
||||||
|
|
||||||
c.bench_function(
|
|
||||||
&format!(
|
|
||||||
"delete rand selection, {}-line file",
|
|
||||||
text_buf.nr_of_lines()
|
|
||||||
),
|
|
||||||
|b| {
|
|
||||||
b.iter(|| {
|
|
||||||
let rand_sel = gen_rand_selection(&mut rand_gen, &text_buf);
|
|
||||||
|
|
||||||
text_buf.del_selection(rand_sel).unwrap();
|
|
||||||
})
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn gen_rand_selection(rand_gen: &mut StdRng, text_buf: &TextBuffer) -> RawSelection {
|
|
||||||
let max_line_nr = text_buf.nr_of_lines();
|
|
||||||
let rand_line_nr_a = rand_gen.gen_range(0..max_line_nr - 3);
|
|
||||||
let max_col_a = text_buf.line_len(rand_line_nr_a).expect(&format!(
|
|
||||||
"Failed to retrieve line length. For line {}, with {} lines in buffer",
|
|
||||||
rand_line_nr_a,
|
|
||||||
text_buf.nr_of_lines()
|
|
||||||
));
|
|
||||||
let rand_col_a = if max_col_a > 0 {
|
|
||||||
rand_gen.gen_range(0..max_col_a)
|
|
||||||
} else {
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
let max_sel_end = min(rand_line_nr_a + 5, max_line_nr);
|
|
||||||
let rand_line_nr_b = rand_gen.gen_range((rand_line_nr_a + 1)..max_sel_end);
|
|
||||||
let max_col_b = text_buf.line_len(rand_line_nr_b).expect(&format!(
|
|
||||||
"Failed to retrieve line length. For line {}, with {} lines in buffer",
|
|
||||||
rand_line_nr_b,
|
|
||||||
text_buf.nr_of_lines()
|
|
||||||
));
|
|
||||||
let rand_col_b = if max_col_b > 0 {
|
|
||||||
rand_gen.gen_range(0..max_col_b)
|
|
||||||
} else {
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
RawSelection {
|
|
||||||
start_pos: Position {
|
|
||||||
line: rand_line_nr_a,
|
|
||||||
column: rand_col_a,
|
|
||||||
},
|
|
||||||
end_pos: Position {
|
|
||||||
line: rand_line_nr_b,
|
|
||||||
column: rand_col_b,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn buf_from_dummy_file(nr_lines: usize) -> TextBuffer {
|
|
||||||
let path_str = bench_resource_path(nr_lines);
|
|
||||||
|
|
||||||
text_buffer::from_path(Path::new(&path_str)).expect("Failed to read file at given path.")
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO remove all random generation from inside measured execution block
|
|
||||||
//criterion_group!(benches, del_select_bench);
|
|
||||||
criterion_group!(
|
|
||||||
benches,
|
|
||||||
char_pop_bench,
|
|
||||||
char_insert_bench,
|
|
||||||
get_all_lines_bench,
|
|
||||||
get_line_len_bench,
|
|
||||||
get_line_bench,
|
|
||||||
del_select_bench
|
|
||||||
);
|
|
||||||
criterion_main!(benches);
|
|
|
@ -1,163 +0,0 @@
|
||||||
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
|
||||||
use rand::distributions::Alphanumeric;
|
|
||||||
use rand::rngs::StdRng;
|
|
||||||
use rand::{Rng, SeedableRng};
|
|
||||||
use roc_editor::mvc::app_model::AppModel;
|
|
||||||
use roc_editor::mvc::ed_model::{EdModel, Position, RawSelection};
|
|
||||||
use roc_editor::mvc::update::handle_new_char;
|
|
||||||
use roc_editor::text_buffer;
|
|
||||||
use roc_editor::text_buffer::TextBuffer;
|
|
||||||
use ropey::Rope;
|
|
||||||
use std::fs::File;
|
|
||||||
use std::io::Write;
|
|
||||||
use std::path::Path;
|
|
||||||
|
|
||||||
// duplicate inside mvc::update
|
|
||||||
fn mock_app_model(
|
|
||||||
text_buf: TextBuffer,
|
|
||||||
caret_pos: Position,
|
|
||||||
selection_opt: Option<RawSelection>,
|
|
||||||
) -> AppModel {
|
|
||||||
AppModel {
|
|
||||||
ed_model_opt: Some(EdModel {
|
|
||||||
text_buf,
|
|
||||||
caret_pos,
|
|
||||||
selection_opt,
|
|
||||||
glyph_dim_rect_opt: None,
|
|
||||||
has_focus: true,
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn text_buffer_from_str(lines_str: &str) -> TextBuffer {
|
|
||||||
TextBuffer {
|
|
||||||
text_rope: Rope::from_str(lines_str),
|
|
||||||
path_str: "".to_owned(),
|
|
||||||
arena: bumpalo::Bump::new(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn char_insert_benchmark(c: &mut Criterion) {
|
|
||||||
let text_buf = text_buffer_from_str("");
|
|
||||||
|
|
||||||
let caret_pos = Position { line: 0, column: 0 };
|
|
||||||
|
|
||||||
let selection_opt: Option<RawSelection> = None;
|
|
||||||
let mut app_model = mock_app_model(text_buf, caret_pos, selection_opt);
|
|
||||||
c.bench_function("single char insert, small buffer", |b| {
|
|
||||||
b.iter(|| handle_new_char(&mut app_model, &'a'))
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
static ROC_SOURCE_START: &str = "interface LongStrProvider
|
|
||||||
exposes [ longStr ]
|
|
||||||
imports []
|
|
||||||
|
|
||||||
longStr : Str
|
|
||||||
longStr =
|
|
||||||
\"\"\"";
|
|
||||||
|
|
||||||
static ROC_SOURCE_END: &str = "\"\"\"";
|
|
||||||
|
|
||||||
fn line_count(lines: &str) -> usize {
|
|
||||||
lines.matches("\n").count()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn gen_file(nr_lines: usize) {
|
|
||||||
let nr_of_str_lines = nr_lines - line_count(ROC_SOURCE_START);
|
|
||||||
let path_str = bench_resource_path(nr_lines);
|
|
||||||
let path = Path::new(&path_str);
|
|
||||||
let display = path.display();
|
|
||||||
|
|
||||||
// Open a file in write-only mode, returns `io::Result<File>`
|
|
||||||
let mut file = match File::create(&path) {
|
|
||||||
Err(why) => panic!("couldn't create {}: {}", display, why),
|
|
||||||
Ok(file) => file,
|
|
||||||
};
|
|
||||||
|
|
||||||
file.write(ROC_SOURCE_START.as_bytes())
|
|
||||||
.expect("Failed to write String to file.");
|
|
||||||
|
|
||||||
let mut rand_gen_line = StdRng::seed_from_u64(42);
|
|
||||||
|
|
||||||
for _ in 0..nr_of_str_lines {
|
|
||||||
let line_len = rand_gen_line.gen_range(1..90);
|
|
||||||
|
|
||||||
let char_seed = rand_gen_line.gen_range(0..1000);
|
|
||||||
|
|
||||||
let mut rand_string: String = StdRng::seed_from_u64(char_seed)
|
|
||||||
.sample_iter(&Alphanumeric)
|
|
||||||
.take(line_len)
|
|
||||||
.map(char::from)
|
|
||||||
.collect();
|
|
||||||
rand_string.push('\n');
|
|
||||||
|
|
||||||
file.write(rand_string.as_bytes())
|
|
||||||
.expect("Failed to write String to file.");
|
|
||||||
}
|
|
||||||
|
|
||||||
file.write(ROC_SOURCE_END.as_bytes())
|
|
||||||
.expect("Failed to write String to file.");
|
|
||||||
}
|
|
||||||
|
|
||||||
fn bench_resource_path(nr_lines: usize) -> String {
|
|
||||||
let resource_path_res = std::env::var("BENCH_RESOURCE_PATH");
|
|
||||||
let resource_path_str = if let Ok(resource_path) = resource_path_res {
|
|
||||||
resource_path
|
|
||||||
} else {
|
|
||||||
"benches/resources/".to_owned()
|
|
||||||
};
|
|
||||||
|
|
||||||
format!("{}{}_lines.roc", resource_path_str, nr_lines)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn file_read_bench_helper(nr_lines: usize, c: &mut Criterion) {
|
|
||||||
let path_str = bench_resource_path(nr_lines);
|
|
||||||
text_buffer::from_path(Path::new(&path_str)).expect("Failed to read file at given path.");
|
|
||||||
c.bench_function(
|
|
||||||
&format!("read {:?} line file into textbuffer", nr_lines),
|
|
||||||
|b| b.iter(|| text_buffer::from_path(black_box(Path::new(&path_str)))),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn file_read_bench_10(c: &mut Criterion) {
|
|
||||||
// generate dummy files
|
|
||||||
/*let lines_vec = vec![100, 500, 1000, 10000, 50000, 100000, 25000000];
|
|
||||||
|
|
||||||
for nr_lines in lines_vec.iter(){
|
|
||||||
gen_file(*nr_lines);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
file_read_bench_helper(10, c)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn file_read_bench_100(c: &mut Criterion) {
|
|
||||||
file_read_bench_helper(100, c)
|
|
||||||
}
|
|
||||||
fn file_read_bench_500(c: &mut Criterion) {
|
|
||||||
file_read_bench_helper(500, c)
|
|
||||||
}
|
|
||||||
fn file_read_bench_1k(c: &mut Criterion) {
|
|
||||||
file_read_bench_helper(1000, c)
|
|
||||||
}
|
|
||||||
fn file_read_bench_10k(c: &mut Criterion) {
|
|
||||||
file_read_bench_helper(10000, c)
|
|
||||||
}
|
|
||||||
fn file_read_bench_100k(c: &mut Criterion) {
|
|
||||||
file_read_bench_helper(100000, c)
|
|
||||||
}
|
|
||||||
fn file_read_bench_25m(c: &mut Criterion) {
|
|
||||||
file_read_bench_helper(25000000, c)
|
|
||||||
}
|
|
||||||
|
|
||||||
criterion_group!(
|
|
||||||
benches,
|
|
||||||
file_read_bench_10,
|
|
||||||
file_read_bench_100,
|
|
||||||
file_read_bench_500,
|
|
||||||
file_read_bench_1k,
|
|
||||||
file_read_bench_10k,
|
|
||||||
file_read_bench_100k,
|
|
||||||
file_read_bench_25m
|
|
||||||
);
|
|
||||||
criterion_main!(benches);
|
|
|
@ -1,11 +0,0 @@
|
||||||
interface LongStrProvider
|
|
||||||
exposes [ longStr ]
|
|
||||||
imports []
|
|
||||||
|
|
||||||
longStr : Str
|
|
||||||
longStr =
|
|
||||||
"""7vntt4wlBKiVkNss19DZlOfmSAyIzO5Ph8eckYgnctYDersOFs3AWOPHcONxI58DoTEwGKNLGkhrxwCD
|
|
||||||
gWxYsX9hlEuQ0vI4twHMqgj8F
|
|
||||||
Ox4pVYIxku15v1KaWahgjkJ8EBXMWhe5m2519wpEtP
|
|
||||||
HtaqU0XzVu1ix3jGAZ66UugNKJrVP8RVQm
|
|
||||||
"""
|
|
|
@ -1,26 +0,0 @@
|
||||||
System info:
|
|
||||||
- CPU: Intel i7 4770k
|
|
||||||
- SSD: Samsung 970 EVO PLUS M.2 1TB
|
|
||||||
- OS: Ubuntu 20.04
|
|
||||||
|
|
||||||
c.bench_function(
|
|
||||||
"read file into textbuffer",
|
|
||||||
|b| b.iter(|| text_buffer::from_path(black_box(Path::new(path_str))))
|
|
||||||
);
|
|
||||||
|
|
||||||
10 lines, 285 B time: [3.2343 us]
|
|
||||||
|
|
||||||
100 lines, 4.2 KiB time: [6.1810 us]
|
|
||||||
|
|
||||||
500 lines, 22.2 KiB time: [15.689 us]
|
|
||||||
|
|
||||||
1000 lines, 44.6 KiB time: [29.591 us]
|
|
||||||
|
|
||||||
10000 lines, 448 KiB time: [376.22 us]
|
|
||||||
|
|
||||||
50000 lines, 2.2 MiB time: [2.0329 ms]
|
|
||||||
|
|
||||||
100000 lines, 4.4 MiB time: [4.4221 ms]
|
|
||||||
|
|
||||||
25000000 lines, 1.1 GiB time: [1.1333 s]
|
|
||||||
|
|
|
@ -396,8 +396,8 @@ fn begin_render_pass<'a>(
|
||||||
let bg_color = to_wgpu_color(ed_theme.background);
|
let bg_color = to_wgpu_color(ed_theme.background);
|
||||||
|
|
||||||
encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
|
encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
|
||||||
color_attachments: &[wgpu::RenderPassColorAttachmentDescriptor {
|
color_attachments: &[wgpu::RenderPassColorAttachment {
|
||||||
attachment: texture_view,
|
view: texture_view,
|
||||||
resolve_target: None,
|
resolve_target: None,
|
||||||
ops: wgpu::Operations {
|
ops: wgpu::Operations {
|
||||||
load: wgpu::LoadOp::Clear(bg_color),
|
load: wgpu::LoadOp::Clear(bg_color),
|
||||||
|
|
|
@ -53,12 +53,14 @@ pub fn create_render_pipeline(
|
||||||
entry_point: "fs_main",
|
entry_point: "fs_main",
|
||||||
targets: &[wgpu::ColorTargetState {
|
targets: &[wgpu::ColorTargetState {
|
||||||
format: color_format,
|
format: color_format,
|
||||||
color_blend: wgpu::BlendState {
|
blend: Some(wgpu::BlendState {
|
||||||
|
color: wgpu::BlendComponent {
|
||||||
operation: wgpu::BlendOperation::Add,
|
operation: wgpu::BlendOperation::Add,
|
||||||
src_factor: wgpu::BlendFactor::SrcAlpha,
|
src_factor: wgpu::BlendFactor::SrcAlpha,
|
||||||
dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha,
|
dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha,
|
||||||
},
|
},
|
||||||
alpha_blend: wgpu::BlendState::REPLACE,
|
alpha: wgpu::BlendComponent::REPLACE,
|
||||||
|
}),
|
||||||
write_mask: wgpu::ColorWrite::ALL,
|
write_mask: wgpu::ColorWrite::ALL,
|
||||||
}],
|
}],
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -24,13 +24,13 @@ impl Vertex {
|
||||||
wgpu::VertexAttribute {
|
wgpu::VertexAttribute {
|
||||||
offset: 0,
|
offset: 0,
|
||||||
shader_location: 0,
|
shader_location: 0,
|
||||||
format: wgpu::VertexFormat::Float2,
|
format: wgpu::VertexFormat::Float32x2,
|
||||||
},
|
},
|
||||||
// color
|
// color
|
||||||
wgpu::VertexAttribute {
|
wgpu::VertexAttribute {
|
||||||
offset: std::mem::size_of::<[f32; 2]>() as wgpu::BufferAddress,
|
offset: std::mem::size_of::<[f32; 2]>() as wgpu::BufferAddress,
|
||||||
shader_location: 1,
|
shader_location: 1,
|
||||||
format: wgpu::VertexFormat::Float4,
|
format: wgpu::VertexFormat::Float32x4,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
|
|
||||||
[[location(0)]]
|
struct VertexOutput {
|
||||||
var<in> in_position: vec2<f32>;
|
[[location(0)]] color: vec4<f32>;
|
||||||
[[location(1)]]
|
[[builtin(position)]] position: vec4<f32>;
|
||||||
var<in> in_color: vec4<f32>;
|
};
|
||||||
[[location(0)]]
|
|
||||||
var<out> out_color: vec4<f32>;
|
|
||||||
[[builtin(position)]]
|
|
||||||
var<out> out_pos: vec4<f32>;
|
|
||||||
|
|
||||||
[[block]]
|
[[block]]
|
||||||
struct Globals {
|
struct Globals {
|
||||||
|
@ -17,17 +13,19 @@ struct Globals {
|
||||||
var<uniform> u_globals: Globals;
|
var<uniform> u_globals: Globals;
|
||||||
|
|
||||||
[[stage(vertex)]]
|
[[stage(vertex)]]
|
||||||
fn vs_main() {
|
fn vs_main(
|
||||||
out_pos = u_globals.ortho * vec4<f32>(in_position, 0.0, 1.0);
|
[[location(0)]] in_position: vec2<f32>,
|
||||||
out_color = in_color;
|
[[location(1)]] in_color: vec4<f32>,
|
||||||
}
|
) -> VertexOutput {
|
||||||
|
var out: VertexOutput;
|
||||||
|
|
||||||
[[location(0)]]
|
out.position = u_globals.ortho * vec4<f32>(in_position, 0.0, 1.0);
|
||||||
var<in> in_color: vec4<f32>;
|
out.color = in_color;
|
||||||
[[location(0)]]
|
|
||||||
var<out> out_color: vec4<f32>;
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
[[stage(fragment)]]
|
[[stage(fragment)]]
|
||||||
fn fs_main() {
|
fn fs_main(in: VertexOutput) -> [[location(0)]] vec4<f32> {
|
||||||
out_color = in_color;
|
return in.color;
|
||||||
}
|
}
|
|
@ -276,6 +276,161 @@ pub fn constrain_expr<'a>(
|
||||||
|
|
||||||
exists(arena, flex_vars, And(arg_cons))
|
exists(arena, flex_vars, And(arg_cons))
|
||||||
}
|
}
|
||||||
|
Expr2::Call {
|
||||||
|
args,
|
||||||
|
expr_var,
|
||||||
|
expr: expr_node_id,
|
||||||
|
closure_var,
|
||||||
|
fn_var,
|
||||||
|
..
|
||||||
|
} => {
|
||||||
|
// The expression that evaluates to the function being called, e.g. `foo` in
|
||||||
|
// (foo) bar baz
|
||||||
|
let expr = env.pool.get(*expr_node_id);
|
||||||
|
|
||||||
|
let opt_symbol = if let Expr2::Var(symbol) = expr {
|
||||||
|
Some(*symbol)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
|
let fn_type = Type2::Variable(*fn_var);
|
||||||
|
let fn_region = region;
|
||||||
|
let fn_expected = Expected::NoExpectation(fn_type.shallow_clone());
|
||||||
|
|
||||||
|
let fn_reason = Reason::FnCall {
|
||||||
|
name: opt_symbol,
|
||||||
|
arity: args.len() as u8,
|
||||||
|
};
|
||||||
|
|
||||||
|
let fn_con = constrain_expr(arena, env, expr, fn_expected, region);
|
||||||
|
|
||||||
|
// The function's return type
|
||||||
|
// TODO: don't use expr_var?
|
||||||
|
let ret_type = Type2::Variable(*expr_var);
|
||||||
|
|
||||||
|
// type of values captured in the closure
|
||||||
|
let closure_type = Type2::Variable(*closure_var);
|
||||||
|
|
||||||
|
// This will be used in the occurs check
|
||||||
|
let mut vars = BumpVec::with_capacity_in(2 + args.len(), arena);
|
||||||
|
|
||||||
|
vars.push(*fn_var);
|
||||||
|
// TODO: don't use expr_var?
|
||||||
|
vars.push(*expr_var);
|
||||||
|
vars.push(*closure_var);
|
||||||
|
|
||||||
|
let mut arg_types = BumpVec::with_capacity_in(args.len(), arena);
|
||||||
|
let mut arg_cons = BumpVec::with_capacity_in(args.len(), arena);
|
||||||
|
|
||||||
|
for (index, arg_node_id) in args.iter_node_ids().enumerate() {
|
||||||
|
let (arg_var, arg) = env.pool.get(arg_node_id);
|
||||||
|
let arg_expr = env.pool.get(*arg);
|
||||||
|
|
||||||
|
let region = region;
|
||||||
|
let arg_type = Type2::Variable(*arg_var);
|
||||||
|
|
||||||
|
let reason = Reason::FnArg {
|
||||||
|
name: opt_symbol,
|
||||||
|
arg_index: Index::zero_based(index),
|
||||||
|
};
|
||||||
|
|
||||||
|
let expected_arg = Expected::ForReason(reason, arg_type.shallow_clone(), region);
|
||||||
|
|
||||||
|
let arg_con = constrain_expr(arena, env, arg_expr, expected_arg, region);
|
||||||
|
|
||||||
|
vars.push(*arg_var);
|
||||||
|
arg_types.push(arg_type);
|
||||||
|
arg_cons.push(arg_con);
|
||||||
|
}
|
||||||
|
|
||||||
|
let expected_fn_type = Expected::ForReason(
|
||||||
|
fn_reason,
|
||||||
|
Type2::Function(
|
||||||
|
PoolVec::new(arg_types.into_iter(), env.pool),
|
||||||
|
env.pool.add(closure_type),
|
||||||
|
env.pool.add(ret_type.shallow_clone()),
|
||||||
|
),
|
||||||
|
region,
|
||||||
|
);
|
||||||
|
|
||||||
|
let category = Category::CallResult(opt_symbol);
|
||||||
|
|
||||||
|
let mut and_constraints = BumpVec::with_capacity_in(4, arena);
|
||||||
|
|
||||||
|
and_constraints.push(fn_con);
|
||||||
|
and_constraints.push(Eq(fn_type, expected_fn_type, category.clone(), fn_region));
|
||||||
|
and_constraints.push(And(arg_cons));
|
||||||
|
and_constraints.push(Eq(ret_type, expected, category, region));
|
||||||
|
|
||||||
|
exists(arena, vars, And(and_constraints))
|
||||||
|
}
|
||||||
|
Expr2::Accessor {
|
||||||
|
function_var,
|
||||||
|
closure_var,
|
||||||
|
field,
|
||||||
|
record_var,
|
||||||
|
ext_var,
|
||||||
|
field_var,
|
||||||
|
} => {
|
||||||
|
let ext_var = *ext_var;
|
||||||
|
let ext_type = Type2::Variable(ext_var);
|
||||||
|
|
||||||
|
let field_var = *field_var;
|
||||||
|
let field_type = Type2::Variable(field_var);
|
||||||
|
|
||||||
|
let record_field =
|
||||||
|
types::RecordField::Demanded(env.pool.add(field_type.shallow_clone()));
|
||||||
|
|
||||||
|
let record_type = Type2::Record(
|
||||||
|
PoolVec::new(vec![(*field, record_field)].into_iter(), env.pool),
|
||||||
|
env.pool.add(ext_type),
|
||||||
|
);
|
||||||
|
|
||||||
|
let category = Category::Accessor(field.as_str(env.pool).into());
|
||||||
|
|
||||||
|
let record_expected = Expected::NoExpectation(record_type.shallow_clone());
|
||||||
|
let record_con = Eq(
|
||||||
|
Type2::Variable(*record_var),
|
||||||
|
record_expected,
|
||||||
|
category.clone(),
|
||||||
|
region,
|
||||||
|
);
|
||||||
|
|
||||||
|
let function_type = Type2::Function(
|
||||||
|
PoolVec::new(vec![record_type].into_iter(), env.pool),
|
||||||
|
env.pool.add(Type2::Variable(*closure_var)),
|
||||||
|
env.pool.add(field_type),
|
||||||
|
);
|
||||||
|
|
||||||
|
let mut flex_vars = BumpVec::with_capacity_in(5, arena);
|
||||||
|
|
||||||
|
flex_vars.push(*record_var);
|
||||||
|
flex_vars.push(*function_var);
|
||||||
|
flex_vars.push(*closure_var);
|
||||||
|
flex_vars.push(field_var);
|
||||||
|
flex_vars.push(ext_var);
|
||||||
|
|
||||||
|
let mut and_constraints = BumpVec::with_capacity_in(3, arena);
|
||||||
|
|
||||||
|
and_constraints.push(Eq(
|
||||||
|
function_type.shallow_clone(),
|
||||||
|
expected,
|
||||||
|
category.clone(),
|
||||||
|
region,
|
||||||
|
));
|
||||||
|
|
||||||
|
and_constraints.push(Eq(
|
||||||
|
function_type,
|
||||||
|
Expected::NoExpectation(Type2::Variable(*function_var)),
|
||||||
|
category,
|
||||||
|
region,
|
||||||
|
));
|
||||||
|
|
||||||
|
and_constraints.push(record_con);
|
||||||
|
|
||||||
|
exists(arena, flex_vars, And(and_constraints))
|
||||||
|
}
|
||||||
_ => todo!("implement constaints for {:?}", expr),
|
_ => todo!("implement constaints for {:?}", expr),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -861,22 +861,30 @@ fn type_to_variable<'a>(
|
||||||
|
|
||||||
register(subs, rank, pools, content)
|
register(subs, rank, pools, content)
|
||||||
}
|
}
|
||||||
|
// This case is important for the rank of boolean variables
|
||||||
|
Function(args, closure_type_id, ret_type_id) => {
|
||||||
|
let mut arg_vars = Vec::with_capacity(args.len());
|
||||||
|
|
||||||
|
let closure_type = mempool.get(*closure_type_id);
|
||||||
|
let ret_type = mempool.get(*ret_type_id);
|
||||||
|
|
||||||
|
for arg_id in args.iter_node_ids() {
|
||||||
|
let arg = mempool.get(arg_id);
|
||||||
|
|
||||||
|
arg_vars.push(type_to_variable(
|
||||||
|
arena, mempool, subs, rank, pools, cached, arg,
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
let ret_var = type_to_variable(arena, mempool, subs, rank, pools, cached, ret_type);
|
||||||
|
let closure_var =
|
||||||
|
type_to_variable(arena, mempool, subs, rank, pools, cached, closure_type);
|
||||||
|
|
||||||
|
let content = Content::Structure(FlatType::Func(arg_vars, closure_var, ret_var));
|
||||||
|
|
||||||
|
register(subs, rank, pools, content)
|
||||||
|
}
|
||||||
other => todo!("not implemented {:?}", &other),
|
other => todo!("not implemented {:?}", &other),
|
||||||
//
|
|
||||||
// // This case is important for the rank of boolean variables
|
|
||||||
// Function(args, closure_type, ret_type) => {
|
|
||||||
// let mut arg_vars = Vec::with_capacity(args.len());
|
|
||||||
//
|
|
||||||
// for arg in args {
|
|
||||||
// arg_vars.push(type_to_variable(subs, rank, pools, cached, arg))
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// let ret_var = type_to_variable(subs, rank, pools, cached, ret_type);
|
|
||||||
// let closure_var = type_to_variable(subs, rank, pools, cached, closure_type);
|
|
||||||
// let content = Content::Structure(FlatType::Func(arg_vars, closure_var, ret_var));
|
|
||||||
//
|
|
||||||
// register(subs, rank, pools, content)
|
|
||||||
// }
|
|
||||||
// RecursiveTagUnion(rec_var, tags, ext) => {
|
// RecursiveTagUnion(rec_var, tags, ext) => {
|
||||||
// let mut tag_vars = MutMap::default();
|
// let mut tag_vars = MutMap::default();
|
||||||
//
|
//
|
||||||
|
|
|
@ -62,9 +62,15 @@ impl ShallowClone for Type2 {
|
||||||
fn shallow_clone(&self) -> Self {
|
fn shallow_clone(&self) -> Self {
|
||||||
match self {
|
match self {
|
||||||
Self::Variable(var) => Self::Variable(*var),
|
Self::Variable(var) => Self::Variable(*var),
|
||||||
Self::Alias(symbol, pool_vec, type_id) => {
|
Self::Alias(symbol, args, alias_type_id) => {
|
||||||
Self::Alias(*symbol, pool_vec.shallow_clone(), type_id.clone())
|
Self::Alias(*symbol, args.shallow_clone(), alias_type_id.clone())
|
||||||
}
|
}
|
||||||
|
Self::Record(fields, ext_id) => Self::Record(fields.shallow_clone(), ext_id.clone()),
|
||||||
|
Self::Function(args, closure_type_id, ret_type_id) => Self::Function(
|
||||||
|
args.shallow_clone(),
|
||||||
|
closure_type_id.clone(),
|
||||||
|
ret_type_id.clone(),
|
||||||
|
),
|
||||||
rest => todo!("{:?}", rest),
|
rest => todo!("{:?}", rest),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,3 +250,15 @@ fn constrain_global_tag() {
|
||||||
"[ Foo ]*",
|
"[ Foo ]*",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn constrain_call_and_accessor() {
|
||||||
|
infer_eq(
|
||||||
|
indoc!(
|
||||||
|
r#"
|
||||||
|
.foo { foo: "bar" }
|
||||||
|
"#
|
||||||
|
),
|
||||||
|
"Str",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue