From 159dc46418638bdc5f7c1ae60e9fbf2fa5ffeb4a Mon Sep 17 00:00:00 2001 From: Michael Holman Date: Tue, 16 Jun 2015 15:40:47 -0700 Subject: [PATCH 1/2] update conversions to use the type dot --- AstSemantics.md | 52 ++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/AstSemantics.md b/AstSemantics.md index 3e762985..50bfe024 100644 --- a/AstSemantics.md +++ b/AstSemantics.md @@ -411,31 +411,31 @@ Floating point arithmetic follows the IEEE-754 standard, except that: ## Datatype conversions, truncations, reinterpretations, promotions, and demotions - * `int32_from_int64`: wrap a 64-bit integer to a 32-bit integer - * `int64_from_sint32`: extend a signed 32-bit integer to a 64-bit integer - * `int64_from_uint32`: extend an unsigned 32-bit integer to a 64-bit integer - * `sint32_from_float64`: truncate a 64-bit float to a signed integer - * `sint32_from_float32`: truncate a 32-bit float to a signed integer - * `uint32_from_float64`: truncate a 64-bit float to an unsigned integer - * `uint32_from_float32`: truncate a 32-bit float to an unsigned integer - * `sint64_from_float64`: truncate a 64-bit float to a signed integer - * `sint64_from_float32`: truncate a 32-bit float to a signed integer - * `uint64_from_float64`: truncate a 64-bit float to an unsigned integer - * `uint64_from_float32`: truncate a 32-bit float to an unsigned integer - * `int32_from_float32_bits`: reinterpret the bits of a 32-bit float as a 32-bit integer - * `int64_from_float64_bits`: reinterpret the bits of a 64-bit float as a 64-bit integer - * `float64_from_float32`: promote a 32-bit float to a 64-bit float - * `float64_from_sint32`: convert a signed integer to a 64-bit float - * `float64_from_uint32`: convert an unsigned integer to a 64-bit float - * `float64_from_sint64`: convert a signed integer to a 64-bit float - * `float64_from_uint64`: convert an unsigned integer to a 64-bit float - * `float32_from_float64`: demote a 64-bit float to a 32-bit float - * `float32_from_sint32`: convert a signed integer to a 32-bit float - * `float32_from_uint32`: convert an unsigned integer to a 32-bit float - * `float32_from_sint64`: convert a signed integer to a 32-bit float - * `float32_from_uint64`: convert an unsigned integer to a 32-bit float - * `float32_from_int32_bits`: reinterpret the bits of a 32-bit integer as a 32-bit float - * `float64_from_int64_bits`: reinterpret the bits of a 64-bit integer as a 64-bit float + * `int32.from_int64`: wrap a 64-bit integer to a 32-bit integer + * `int64.from_sint32`: extend a signed 32-bit integer to a 64-bit integer + * `int64.from_uint32`: extend an unsigned 32-bit integer to a 64-bit integer + * `sint32.from_float64`: truncate a 64-bit float to a signed integer + * `sint32.from_float32`: truncate a 32-bit float to a signed integer + * `uint32.from_float64`: truncate a 64-bit float to an unsigned integer + * `uint32.from_float32`: truncate a 32-bit float to an unsigned integer + * `sint64.from_float64`: truncate a 64-bit float to a signed integer + * `sint64.from_float32`: truncate a 32-bit float to a signed integer + * `uint64.from_float64`: truncate a 64-bit float to an unsigned integer + * `uint64.from_float32`: truncate a 32-bit float to an unsigned integer + * `int32.from_float32_bits`: reinterpret the bits of a 32-bit float as a 32-bit integer + * `int64.from_float64_bits`: reinterpret the bits of a 64-bit float as a 64-bit integer + * `float64.from_float32`: promote a 32-bit float to a 64-bit float + * `float64.from_sint32`: convert a signed integer to a 64-bit float + * `float64.from_uint32`: convert an unsigned integer to a 64-bit float + * `float64.from_sint64`: convert a signed integer to a 64-bit float + * `float64.from_uint64`: convert an unsigned integer to a 64-bit float + * `float32.from_float64`: demote a 64-bit float to a 32-bit float + * `float32.from_sint32`: convert a signed integer to a 32-bit float + * `float32.from_uint32`: convert an unsigned integer to a 32-bit float + * `float32.from_sint64`: convert a signed integer to a 32-bit float + * `float32.from_uint64`: convert an unsigned integer to a 32-bit float + * `float32.from_int32_bits`: reinterpret the bits of a 32-bit integer as a 32-bit float + * `float64.from_int64_bits`: reinterpret the bits of a 64-bit integer as a 64-bit float Wrapping and extension of integer values always succeed. Promotion and demotion of floating point values always succeed. @@ -450,6 +450,6 @@ Reinterpretations always succeed. Conversions from integer to floating point always succeed, though they may overflow to infinity or negative infinity as specified by IEEE-754. -Conversion from floating point to integer where IEEE-754 would specify an +Truncation from floating point to integer where IEEE-754 would specify an invalid operation exception (e.g. when the floating point value is NaN or outside the range which rounds to an integer in range) traps. From f6014452027431dc094cd431b14316e9c2c577cd Mon Sep 17 00:00:00 2001 From: Michael Holman Date: Tue, 16 Jun 2015 16:16:49 -0700 Subject: [PATCH 2/2] rename conversion ops --- AstSemantics.md | 50 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/AstSemantics.md b/AstSemantics.md index 50bfe024..a9bcecbd 100644 --- a/AstSemantics.md +++ b/AstSemantics.md @@ -411,31 +411,31 @@ Floating point arithmetic follows the IEEE-754 standard, except that: ## Datatype conversions, truncations, reinterpretations, promotions, and demotions - * `int32.from_int64`: wrap a 64-bit integer to a 32-bit integer - * `int64.from_sint32`: extend a signed 32-bit integer to a 64-bit integer - * `int64.from_uint32`: extend an unsigned 32-bit integer to a 64-bit integer - * `sint32.from_float64`: truncate a 64-bit float to a signed integer - * `sint32.from_float32`: truncate a 32-bit float to a signed integer - * `uint32.from_float64`: truncate a 64-bit float to an unsigned integer - * `uint32.from_float32`: truncate a 32-bit float to an unsigned integer - * `sint64.from_float64`: truncate a 64-bit float to a signed integer - * `sint64.from_float32`: truncate a 32-bit float to a signed integer - * `uint64.from_float64`: truncate a 64-bit float to an unsigned integer - * `uint64.from_float32`: truncate a 32-bit float to an unsigned integer - * `int32.from_float32_bits`: reinterpret the bits of a 32-bit float as a 32-bit integer - * `int64.from_float64_bits`: reinterpret the bits of a 64-bit float as a 64-bit integer - * `float64.from_float32`: promote a 32-bit float to a 64-bit float - * `float64.from_sint32`: convert a signed integer to a 64-bit float - * `float64.from_uint32`: convert an unsigned integer to a 64-bit float - * `float64.from_sint64`: convert a signed integer to a 64-bit float - * `float64.from_uint64`: convert an unsigned integer to a 64-bit float - * `float32.from_float64`: demote a 64-bit float to a 32-bit float - * `float32.from_sint32`: convert a signed integer to a 32-bit float - * `float32.from_uint32`: convert an unsigned integer to a 32-bit float - * `float32.from_sint64`: convert a signed integer to a 32-bit float - * `float32.from_uint64`: convert an unsigned integer to a 32-bit float - * `float32.from_int32_bits`: reinterpret the bits of a 32-bit integer as a 32-bit float - * `float64.from_int64_bits`: reinterpret the bits of a 64-bit integer as a 64-bit float + * `int32.wrap[int64]`: wrap a 64-bit integer to a 32-bit integer + * `int32.trunc_signed[float32]`: truncate a 32-bit float to a signed 32-bit integer + * `int32.trunc_signed[float64]`: truncate a 64-bit float to a signed 32-bit integer + * `int32.trunc_unsigned[float32]`: truncate a 32-bit float to an unsigned 32-bit integer + * `int32.trunc_unsigned[float64]`: truncate a 64-bit float to an unsigned 32-bit integer + * `int32.reinterpret[float32]`: reinterpret the bits of a 32-bit float as a 32-bit integer + * `int64.extend_signed[int32]`: extend a signed 32-bit integer to a 64-bit integer + * `int64.extend_unsigned[int32]`: extend an unsigned 32-bit integer to a 64-bit integer + * `int64.trunc_signed[float32]`: truncate a 32-bit float to a signed 64-bit integer + * `int64.trunc_signed[float64]`: truncate a 64-bit float to a signed 64-bit integer + * `int64.trunc_unsigned[float32]`: truncate a 32-bit float to an unsigned 64-bit integer + * `int64.trunc_unsigned[float64]`: truncate a 64-bit float to an unsigned 64-bit integer + * `int64.reinterpret[float64]`: reinterpret the bits of a 64-bit float as a 64-bit integer + * `float32.demote[float64]`: demote a 64-bit float to a 32-bit float + * `float32.cvt_signed[int32]`: convert a signed 32-bit integer to a 32-bit float + * `float32.cvt_signed[int64]`: convert a signed 64-bit integer to a 32-bit float + * `float32.cvt_unsigned[int32]`: convert an unsigned 32-bit integer to a 32-bit float + * `float32.cvt_unsigned[int64]`: convert an unsigned 64-bit integer to a 32-bit float + * `float32.reinterpret[int32]`: reinterpret the bits of a 32-bit integer as a 32-bit float + * `float64.promote[float32]`: promote a 32-bit float to a 64-bit float + * `float64.cvt_signed[int32]`: convert a signed 32-bit integer to a 64-bit float + * `float64.cvt_signed[int64]`: convert a signed 64-bit integer to a 64-bit float + * `float64.cvt_unsigned[int32]`: convert an unsigned 32-bit integer to a 64-bit float + * `float64.cvt_unsigned[int64]`: convert an unsigned 64-bit integer to a 64-bit float + * `float64.reinterpret[int64]`: reinterpret the bits of a 64-bit integer as a 64-bit float Wrapping and extension of integer values always succeed. Promotion and demotion of floating point values always succeed.