Skip to content

Commit 01ae072

Browse files
Describe more dyadic operators (#45) (#47)
1 parent 2f9d6ed commit 01ae072

File tree

3 files changed

+134
-13
lines changed

3 files changed

+134
-13
lines changed

ltx/exprs.tex

Lines changed: 123 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,9 +2202,15 @@ \subsection{Dyadic operators}
22022202
Source level binary operator ``\code{/}''.
22032203

22042204
\ifcSortSection{Modulo}{DyadicOperator}
2205-
Source level binary operator ``\code{\%}''.
2205+
The Euclidean modulo operator at the abstract machine semantics level.
2206+
At source level, this corresponds to the binary operator ``\code{\%}''.
2207+
When both operands are integers, the result is always non-negative, between $0$ and the absolute value of the second operand.
2208+
See also \sortref{Remainder}{DyadicOperator}.
22062209

22072210
\ifcSortSection{Remainder}{DyadicOperator}
2211+
Source level binary operator ``\code{\%}''.
2212+
When both operands are integers the result is truncated towards 0 as defined the corresponding ISO standards of C11 and up, and C++11 and up,
2213+
See also \sortref{Modulo}{DyadicOperator}.
22082214

22092215
\ifcSortSection{Bitand}{DyadicOperator}
22102216
Source level binary operator ``\code{\&}''.
@@ -2295,30 +2301,67 @@ \subsection{Dyadic operators}
22952301
Source level binary operator ``\code{.*}''.
22962302

22972303
\ifcSortSection{ArrowStar}{DyadicOperator}
2298-
Source level binary operator ``\code{->*}''
2304+
Source level binary operator ``\code{->*}''.
22992305

23002306
\ifcSortSection{Curry}{DyadicOperator}
2307+
Abstract machine operation binding the first parameter of a function taking at least one argument.
2308+
23012309
\ifcSortSection{Apply}{DyadicOperator}
2310+
Abstract machine operation applying a callable to an argument list (conceptually a tuple).
2311+
23022312
\ifcSortSection{Index}{DyadicOperator}
2313+
Source level binary operator ``\code{[]}'' as in ``\code{x[y]}''.
2314+
23032315
\ifcSortSection{DefaultAt}{DyadicOperator}
2316+
Abstraction machine operation corresponding to default construction of an object at a given address, e.g. ``\code{new(p) T}''.
2317+
23042318
\ifcSortSection{New}{DyadicOperator}
2319+
Abstract machine operation corresponding to allocating appropriate storage and constructing an object of a given type
2320+
and with a given initializer, e.g. ``\code{new T(x)}''.
2321+
23052322
\ifcSortSection{NewArray}{DyadicOperator}
2323+
Abstract machine operation corresponding to allocating appropriate storage and default constructing an array of a given element type and length,
2324+
e.g. ``\code{new T[n]}''.
2325+
23062326
\ifcSortSection{Destruct}{DyadicOperator}
2327+
Abstract machine operation corresponding to the explicit call of a destructor for an object, e.g. ``\code{x.~T()}''.
2328+
See also \sortref{DestructAt}{DyadicOperator}.
2329+
23072330
\ifcSortSection{DestructAt}{DyadicOperator}
2331+
Abstract machine operation corresponding to the explicit call of a destructor through a pointer, e.g. ``\code{p->~T()}''.
2332+
See also \sortref{Destruct}{DyadicOperator}.
2333+
23082334
\ifcSortSection{Cleanup}{DyadicOperator}
2335+
Abstract machine operation evaluating the first operand, then running the second operand as a cleanup (object destruction).
2336+
23092337
\ifcSortSection{Qualification}{DyadicOperator}
2338+
Abstract machine operation corresponding to implicit cv-qualification of the type of the expression,
2339+
e.g. as in from ``\code{T}'' to ``\code{const T}''.
2340+
23102341
\ifcSortSection{Promote}{DyadicOperator}
2342+
Abstract machine operation corresponding to integral or floating point promotion at the source level.
2343+
See also \sortref{Demote}{DyadicOperator}.
2344+
23112345
\ifcSortSection{Demote}{DyadicOperator}
2346+
Abstract machine operation corresponding to the inverse of an integral or floating point promotion at the source level.
2347+
See also \sortref{Promote}{DyadicOperator}.
2348+
23122349
\ifcSortSection{Coerce}{DyadicOperator}
2350+
Abstract machine operation corresponding to an implicit conversion at the source level that is neither
2351+
a promotion (\sortref{Promote}{DyadicOperator}) nor a demotion (\sortref{Demote}{DyadicOperator}).
2352+
23132353
\ifcSortSection{Rewrite}{DyadicOperator}
2354+
Abstract machine operation where the semantics of the first operand (source-level construct) is defined by that of the second operand.
2355+
23142356
\ifcSortSection{Bless}{DyadicOperator}
2315-
\ifcSortSection{Cast}{DyadicOperator}
2357+
Abstract machine operation proclaiming a valid object of given type (second operand) at a given address (first operand).
2358+
Note that this operation is not a placement-new operator (which would entail running a constructor).
23162359

2317-
A C-style cast operation.
2360+
\ifcSortSection{Cast}{DyadicOperator}
2361+
A C-style cast operation, e.g. ``\code{T)x}''
23182362

