chore: Fix some typos

This commit is contained in:
Ahmed 2024-03-13 22:30:48 +00:00 committed by Veikka Tuominen
parent 400145ee3b
commit 5c8eda36d6
10 changed files with 14 additions and 14 deletions

View File

@ -114,7 +114,7 @@ pub inline fn addf3(comptime T: type, a: T, b: T) T {
// If a == -b, return +zero. // If a == -b, return +zero.
if (aSignificand == 0) return @bitCast(@as(Z, 0)); if (aSignificand == 0) return @bitCast(@as(Z, 0));
// If partial cancellation occured, we need to left-shift the result // If partial cancellation occurred, we need to left-shift the result
// and adjust the exponent: // and adjust the exponent:
if (aSignificand < integerBit << 3) { if (aSignificand < integerBit << 3) {
const shift = @as(i32, @intCast(@clz(aSignificand))) - @as(i32, @intCast(@clz(integerBit << 3))); const shift = @as(i32, @intCast(@clz(aSignificand))) - @as(i32, @intCast(@clz(integerBit << 3)));

View File

@ -25,7 +25,7 @@ inline fn addoXi4_generic(comptime ST: type, a: ST, b: ST, overflow: *c_int) ST
// and the sign of a+b+carry is the same as a (or equivalently b). // and the sign of a+b+carry is the same as a (or equivalently b).
// Slower routine: res = ~(a ^ b) & ((sum ^ a) // Slower routine: res = ~(a ^ b) & ((sum ^ a)
// Faster routine: res = (sum ^ a) & (sum ^ b) // Faster routine: res = (sum ^ a) & (sum ^ b)
// Overflow occured, iff (res < 0) // Overflow occurred, iff (res < 0)
if (((sum ^ a) & (sum ^ b)) < 0) if (((sum ^ a) & (sum ^ b)) < 0)
overflow.* = 1; overflow.* = 1;
return sum; return sum;

View File

@ -140,7 +140,7 @@ inline fn div(a: f128, b: f128) f128 {
var reciprocal: u128 = undefined; var reciprocal: u128 = undefined;
// NOTE: This operation is equivalent to __multi3, which is not implemented // NOTE: This operation is equivalent to __multi3, which is not implemented
// in some architechure // in some architecture
var r64q63: u128 = undefined; var r64q63: u128 = undefined;
var r64q127: u128 = undefined; var r64q127: u128 = undefined;
var r64cH: u128 = undefined; var r64cH: u128 = undefined;

View File

@ -145,7 +145,7 @@ const ObjectArray = struct {
} }
}; };
// Global stucture for Thread Storage. // Global structure for Thread Storage.
// It provides thread-safety for on-demand storage of Thread Objects. // It provides thread-safety for on-demand storage of Thread Objects.
const current_thread_storage = struct { const current_thread_storage = struct {
var key: std.c.pthread_key_t = undefined; var key: std.c.pthread_key_t = undefined;
@ -358,7 +358,7 @@ test "__emutls_get_address with default_value" {
try expect(y.* == 9012); // the modified storage persists try expect(y.* == 9012); // the modified storage persists
} }
test "test default_value with differents sizes" { test "test default_value with different sizes" {
if (!builtin.link_libc or builtin.os.tag != .openbsd) return error.SkipZigTest; if (!builtin.link_libc or builtin.os.tag != .openbsd) return error.SkipZigTest;
const testType = struct { const testType = struct {

View File

@ -58,7 +58,7 @@ pub fn __fmodx(a: f80, b: f80) callconv(.C) f80 {
// - fmodx(val, NaN) // - fmodx(val, NaN)
// - fmodx(inf, val) // - fmodx(inf, val)
// The sign on checked values does not matter. // The sign on checked values does not matter.
// Doing (a * b) / (a * b) procudes undefined results // Doing (a * b) / (a * b) produces undefined results
// because the three cases always produce undefined calculations: // because the three cases always produce undefined calculations:
// - 0 / 0 // - 0 / 0
// - val * NaN // - val * NaN
@ -163,7 +163,7 @@ pub fn fmodq(a: f128, b: f128) callconv(.C) f128 {
// - fmodq(val, NaN) // - fmodq(val, NaN)
// - fmodq(inf, val) // - fmodq(inf, val)
// The sign on checked values does not matter. // The sign on checked values does not matter.
// Doing (a * b) / (a * b) procudes undefined results // Doing (a * b) / (a * b) produces undefined results
// because the three cases always produce undefined calculations: // because the three cases always produce undefined calculations:
// - 0 / 0 // - 0 / 0
// - val * NaN // - val * NaN
@ -239,7 +239,7 @@ pub fn fmodq(a: f128, b: f128) callconv(.C) f128 {
aPtr_u64[high_index] = highA; aPtr_u64[high_index] = highA;
aPtr_u64[low_index] = lowA; aPtr_u64[low_index] = lowA;
// Combine the exponent with the sign, normalize if happend to be denormalized // Combine the exponent with the sign, normalize if happened to be denormalized
if (expA <= 0) { if (expA <= 0) {
aPtr_u16[exp_and_sign_index] = @as(u16, @truncate(@as(u32, @bitCast((expA +% 120))))) | signA; aPtr_u16[exp_and_sign_index] = @as(u16, @truncate(@as(u32, @bitCast((expA +% 120))))) | signA;
amod *= 0x1p-120; amod *= 0x1p-120;

View File

@ -13,7 +13,7 @@ const __muldf3 = @import("muldf3.zig").__muldf3;
const __mulsf3 = @import("mulsf3.zig").__mulsf3; const __mulsf3 = @import("mulsf3.zig").__mulsf3;
// return true if equal // return true if equal
// use two 64-bit integers intead of one 128-bit integer // use two 64-bit integers instead of one 128-bit integer
// because 128-bit integer constant can't be assigned directly // because 128-bit integer constant can't be assigned directly
fn compareResultLD(result: f128, expectedHi: u64, expectedLo: u64) bool { fn compareResultLD(result: f128, expectedHi: u64, expectedLo: u64) bool {
const rep: u128 = @bitCast(result); const rep: u128 = @bitCast(result);

View File

@ -174,14 +174,14 @@ const PIo2 = [_]f64{
/// z = (z-x[i])*2**24 /// z = (z-x[i])*2**24
/// ///
/// ///
/// y[] ouput result in an array of double precision numbers. /// y[] output result in an array of double precision numbers.
/// The dimension of y[] is: /// The dimension of y[] is:
/// 24-bit precision 1 /// 24-bit precision 1
/// 53-bit precision 2 /// 53-bit precision 2
/// 64-bit precision 2 /// 64-bit precision 2
/// 113-bit precision 3 /// 113-bit precision 3
/// The actual value is the sum of them. Thus for 113-bit /// The actual value is the sum of them. Thus for 113-bit
/// precison, one may have to do something like: /// precision, one may have to do something like:
/// ///
/// long double t,w,r_head, r_tail; /// long double t,w,r_head, r_tail;
/// t = (long double)y[2] + (long double)y[1]; /// t = (long double)y[2] + (long double)y[1];

View File

@ -34,7 +34,7 @@ inline fn suboXi4_generic(comptime ST: type, a: ST, b: ST, overflow: *c_int) ST
// and the sign of a-b-carry is opposite of a (or equivalently same as b). // and the sign of a-b-carry is opposite of a (or equivalently same as b).
// Faster routine: res = (a ^ b) & (sum ^ a) // Faster routine: res = (a ^ b) & (sum ^ a)
// Slower routine: res = (sum^a) & ~(sum^b) // Slower routine: res = (sum^a) & ~(sum^b)
// Overflow occured, iff (res < 0) // Overflow occurred, iff (res < 0)
if (((a ^ b) & (sum ^ a)) < 0) if (((a ^ b) & (sum ^ a)) < 0)
overflow.* = 1; overflow.* = 1;
return sum; return sum;

View File

@ -19,7 +19,7 @@ noinline fn frame3(expected: *[4]usize, unwound: *[4]usize) void {
} }
noinline fn frame2(expected: *[4]usize, unwound: *[4]usize) void { noinline fn frame2(expected: *[4]usize, unwound: *[4]usize) void {
// Excercise different __unwind_info / DWARF CFI encodings by forcing some registers to be restored // Exercise different __unwind_info / DWARF CFI encodings by forcing some registers to be restored
if (builtin.target.ofmt != .c) { if (builtin.target.ofmt != .c) {
switch (builtin.cpu.arch) { switch (builtin.cpu.arch) {
.x86 => { .x86 => {

View File

@ -243,7 +243,7 @@ fn gather_extensions(allocator: Allocator, spirv_registry_root: []const u8) ![]c
if (!std.mem.endsWith(u8, ext_entry.name, ".asciidoc")) if (!std.mem.endsWith(u8, ext_entry.name, ".asciidoc"))
continue; continue;
// Unfortunately, some extension filenames are incorrect, so we need to look for the string in tne 'Name Strings' section. // Unfortunately, some extension filenames are incorrect, so we need to look for the string in the 'Name Strings' section.
// This has the following format: // This has the following format:
// ``` // ```
// Name Strings // Name Strings