diff --git a/basis/db/tuples/tuples-docs.factor b/basis/db/tuples/tuples-docs.factor index 4d435e6a89..116dfd5c00 100644 --- a/basis/db/tuples/tuples-docs.factor +++ b/basis/db/tuples/tuples-docs.factor @@ -230,9 +230,9 @@ T{ book } book set """ } "Now we've created a book. Let's save it to the database." -{ $code """USING: db db.sqlite fry io.files ; +{ $code """USING: db db.sqlite fry io.files.temp ; : with-book-tutorial ( quot -- ) - '[ "book-tutorial.db" temp-file _ with-db ] call ; + '[ "book-tutorial.db" temp-file _ with-db ] call ; inline [ book recreate-table diff --git a/basis/math/vectors/vectors-docs.factor b/basis/math/vectors/vectors-docs.factor index 252cc4216e..2d9a70ad58 100644 --- a/basis/math/vectors/vectors-docs.factor +++ b/basis/math/vectors/vectors-docs.factor @@ -209,11 +209,13 @@ HELP: vbitxor HELP: vlshift { $values { "u" "a sequence of integers" } { "n" "a non-negative integer" } { "w" "a sequence of integers" } } -{ $description "Shifts each element of " { $snippet "u" } " to the left by " { $snippet "n" } " bits." } ; +{ $description "Shifts each element of " { $snippet "u" } " to the left by " { $snippet "n" } " bits." } +{ $notes "Undefined behavior will result if " { $snippet "n" } " is negative." } ; HELP: vrshift { $values { "u" "a sequence of integers" } { "n" "a non-negative integer" } { "w" "a sequence of integers" } } -{ $description "Shifts each element of " { $snippet "u" } " to the right by " { $snippet "n" } " bits." } ; +{ $description "Shifts each element of " { $snippet "u" } " to the right by " { $snippet "n" } " bits." } +{ $notes "Undefined behavior will result if " { $snippet "n" } " is negative." } ; HELP: norm-sq { $values { "v" "a sequence of numbers" } { "x" "a non-negative real number" } } diff --git a/basis/math/vectors/vectors-tests.factor b/basis/math/vectors/vectors-tests.factor index 712c5e4c60..91c5c0326f 100644 --- a/basis/math/vectors/vectors-tests.factor +++ b/basis/math/vectors/vectors-tests.factor @@ -24,11 +24,3 @@ SPECIALIZED-ARRAY: int [ { 0 3 2 5 4 } ] [ { 1 2 3 4 5 } { 1 1 1 1 1 } v+- ] unit-test [ 1 ] [ { C{ 0 1 } } dup v. ] unit-test - -! Make sure vector shifts behave the same as hardware SIMD vector shifts -[ int-array{ 0 0 0 0 } ] [ int-array{ 10 20 30 40 } -1 vlshift ] unit-test - -[ int-array{ 0 0 0 0 } ] [ - int-array{ 10 20 30 40 } - [ { int-array } declare -1 vlshift ] compile-call -] unit-test \ No newline at end of file diff --git a/basis/math/vectors/vectors.factor b/basis/math/vectors/vectors.factor index e3e4f51e28..a40506f980 100644 --- a/basis/math/vectors/vectors.factor +++ b/basis/math/vectors/vectors.factor @@ -61,8 +61,8 @@ PRIVATE> : vbitor ( u v -- w ) over '[ _ [ bitor ] fp-bitwise-op ] 2map ; : vbitxor ( u v -- w ) over '[ _ [ bitxor ] fp-bitwise-op ] 2map ; -: vlshift ( u n -- w ) HEX: ffffffff bitand '[ _ shift ] map ; -: vrshift ( u n -- w ) HEX: ffffffff bitand neg '[ _ shift ] map ; +: vlshift ( u n -- w ) '[ _ shift ] map ; +: vrshift ( u n -- w ) neg '[ _ shift ] map ; : vfloor ( u -- v ) [ floor ] map ; : vceiling ( u -- v ) [ ceiling ] map ; diff --git a/vm/os-windows.cpp b/vm/os-windows.cpp old mode 100644 new mode 100755 index 077bc48aa1..c4b011417d --- a/vm/os-windows.cpp +++ b/vm/os-windows.cpp @@ -126,10 +126,15 @@ segment::~segment() SYSTEM_INFO si; GetSystemInfo(&si); if(!VirtualFree((void*)(start - si.dwPageSize), 0, MEM_RELEASE)) - myvm->fatal_error("Segment deallocation failed",0); + fatal_error("Segment deallocation failed",0); } -long factor_vm::getpagesize() +void factor_vm::sleep_micros(u64 usec) +{ + Sleep((DWORD)(usec / 1000)); +} + +long getpagesize() { static long g_pagesize = 0; if (! g_pagesize) @@ -141,9 +146,4 @@ long factor_vm::getpagesize() return g_pagesize; } -void factor_vm::sleep_micros(u64 usec) -{ - Sleep((DWORD)(usec / 1000)); -} - } diff --git a/vm/os-windows.hpp b/vm/os-windows.hpp index ea5e543d14..d1db3c26ac 100644 --- a/vm/os-windows.hpp +++ b/vm/os-windows.hpp @@ -45,5 +45,6 @@ inline static void init_signals() {} inline static void early_init() {} s64 current_micros(); +long getpagesize(); } diff --git a/vm/vm.hpp b/vm/vm.hpp index d75c3e0eaf..937c043343 100644 --- a/vm/vm.hpp +++ b/vm/vm.hpp @@ -559,7 +559,6 @@ struct factor_vm : factor_vm_data { // os-windows #if defined(WINDOWS) void sleep_micros(u64 usec); - long getpagesize(); const vm_char *vm_executable_path(); const vm_char *default_image_path(); void windows_image_path(vm_char *full_path, vm_char *temp_path, unsigned int length);