23192363
\ifcSortSection{ExplicitConversion}{DyadicOperator}
2320-
2321-
A functional cast notation.
2364+
A functional cast notation, e.g. ``\code{T(x)}''.
23222365

23232366
\ifcSortSection{ReinterpretCast}{DyadicOperator}
23242367
Source level operator ``\code{reinterpret\_cast}''.
@@ -2333,42 +2376,114 @@ \subsection{Dyadic operators}
23332376
Source level operator ``\code{dynamic\_cast}''.
23342377

23352378
\ifcSortSection{Narrow}{DyadicOperator}
2379+
Abstract machine operation corresponding to the runtime-checked conversion of a pointer of type ``\code{B*}''
2380+
(or reference of type ``\code{B\&}'') to a pointer of type ``\code{D*}'' (or reference of type ``\code{D\&}'')
2381+
where the class ``\code{D}'' is a derived class of ``\code{B}''.
2382+
23362383
\ifcSortSection{Widen}{DyadicOperator}
2384+
Abstract machine operation corresponding to the implicit conversion of a pointer of type ``\code{D*}'' (or
2385+
reference of type ``\code{D\&}'') to a pointer of type ``\code{B*}'' (or a reference of type ``\code{B&}''),
2386+
where the class ``\code{D}'' is a derived class of ``\code{B}''.
2387+
23372388
\ifcSortSection{Pretend}{DyadicOperator}
2389+
Abstract machine operation generalizing \code{bitcat} and \code{rinterpret\_cast}.
2390+
23382391
\ifcSortSection{Closure}{DyadicOperator}
2392+
Abstract machine operation pairing a function pointer (the second operand) and an environment of captured variables (the first operand)
2393+
for proper execution, as in lambda expressions.
2394+
23392395
\ifcSortSection{ZeroInitialize}{DyadicOperator}
2396+
Abstract machine operation performing zero-initialization of an object or a subobject.
2397+
See also \sortref{ClearStorage}{DyadicOperator}.
2398+
23402399
\ifcSortSection{ClearStorage}{DyadicOperator}
2341-
\ifcSortSection{Select}{DyadicOperator} Use of the source-level scope resolution operator ``\code{::}''.
2400+
Abstract machine operation clearing (i.e. setting all bytes to value $0$) a storage span.
2401+
See also \sortref{ZeroInitialize}{DyadicOperator}.
2402+
2403+
\ifcSortSection{Select}{DyadicOperator}
2404+
Use of the source-level scope resolution operator ``\code{::}''.
23422405
The first operand designates the scope, and the second operand designates the member to select.
23432406

