DOC PREVIEW
Columbia COMS W4115 - FAST VECTOR PROCESSING LANGUAGE

This preview shows page 1-2-3 out of 10 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

FAST VECTOR PROCESSING LANGUAGE LANGUAGE REFERENCE MANUAL Gowri Kanugovi gk2263 columbia edu Pratap V Prabhu pvp2105 columbia edu Ravindra Babu Ganapathi rg2547 columbia edu 1 TABLE OF CONTENTS 1 Introduction 3 2 Lexical Conventions 3 2 1 Comments 3 2 2 Identifiers 3 2 3 Keywords 3 2 4 Constants 4 2 5 Operators 4 2 6 Separators 5 2 7 Block delimitation 5 2 8 Scoping 6 3 Data Types 6 3 1 Basic Type 6 4 Branching Construct 6 5 Looping Construct 7 6 Declarations 7 7 Functions 7 8 Example program 8 9 Lexer 8 10 Grammar 10 2 1 Introduction Fast Vector Processing Language FVPL allows programmers to transparently and efficiently utilize the power of SIMD instructions such as SSE SSE2 to compute large amount of sequential data at higher speeds Manipulation of large sequential data is common in various domains like image processing databases and cryptography but most of the current C C compilers generate slow native code for x86 family of processors The new processors include a vector processing unit which has the capability to compute data in parallel These instructions known as SIMD Single Instruction Multiple Data operate on 128 bits of data at a time FVPL aims to make use of the power of the new generation processors 2 Lexical Conventions FVPL comprises tokens such as keywords identifiers comments integer constants floating point constants operators and separators It is a free form language spaces tabs and new lines are ignored and considered to only serve as delimiters between tokens 2 1 Comments Single line comments in FVPL are begin with the characters like in the C language Multiline comments are also supported by FVPL Such comments begin with and should be terminated by 2 2 Identifiers Identifiers are sequence of letters digits and the underscore character The first letter however has to be only either an alphabet or the underscore character Identifiers cannot begin with a digit FVPL identifiers are case sensitive Following are some examples of FVPL identifiers Valid identifiers A foo a bar bar foo count2 Invalid identifiers 1A a foo bar 2 3 Keywords The following table summarizes the identifiers used as keywords in FVPL These keywords cannot be used as otherwise int for static Float dynamic int8 double void if dynamic return else main sizeof 3 2 4 Constants Constants provide programmers the ease of initializing any of their identifiers to one of the supported primitives The different types of constants supported by FVPL are 2 4 1 Integer constants Integers of FVPL consists of an optional or sign followed by any number of digits in the range of 0 9 2 4 2 Floating point constants Floating point numbers in FVPL comprises of an optional or sign followed by an integer of one or more digits This is followed by a decimal point which is then followed by an integer of one or more digits 2 5 Operators FVPL supports operations on both scalars and vectors 2 5 1 Operators on Scalars A programmer can perform the following actions on a scalar type in FVPL Arithmetic operators The operators and are supported by FVPL The semantics of the operators are similar to those of addition subtraction multiplication and division respectively The multiplication and division operators are however supported only for the int and float data types in FVPL The precedence and associativity of operators follows the same conventions as in the C language Bitwise logical operators FVPL supports bitwise logical AND OR XOR and NOT operations These are denoted by and respectively Assignment operators The assignment operator in FVPL is denoted the symbol This operator assigns the value of the right hand side expression to the left hand side expression Sizeof operator The sizeof operator returns the size of the operand in bytes The result is an integer value and thus can be used for assigning any integer variable 2 5 2 Operators on Vectors FVPL being a vector processing language tries to provide the programmer the maximum benefit of vector operations These operators can be used transparently by the programmer as though he is performing the operation on a scalar For example there is no need for him to maintain a loop to perform operation on each of the vector member The following operators are supported by FVPL Vector arithmetic operators The operators and are supported by FVPL The semantics of the operators are similar to those of addition subtraction multiplication and division respectively Addition of two vectors implies that each element of one vector is added to the corresponding element of the other vector For e g Three vectors A B and C The operation A B C implies that the sum of each of the element in A and B is multiplied by the corresponding element in C Vector logical operators FVPL supports bitwise logical operations on the vector elements The logical AND OR XOR and NOT are represented as and respectively Any logical vector operation implies that the operator is applied on each of its corresponding elements 4 For e g Two vectors A and B The operator A B implies a bitwise logical AND between every element of A and the corresponding element of B Vector assignment operator The vector assignment operator denoted by operator implies that every element of the vector is initialized with the value of the scalar element on the right hand side of the operator For e g Vector A A 5 assigns the value 5 to every element of A Vector initialization At the time of the creating the vector FVPL allows the programmer to initialize every element of the vector This is particularly useful when the programmer is trying to create small vectors and wants to assign distinct values to it manually For e g Vector A A 1 2 3 4 5 initializes the vector with 5 elements each with the value given in the braces Vector concatenation FVPL allows two vectors to be concatenated with each other by using the operator At the end of this operation we will have one vector which contains all the elements of the two vectors involved in the operation For e g Vector A 1 2 3 Vector B 4 5 6 A B returns 1 2 3 4 5 6 Vector copy In FVPL elements of one vector can be copied into the other vector by using the vector copy operator The operator used is same as the assignment operator but in this case the right hand side of the operation has to be a vector For e g Vector A B A B implies every element of B is copied into the corresponding position in A i e A 0 B 0 A 1 B 1 A 999 B 999 Vector casting FVPL supports casting of vector from float to integer or vice versa


View Full Document

Columbia COMS W4115 - FAST VECTOR PROCESSING LANGUAGE

Documents in this Course
YOLT

YOLT

13 pages

Lattakia

Lattakia

15 pages

EasyQL

EasyQL

14 pages

Photogram

Photogram

163 pages

Espresso

Espresso

27 pages

NumLang

NumLang

6 pages

EMPATH

EMPATH

14 pages

La Mesa

La Mesa

9 pages

JTemplate

JTemplate

238 pages

MATVEC

MATVEC

4 pages

TONEDEF

TONEDEF

14 pages

SASSi

SASSi

16 pages

JTemplate

JTemplate

39 pages

BATS

BATS

10 pages

Synapse

Synapse

11 pages

c.def

c.def

116 pages

TweaXML

TweaXML

108 pages

Load more
Loading Unlocking...
Login

Join to view FAST VECTOR PROCESSING LANGUAGE and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view FAST VECTOR PROCESSING LANGUAGE and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?