Pubtex Output 2003.06.03:1113
Total Page:16
File Type:pdf, Size:1020Kb
Cray Assembly Language (CAL) for Cray X1™ Systems Reference Manual S–2314–50 © 2001, 2003 Cray Inc. All Rights Reserved. This manual or parts thereof may not be reproduced in any form unless permitted by contract or by written permission of Cray Inc. U.S. GOVERNMENT RESTRICTED RIGHTS NOTICE The Computer Software is delivered as "Commercial Computer Software" as defined in DFARS 48 CFR 252.227-7014. All Computer Software and Computer Software Documentation acquired by or for the U.S. Government is provided with Restricted Rights. Use, duplication or disclosure by the U.S. Government is subject to the restrictions described in FAR 48 CFR 52.227-14 or DFARS 48 CFR 252.227-7014, as applicable. Technical Data acquired by or for the U.S. Government, if any, is provided with Limited Rights. Use, duplication or disclosure by the U.S. Government is subject to the restrictions described in FAR 48 CFR 52.227-14 or DFARS 48 CFR 252.227-7013, as applicable. Autotasking, CF77, Cray, Cray Ada, Cray Channels, Cray Chips, CraySoft, Cray Y-MP, Cray-1, CRInform, CRI/TurboKiva, HSX, LibSci, MPP Apprentice, SSD, SuperCluster, UNICOS, UNICOS/mk, and X-MP EA are federally registered trademarks and Because no workstation is an island, CCI, CCMT, CF90, CFT, CFT2, CFT77, ConCurrent Maintenance Tools, COS, Cray Animation Theater, Cray APP, Cray C90, Cray C90D, Cray CF90, Cray C++ Compiling System, CrayDoc, Cray EL, Cray Fortran Compiler, Cray J90, Cray J90se, Cray J916, Cray J932, CrayLink, Cray MTA, Cray MTA-2, Cray MTX, Cray NQS, Cray/REELlibrarian, Cray S-MP, Cray SSD-T90, Cray SV1, Cray SV1ex, Cray SV2, Cray SX-5, Cray SX-6, Cray T90, Cray T94, Cray T916, Cray T932, Cray T3D, Cray T3D MC, Cray T3D MCA, Cray T3D SC, Cray T3E, CrayTutor, Cray X1, Cray X-MP, Cray XMS, Cray-2, CSIM, CVT, Delivering the power . ., DGauss, Docview, EMDS, GigaRing, HEXAR, IOS, ND Series Network Disk Array, Network Queuing Environment, Network Queuing Tools, OLNET, RQS, SEGLDR, SMARTE, SUPERLINK, System Maintenance and Remote Testing Environment, Trusted UNICOS, UNICOS MAX, and UNICOS/mp are trademarks of Cray Inc. AIX and IBM are trademarks and RISC System/6000 is a product of International Business Machines Corporation. AXP and DEC are trademarks of Digital Equipment Corporation. DynaText, DynaVerse, DynaWeb, and EBT are trademarks of Electronic Book Technologies, Inc. HP and HP-UX are trademarks and HP 9000 is a product of Hewlett-Packard Company. IRIX, Mindshare, SGI, and Silicon Graphics are trademarks of Silicon Graphics, Inc. Netscape and Netscape Navigator are trademarks of Netscape Communications Corporation. NFS, Solaris, SPARC, Sun, and SunOS are trademarks of Sun Microsystems, Inc. Open Software Foundation, OSF, and OSF/1 are trademarks of Open Software Foundation, Inc. UNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Limited. The UNICOS, UNICOS/mk, and UNICOS/mp operating systems are derived from UNIX System V. These operating systems are also based in part on the Fourth Berkeley Software Distribution (BSD) under license from The Regents of the University of California. Record of Revision Version Description 1.0 August 19, 2002 Draft version to support the Programming Environment 4.1 release. 1.1 June 2003 Supports the Cray Assember 1.1 and Programming Environment 5.0 releases. S–2314–50 i Contents Page Preface xv Accessing Cray Documentation . xv Error Message Explanations . xvi Typographical Conventions . xvi Ordering Documentation . xvii Reader Comments . xviii Introduction [1] 1 Capabilities . 1 Related Publications . 2 Cray X1 Instruction Set Overview [2] 3 Data Types . 3 Integer . 3 Floating-point . 4 Addresses . 4 Registers . 5 Address and Scalar Registers . 6 Vector Registers . 7 Vector Length Register . 8 Mask Registers . 8 Vector Carry Register . 8 Bit Matrix Multiply Register . 9 Control Registers . 9 Program Counter . 9 Performance Counters . 9 CAL Source Statement Format . 10 S–2314–50 iii Cray Assembly Language (CAL) for Cray X1™ Systems Reference Manual Page Scalar Instructions . 11 Immediate Loads . 11 Scalar Memory References . 12 Branches and Jumps . 13 Scalar Integer Functions . 14 Scalar Floating-point Functions . 17 Bit Matrix Multiplication . 18 Byte and Halfword Access . 19 Scalar Atomic Memory Operations . 20 Other Scalar Instructions . 21 Vector Instructions . 22 Elemental Vector Operations . 22 Vector Memory References . 22 Elemental Vector Functions . 23 Mask Operations . 25 Other Vector Instructions . 27 Memory Ordering . 28 Summary of Rules . 30 Special Syntax Forms . 31 CAL Pseudo Instruction Overview [3] 33 Pseudo Instruction Format . 34 Program Control . 34 Loader Linkage . 34 Mode Control . 35 Section Control . 35 Message Control . 35 Listing Control . 36 Symbol Definition . 36 Data Definition . 36 Conditional Assembly . 37 iv S–2314–50 Contents Page Micro Definition . 37 Defined Sequences . 39 File Control . 40 CAL Program Organization [4] 41 Program Modules . 41 Global Definitions and Local Definitions . 41 Program Segments . 42 Program . 42 Sections . 44 Examples . 44 Example 1: Global and Local Definitions . 44 Example 2: Sections and Qualifiers . 45 CAL Assembler Invocation [5] 47 Assembler Command Line . 47 Environment Variables . 52 ASDEF Environment Variable . 53 LPP Environment Variable . 53 TMPDIR Environment Variable . 53 TARGET Shell Variable . 53 Assembler Execution . 53 Reading Source Files . 54 Using Binary Definition Files . 54 CPU Compatibility Checking . 55 Multiple References to a Definition . 55 Included Files . 57 Source Statement Listing File . 57 Source Statement Listing . 58 Cross-reference Listing . 60 Diagnostic Messages . 62 S–2314–50 v Cray Assembly Language (CAL) for Cray X1™ Systems Reference Manual Page Diagnostic Message Listing File . 63 Object File . 63 Creating a Binary Definition File . 63 Symbols . 64 Macros . 64 Opdefs . 65 Opsyns . 65 Micros . 65 Linking . 65 CAL Source Statements [6] 67 Source Statement Format . 68 Label Field . 68 Result Field . 68 Operand Field . 68 Comment Field . 69 Old Format . 69 Case Sensitivity . 70 Symbols . 70 Symbol Qualification . 71 Unqualified Symbol . 71 Qualified Symbols . 72 Symbol Definition . 73 Symbol Attributes . 74 Type Attribute . 74 Relative Attributes . 74 Redefinable Attributes . 76 Symbol Reference . 76 Tags............................ 76 Constants . 78 Floating Constant . 78 vi S–2314–50 Contents Page Integer Constant . 80 Character Constants . 82 Data Items . 82 Floating Data Item . 83 Integer Data Item . 84 Character Data Item . 84 Literals . 85 Micros . 88 Location Elements . ..