23442407
\ifcSortSection{Msvc}{DyadicOperator}
23452408
This is a marker, not an actual operator. Dyadic operators with
23462409
value greater that this are MSVC extensions.
23472410

23482411
\ifcSortSection{MsvcTryCast}{DyadicOperator}
2412+
Abstract machine operation corresponding to the WinRT extension operation of ``\emph{try cast}''.
2413+
23492414
\ifcSortSection{MsvcCurry}{DyadicOperator}
2415+
Abstract machine operation corresponding to the MSVC extension of bound member function,
2416+
e.g. ``\code{this->fun}'' where \code{fun} is a non-static member function.
2417+
The first operand designates the object,
2418+
and the second operand designates the non-static member function.
2419+
See also \sortref{MsvcVirtualCurry}{DyadicOperator}.
2420+
23502421
\ifcSortSection{MsvcVirtualCurry}{DyadicOperator}
2422+
Abstract machine operation with similar semantics as that of \valueTag{DyadicOperator::MsvcCurry}, except
2423+
the resulting callable requires a dynamic dispatch.
2424+
23512425
\ifcSortSection{MsvcAlign}{DyadicOperator}
2426+
Abstract machine operation of aligning a pointer to an adequate storage address boundary.
2427+
23522428
\ifcSortSection{MsvcBitSpan}{DyadicOperator}
2429+
Abstract machine operation describing the span of a bitfield.
2430+
The first operand describes the offset (in number of bits) from the start of the storage hosting the bitfield.
2431+
The second operand describes the number of bits spanned by the bitfield.
2432+
23532433
\ifcSortSection{MsvcBitfieldAccess}{DyadicOperator}
2434+
Abstract machine operation describing access to a bitfield.
2435+
The first operand designates the start of the storage hosting the bitfield.
2436+
The second operand describes the span (\sortref{MsvcBitSpan}{DyadicOperator}) of the bitfield.
2437+
23542438
\ifcSortSection{MsvcObscureBitfieldAccess}{DyadicOperator}
2439+
Abstract machine operation describing access to a bitfield.
2440+
See also \sortref{MsvcBitfieldAccess}{DyadicOperator}.
2441+
23552442
\ifcSortSection{MsvcInitialize}{DyadicOperator}
2443+
Abstract machine operation describing the initialization of an object.
2444+
The first operand designates the storage to initialize.
2445+
The second operand designates the initializer or the function to run to perform initialization (in the case constructor).
2446+
23562447
\ifcSortSection{MsvcBuiltinOffsetOf}{DyadicOperator}
2448+
Source level ``\code{__builtin_offsetof}'' operator (\sortref{MsvcBuiltinOffsetOf}{SourceKeyword}).
2449+
23572450
\ifcSortSection{MsvcIsBaseOf}{DyadicOperator}
2451+
Source level ``\code{__is_base_of}'' operator (\sortref{MsvcIsBaseOf}{SourceKeyword}).
2452+
23582453
\ifcSortSection{MsvcIsConvertibleTo}{DyadicOperator}
2454+
Source level ``\code{__is_convertible_to}'' operator (\sortref{MsvcIsConvertibleTo}{SourceKeyword}).
2455+
23592456
\ifcSortSection{MsvcIsTriviallyAssignable}{DyadicOperator}
2457+
Source level ``\code{__is_trivially_assignable}'' operator (\sortref{MsvcIsTriviallyAssignable}{SourceKeyword}).
2458+
23602459
\ifcSortSection{MsvcIsNothrowAssignable}{DyadicOperator}
2460+
Source level ``\code{__is_nothrow_assignable}'' operator (\sortref{MsvcIsNothrowAssignable}{SourceKeyword}).
2461+
23612462
\ifcSortSection{MsvcIsAssignable}{DyadicOperator}
2463+
Source level ``\code{__is_assignable}'' operator (\sortref{MsvcIsAssignable}{SourceKeyword}).
2464+
23622465
\ifcSortSection{MsvcIsAssignableNocheck}{DyadicOperator}
2466+
Source level ``\code{__is_assignable_no_precondition_check}'' operator (\sortref{MsvcIsAssignableNocheck}{SourceKeyword})
23632467

23642468
\ifcSortSection{MsvcBuiltinBitCast}{DyadicOperator}
2365-
Source level ``\code{\_\_builtin\_bit\_cast}'' operator (\sortref{MsvcBuiltinBitCast}{SourceKeyword}).
2469+
Source level ``\code{__builtin_bit_cast}'' operator (\sortref{MsvcBuiltinBitCast}{SourceKeyword}).
23662470

23672471
\ifcSortSection{MsvcBuiltinIsLayoutCompatible}{DyadicOperator}
2472+
Source level ``\code{__builtin_is_layout_compatible}'' operator (\sortref{MsvcBuiltinIsLayoutCompatible}{SourceKeyword}).
2473+
23682474
\ifcSortSection{MsvcBuiltinIsPointerInterconvertibleBaseOf}{DyadicOperator}
2475+
Source level ``\code{__builtin_is_pointer_interconvertible_base_of}'' operator (\sortref{MsvcBuiltinIsPointerInterconvertibleBaseOf}{SourceKeyword}).
2476+
23692477
\ifcSortSection{MsvcBuiltinIsPointerInterconvertibleWithClass}{DyadicOperator}
2478+
Source level ``\code{__builtin_is_pointer_interconvertible_with_class}'' operator (\sortref{MsvcBuiltinIsPointerInterconvertibleWithClass}{SourceKeyword}).
2479+
23702480
\ifcSortSection{MsvcBuiltinIsCorrespondingMember}{DyadicOperator}
2481+
Source level ``\code{__builtin_is_corresponding_member}'' operator (\sortref{MsvcBuiltinIsCorrespondingMember}{SourceKeyword}).
2482+
23712483
\ifcSortSection{MsvcIntrinsic}{DyadicOperator}
2484+
Abstract machine operation corresponding to the call of an MSVC intrinsic operator of function.
2485+
The first operand is an integer constant describing the intrinsic; the second operand is the argument list.
2486+
See also \sortref{Call}{ExprSort}.
23722487

23732488

23742489
\subsection{Triadic operators}

ltx/ifc-format.sty

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
%% For anything math-y
77
\RequirePackage{euler}
88

9+
%% Control of figures.
10+
\RequirePackage{float}
11+
912
%% Everything is based on TikZ.
1013
\RequirePackage{tikz}
1114
%\usetikzlibrary{node-families}
@@ -28,6 +31,13 @@
2831
%% For formatting code
2932
\RequirePackage{listings}
3033

34+
%% Load this package last to get referencing commands right.
35+
\usepackage{hyperref}
36+
37+
\hypersetup{
38+
colorlinks=true
39+
}
40+
3141
%% Typesetting meta variables
3242
\newcommand{\var}[1]{\ensuremath{\mathtt{#1}}}
3343

@@ -120,7 +130,7 @@
120130
{\end{figure}}
121131

122132
% Reference to a labeled section describing a sort.
123-
\newcommand{\sortref}[2]{\secref{sec:ifc:#2:#1}}
133+
\newcommand{\sortref}[2]{\hyperref[sec:ifc:#2:#1]{#2::#1}}
124134

125135
\def\bitHeight{2em}
126136

ltx/ifc.tex

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44
\usepackage{fancyvrb}
55
\usepackage{times}
66
\usepackage{amsmath,amssymb}
7-
\usepackage{hyperref}
8-
%\usepackage{url}
97
\usepackage{ifc-format}
10-
\usepackage{tikz}
118
%\usepackage{graphicx}
129
%\usepackage[all]{xy}
13-
\usepackage{float}
1410

1511
\usetikzlibrary{matrix}
1612

0 commit comments

Comments
 (0)