max_stars_repo_path
stringlengths
4
261
max_stars_repo_name
stringlengths
6
106
max_stars_count
int64
0
38.8k
id
stringlengths
1
6
text
stringlengths
7
1.05M
programs/oeis/055/A055438.asm
karttu/loda
1
92294
<gh_stars>1-10 ; A055438: a(n) = 100*n^2 + n. ; 101,402,903,1604,2505,3606,4907,6408,8109,10010,12111,14412,16913,19614,22515,25616,28917,32418,36119,40020,44121,48422,52923,57624,62525,67626,72927,78428,84129,90030,96131,102432,108933,115634,122535,129636,136937,144438,152139,160040,168141,176442,184943,193644,202545,211646,220947,230448,240149,250050,260151,270452,280953,291654,302555,313656,324957,336458,348159,360060,372161,384462,396963,409664,422565,435666,448967,462468,476169,490070,504171,518472,532973,547674,562575,577676,592977,608478,624179,640080,656181,672482,688983,705684,722585,739686,756987,774488,792189,810090,828191,846492,864993,883694,902595,921696,940997,960498,980199,1000100,1020201,1040502,1061003,1081704,1102605,1123706,1145007,1166508,1188209,1210110,1232211,1254512,1277013,1299714,1322615,1345716,1369017,1392518,1416219,1440120,1464221,1488522,1513023,1537724,1562625,1587726,1613027,1638528,1664229,1690130,1716231,1742532,1769033,1795734,1822635,1849736,1877037,1904538,1932239,1960140,1988241,2016542,2045043,2073744,2102645,2131746,2161047,2190548,2220249,2250150,2280251,2310552,2341053,2371754,2402655,2433756,2465057,2496558,2528259,2560160,2592261,2624562,2657063,2689764,2722665,2755766,2789067,2822568,2856269,2890170,2924271,2958572,2993073,3027774,3062675,3097776,3133077,3168578,3204279,3240180,3276281,3312582,3349083,3385784,3422685,3459786,3497087,3534588,3572289,3610190,3648291,3686592,3725093,3763794,3802695,3841796,3881097,3920598,3960299,4000200,4040301,4080602,4121103,4161804,4202705,4243806,4285107,4326608,4368309,4410210,4452311,4494612,4537113,4579814,4622715,4665816,4709117,4752618,4796319,4840220,4884321,4928622,4973123,5017824,5062725,5107826,5153127,5198628,5244329,5290230,5336331,5382632,5429133,5475834,5522735,5569836,5617137,5664638,5712339,5760240,5808341,5856642,5905143,5953844,6002745,6051846,6101147,6150648,6200349,6250250 mov $1,$0 add $0,1 mov $2,$0 mul $2,10 pow $2,2 add $1,$2 add $1,1
src/base/beans/util-beans-objects-enums.adb
RREE/ada-util
60
24203
<reponame>RREE/ada-util ----------------------------------------------------------------------- -- Util.Beans.Objects.Enums -- Helper conversion for discrete types -- Copyright (C) 2010, 2016, 2017 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Characters.Conversions; package body Util.Beans.Objects.Enums is use Ada.Characters.Conversions; Value_Range : constant Long_Long_Integer := T'Pos (T'Last) - T'Pos (T'First) + 1; -- ------------------------------ -- Integer Type -- ------------------------------ type Enum_Type is new Int_Type with null record; -- Get the type name overriding function Get_Name (Type_Def : in Enum_Type) return String; overriding function To_String (Type_Def : in Enum_Type; Value : in Object_Value) return String; -- ------------------------------ -- Get the type name -- ------------------------------ overriding function Get_Name (Type_Def : Enum_Type) return String is pragma Unreferenced (Type_Def); begin return "Enum"; end Get_Name; -- ------------------------------ -- Convert the value into a string. -- ------------------------------ overriding function To_String (Type_Def : in Enum_Type; Value : in Object_Value) return String is pragma Unreferenced (Type_Def); begin return T'Image (T'Val (Value.Int_Value)); end To_String; Value_Type : aliased constant Enum_Type := Enum_Type '(null record); -- ------------------------------ -- Create an object from the given value. -- ------------------------------ function To_Object (Value : in T) return Object is begin return Object '(Controlled with V => Object_Value '(Of_Type => TYPE_INTEGER, Int_Value => Long_Long_Integer (T'Pos (Value))), Type_Def => Value_Type'Access); end To_Object; -- ------------------------------ -- Convert the object into a value. -- Raises Constraint_Error if the object cannot be converter to the target type. -- ------------------------------ function To_Value (Value : in Util.Beans.Objects.Object) return T is begin case Value.V.Of_Type is when TYPE_INTEGER => if ROUND_VALUE then return T'Val (Value.V.Int_Value mod Value_Range); else return T'Val (Value.V.Int_Value); end if; when TYPE_BOOLEAN => return T'Val (Boolean'Pos (Value.V.Bool_Value)); when TYPE_FLOAT => if ROUND_VALUE then return T'Val (To_Long_Long_Integer (Value) mod Value_Range); else return T'Val (To_Long_Long_Integer (Value)); end if; when TYPE_STRING => if Value.V.String_Proxy = null then raise Constraint_Error with "The object value is null"; end if; return T'Value (Value.V.String_Proxy.Value); when TYPE_WIDE_STRING => if Value.V.Wide_Proxy = null then raise Constraint_Error with "The object value is null"; end if; return T'Value (To_String (Value.V.Wide_Proxy.Value)); when TYPE_NULL => raise Constraint_Error with "The object value is null"; when TYPE_TIME => raise Constraint_Error with "Cannot convert a date into a discrete type"; when TYPE_BEAN => raise Constraint_Error with "Cannot convert a bean into a discrete type"; when TYPE_ARRAY => raise Constraint_Error with "Cannot convert an array into a discrete type"; end case; end To_Value; end Util.Beans.Objects.Enums;
alloy4fun_models/trainstlt/models/2/P4ytnCsDz4ZGi4b7T.als
Kaixi26/org.alloytools.alloy
0
3123
<filename>alloy4fun_models/trainstlt/models/2/P4ytnCsDz4ZGi4b7T.als<gh_stars>0 open main pred idP4ytnCsDz4ZGi4b7T_prop3 { always( all t:Train | no pos.t) } pred __repair { idP4ytnCsDz4ZGi4b7T_prop3 } check __repair { idP4ytnCsDz4ZGi4b7T_prop3 <=> prop3o }
gdb/testsuite/gdb.ada/scoped_watch/pck.adb
greyblue9/binutils-gdb
1
22905
<gh_stars>1-10 -- Copyright 2017-2021 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package body Pck is function Get_Val (Seed: Integer; Off_By_One: Boolean) return Integer is Result : Integer := Seed; begin if Off_By_One then -- START Result := Result - 1; end if; Result := Result * 8; if Off_By_One then Result := Result + 1; end if; return Result; end Get_Val; procedure Do_Nothing (Val: in out Integer) is begin null; end Do_Nothing; procedure Call_Me is begin null; end Call_Me; procedure Increment (Val : in out Integer) is begin Val := Val + 1; end Increment; end Pck;
cell.asm
duduFreire/hellTakerASM
0
88876
# BYTE : i 0 # BYTE : j 1 # BYTE: size 2 # BYTE: hasTreasure 3 # BYTE: hasKey 4 # BYTE: hasBlock 5 # BYTE: hasSpike 6 # BYTE: spikeAlternates 7 # BYTE: hasMonster 8 # BYTE: hasPlayer 9 # BYTE: isGoal 10 # BYTE: isWalkable 11 # BYTE: mapPart 12 # TOTAL SIZE : 13 BYTES .data .include "resources/monsterImage.s" .include "resources/keyImage.s" .include "resources/spikeImage.s" .include "resources/blockImage.s" .include "resources/treasureImage.s" .include "resources/heroTest.data" .text # a0 = this # a1 = i # a2 = j # a3 = info cell_initialize: sb a1, 0(a0) sb a2, 1(a0) li t0, 28 sb t0, 2(a0) # Set all flags except mapPart to false. sb zero, 3(a0) sw zero, 4(a0) sw zero, 8(a0) li t0, 1 sb t0, 12(a0) li t1, 'p' bne a3, t1, cell_intiialize_if1 sb t0, 9(a0) sb t0, 11(a0) cell_intiialize_if1: li t1, 'g' bne a3, t1, cell_intiialize_if2 sb t0, 10(a0) cell_intiialize_if2: li t1, 's' bne a3, t1, cell_intiialize_if3 sb t0, 6(a0) sb t0, 11(a0) cell_intiialize_if3: li t1, 'a' bne a3, t1, cell_intiialize_if4 sb t0, 6(a0) sb t0, 11(a0) sb t0, 7(a0) cell_intiialize_if4: li t1, 'm' bne a3, t1, cell_intiialize_if5 sb t0, 8(a0) cell_intiialize_if5: li t1, 'b' bne a3, t1, cell_intiialize_if6 sb t0, 5(a0) cell_intiialize_if6: li t1, 'k' bne a3, t1, cell_intiialize_if7 sb t0, 4(a0) sb t0, 11(a0) cell_intiialize_if7: li t1, 't' bne a3, t1, cell_intiialize_if8 sb t0, 3(a0) cell_intiialize_if8: li t1, 'w' bne a3, t1, cell_intiialize_if9 sb t0, 11(a0) cell_intiialize_if9: li t1, 'z' bne a3, t1, cell_intiialize_if10 sb t0, 5(a0) sb t0, 6(a0) cell_intiialize_if10: li t1, '0' bne a3, t1, cell_intiialize_if11 sb zero, 12(a0) cell_intiialize_if11: ret # Draws rectangle with sides w and h at coordinate x, y with color "color". # a0 = x, a1 = y, a2 = w, a3 = h, a4 = color, a5 = frame # t0 = startAdress # t1 = columnCounter # t2 = lineCounter cell_drawRect: # t0 = frame == 0 ? 0xFF0 : 00xFF1 li t0, 0xFF0 add t0, t0, a5 slli t0, t0, 20 # t0 = screen + x add t0, t0, a0 # t1 = 320 * y li t1, 320 mul t1, t1, a1 # t0 = screen + x + 320*y add t0, t0, t1 mv t1, zero mv t2, zero cell_drawRect_loop: sw a4, 0(t0) addi t0, t0, 4 addi t1, t1, 4 blt t1, a2, cell_drawRect_loop addi t2, t2, 1 beq t2, a3, cell_drawRect_exit addi t0, t0, 320 sub t0, t0, a2 mv t1, zero j cell_drawRect_loop cell_drawRect_exit: ret # a0 = this # a1 = frame cell_display: addi sp, sp, -20 sw ra, 0(sp) sw a0, 4(sp) sw a1, 8(sp) # t1 = size lbu t1, 2(a0) # t2 = i lbu t2, 0(a0) # t2 = i * size mul t2, t2, t1 # t3 = j lbu t3, 1(a0) # t1 = j * size mul t1, t1, t3 # *(sp+12) = this.i * size sw t2, 12(sp) # *(sp+16) = this.j * size sw t1, 16(sp) # t0 = mapPart lbu t0, 12(a0) # if !mapPart: ret beq t0, zero, cell_display_if1 # t3 = this lw t3, 4(sp) lw a0, 12(sp) lw a5, 8(sp) lw a1, 16(sp) li a4, 0x4c4c4c4c lbu a2, 2(t3) mv a3, a2 call cell_drawRect # if hasMonster lw t0, 4(sp) lbu t0, 8(t0) beq t0, zero, cell_display_if2 # Draw monster. la a0, monsterImage lw a1, 12(sp) lw a2, 16(sp) lw a3, 8(sp) call drawImage j cell_display_if1 cell_display_if2: # if hasKey lw t0, 4(sp) lbu t0, 4(t0) beq t0, zero, cell_display_if4 # Draw key la a0, keyImage lw a1, 12(sp) lw a2, 16(sp) lw a3, 8(sp) call drawImage j cell_display_if1 cell_display_if4: # if hasBlock lw t0, 4(sp) lbu t0, 5(t0) beq t0, zero, cell_display_if3 # Draw block la a0, blockImage lw a1, 12(sp) lw a2, 16(sp) lw a3, 8(sp) call drawImage cell_display_if3: # if hasSpike lw t0, 4(sp) lbu t0, 6(t0) beq t0, zero, cell_display_if5 # Draw spike la a0, spikeImage lw a1, 12(sp) lw a2, 16(sp) lw a3, 8(sp) call drawImage j cell_display_if7 cell_display_if5: # if hasTreasure lw t0, 4(sp) lbu t0, 3(t0) beq t0, zero, cell_display_if6 # Draw treasure la a0, treasureImage lw a1, 12(sp) lw a2, 16(sp) lw a3, 8(sp) call drawImage j cell_display_if1 cell_display_if6: # if hasGoal lw t0, 4(sp) lbu t0, 10(t0) beq t0, zero, cell_display_if7 # Draw goal li t0, 792 la t1, currentLevel lbu t1, 0(t1) mul t0, t0, t1 la a0, imagesLabel add a0, a0, t0 lw a1, 12(sp) lw a2, 16(sp) lw a3, 8(sp) call drawImage j cell_display_if1 cell_display_if7: # if hasPlayer lw t0, 4(sp) lbu t0, 9(t0) beq t0, zero, cell_display_if1 # Draw player la a0, heroTest lw a1, 12(sp) lw a2, 16(sp) lw a3, 8(sp) call drawImage cell_display_if1: lw ra, 0(sp) addi sp, sp, 20 ret
src/fot/FOTC/Base/PropertiesI.agda
asr/fotc
11
15587
<filename>src/fot/FOTC/Base/PropertiesI.agda ------------------------------------------------------------------------------ -- FOTC terms properties ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module FOTC.Base.PropertiesI where open import Common.FOL.Relation.Binary.EqReasoning open import FOTC.Base ------------------------------------------------------------------------------ -- Congruence properties ·-leftCong : ∀ {a b c} → a ≡ b → a · c ≡ b · c ·-leftCong refl = refl ·-rightCong : ∀ {a b c} → b ≡ c → a · b ≡ a · c ·-rightCong refl = refl ·-cong : ∀ {a b c d} → a ≡ b → c ≡ d → a · c ≡ b · d ·-cong refl refl = refl succCong : ∀ {m n} → m ≡ n → succ₁ m ≡ succ₁ n succCong refl = refl predCong : ∀ {m n} → m ≡ n → pred₁ m ≡ pred₁ n predCong refl = refl ifCong₁ : ∀ {b b' t t'} → b ≡ b' → (if b then t else t') ≡ (if b' then t else t') ifCong₁ refl = refl ifCong₂ : ∀ {b t₁ t₂ t} → t₁ ≡ t₂ → (if b then t₁ else t) ≡ (if b then t₂ else t) ifCong₂ refl = refl ifCong₃ : ∀ {b t t₁ t₂} → t₁ ≡ t₂ → (if b then t else t₁) ≡ (if b then t else t₂) ifCong₃ refl = refl ------------------------------------------------------------------------------ -- Injective properties succInjective : ∀ {m n} → succ₁ m ≡ succ₁ n → m ≡ n succInjective {m} {n} h = m ≡⟨ sym (pred-S m) ⟩ pred₁ (succ₁ m) ≡⟨ predCong h ⟩ pred₁ (succ₁ n) ≡⟨ pred-S n ⟩ n ∎ ------------------------------------------------------------------------------ -- Discrimination rules S≢0 : ∀ {n} → succ₁ n ≢ zero S≢0 S≡0 = 0≢S (sym S≡0)
programs/oeis/199/A199910.asm
karttu/loda
0
241269
; A199910: Number of -n..n arrays x(0..2) of 3 elements with zero sum, and adjacent elements not equal modulo three (with -1 modulo 3 = 2). ; 6,12,24,42,60,84,114,144,180,222,264,312,366,420,480,546,612,684,762,840,924,1014,1104,1200,1302,1404,1512,1626,1740,1860,1986,2112,2244,2382,2520,2664,2814,2964,3120,3282,3444,3612,3786,3960,4140,4326,4512,4704,4902,5100,5304,5514,5724,5940,6162,6384,6612,6846,7080,7320,7566,7812,8064,8322,8580,8844,9114,9384,9660,9942,10224,10512,10806,11100,11400,11706,12012,12324,12642,12960,13284,13614,13944,14280,14622,14964,15312,15666,16020,16380,16746,17112,17484,17862,18240,18624,19014,19404,19800,20202,20604,21012,21426,21840,22260,22686,23112,23544,23982,24420,24864,25314,25764,26220,26682,27144,27612,28086,28560,29040,29526,30012,30504,31002,31500,32004,32514,33024,33540,34062,34584,35112,35646,36180,36720,37266,37812,38364,38922,39480,40044,40614,41184,41760,42342,42924,43512,44106,44700,45300,45906,46512,47124,47742,48360,48984,49614,50244,50880,51522,52164,52812,53466,54120,54780,55446,56112,56784,57462,58140,58824,59514,60204,60900,61602,62304,63012,63726,64440,65160,65886,66612,67344,68082,68820,69564,70314,71064,71820,72582,73344,74112,74886,75660,76440,77226,78012,78804,79602,80400 mov $1,$0 pow $0,2 div $0,3 add $1,$0 mul $1,6 add $1,6
test/Fail/Issue4518.agda
shlevy/agda
1,989
5161
<gh_stars>1000+ -- Andreas, 2020-03-18, issue 4518, reported by strangeglyph -- Better error message when parsing of LHS fails open import Agda.Builtin.Nat using (Nat) -- forgot to import constructors postulate foo : Nat test : Set₁ test with foo ... | zero = Set ... | suc n = Set -- ERROR: -- Could not parse the left-hand side test | suc n -- NEW INFORMATION: -- Problematic expression: (suc n)
alloy4fun_models/trashltl/models/9/AcypBbFjo9cKzyFPu.als
Kaixi26/org.alloytools.alloy
0
741
<gh_stars>0 open main pred idAcypBbFjo9cKzyFPu_prop10 { always(all f: (File & Protected) | f in Protected) } pred __repair { idAcypBbFjo9cKzyFPu_prop10 } check __repair { idAcypBbFjo9cKzyFPu_prop10 <=> prop10o }
echo/echo.asm
IvBaranov/nasm
12
97219
; Echo program that waits for user to enter a character and than echoing it. ; NASM assembly for Mac OS X x64. section .data msg_enter: db "Please, enter a char: " .len: equ $ - msg_enter msg_entered: db "You have entered: " .len: equ $ - msg_entered section .bss char: resb 1 ; reserve one byte for one char section .text global _main _main: ; show message mov rax, 0x2000004 ; put the write-system-call-code into register rax mov rdi, 1 ; tell kernel to use stdout mov rsi, msg_enter ; rsi is where the kernel expects to find the address of the message mov rdx, msg_enter.len ; and rdx is where the kernel expects to find the length of the message syscall ; read char mov rax, 0x2000003 ; put the read-system-call-code into register rax mov rdi, 0 ; tell kernel to use stdin mov rsi, char ; address of storage, declared in section .bss mov rdx, 2 ; get 2 bytes from the kernel's buffer (one for the carriage return) syscall ; show message mov rax, 0x2000004 ; put the write-system-call-code into register rax mov rdi, 1 ; tell kernel to use stdout mov rsi, msg_entered ; rsi is where the kernel expects to find the address of the message mov rdx, msg_entered.len ; and rdx is where the kernel expects to find the length of the message syscall ; show char mov rax, 0x2000004 ; put the write-system-call-code into register rax mov rdi, 1 ; tell kernel to use stdout mov rsi, char ; address of storage of char mov rdx, 2 ; the second byte is to apply the carriage return expected in the string syscall ; exit system call mov rax, 0x2000001 ; exit system call xor rdi, rdi ; equivalent to "mov rdi, 0", however xor is preferred pattern on modern ; CPUs syscall
test/Succeed/Issue4755a.agda
cruhland/agda
1,989
9155
<gh_stars>1000+ {-# OPTIONS --rewriting #-} open import Agda.Builtin.Bool open import Agda.Builtin.Nat open import Agda.Builtin.Equality open import Agda.Builtin.Equality.Rewrite record R : Set where constructor mkR field f : Nat data Box : Set → Set₁ where box : (A : Set) → Box A data D (A : Set) : Set₁ where c : Box A → R → D A postulate r : R dr : ∀ {A} → D A rew : ∀ {A} {x} → c {A} (box A) (mkR x) ≡ dr {-# REWRITE rew #-} test : c {Bool} (box Bool) r ≡ dr test = refl
u7si/include/u7si-eop2.asm
JohnGlassmyer/UltimaHacks
68
90326
; ============================================================================= ; Ultima VII: Serpent Isle Hacks -- expanded overlay 2 ; ----------------------------------------------------------------------------- ; a second eop segment for offloading large, less frequently called procedures ; from the primary eop segment. %assign eop2_nextEopNumber 0 %assign eop2_nextEopStart EOP2_NEW_CODE_START eopProc eop2, 0x005, entry1 eopProc eop2, 0x005, entry2 eopProc eop2, 0x005, entry3 eopProc eop2, 0x040, varArgsDispatcher eopProc eop2, 0x020, dispatchTable eopProc eop2, 0x9A0, displayControls eopProc eop2, 0x1D0, printDarkPathDestinations eopProc eop2, 0x270, produceItemLabelText eopProc eop2, 0x800, targetKeys
base/ntos/ke/amd64/dpcint.asm
npocmaka/Windows-Server-2003
17
95571
<reponame>npocmaka/Windows-Server-2003<gh_stars>10-100 title "Deferred Procedure Call Interrupt" ;++ ; ; Copyright (c) 2000 Microsoft Corporation ; ; Module Name: ; ; dpcint.asm ; ; Abstract: ; ; This module implements the code necessary to process the Deferred ; Procedure Call interrupt. ; ; Author: ; ; <NAME> (davec) 10-Nov-2000 ; ; Environment: ; ; Kernel mode only. ; ;-- extern KiDispatchInterrupt:proc extern KiInitiateUserApc:proc extern __imp_HalEndSystemInterrupt:qword include ksamd64.inc subttl "Deferred Procedure Call Interrupt" ;++ ; ; VOID ; KiDpcInterrupt ( ; VOID ; ) ; ; Routine Description: ; ; This routine is entered as the result of a software interrupt generated ; at DISPATCH_LEVEL. Its function is to save the machine state and call ; the dispatch interrupt routine. ; ; N.B. This is a directly connected interrupt that does not use an interrupt ; object. ; ; Arguments: ; ; None. ; ; Return Value: ; ; None. ; ;-- NESTED_ENTRY KiDpcInterrupt, _TEXT$00 .pushframe ; mark machine frame push_reg rbp ; push dummy vector push_reg rbp ; save nonvolatile register GENERATE_INTERRUPT_FRAME ; generate interrupt frame mov ecx, DISPATCH_LEVEL ; set new IRQL level ENTER_INTERRUPT ; raise IRQL, do EOI, enable interrupts call KiDispatchInterrupt ; process the dispatch interrupt EXIT_INTERRUPT <NoEOI> ; lower IRQL and restore state NESTED_END KiDpcInterrupt, _TEXT$00 end
libsrc/_DEVELOPMENT/math/float/math16/c/sdcc/cm16_sdcc_log.asm
ahjelm/z88dk
640
101777
SECTION code_fp_math16 PUBLIC cm16_sdcc_log EXTERN cm16_sdcc_read1, logf16 cm16_sdcc_log: call cm16_sdcc_read1 jp logf16
programs/oeis/080/A080596.asm
neoneye/loda
22
161100
; A080596: a(1)=1; for n >= 2, a(n) is smallest positive integer which is consistent with sequence being monotonically increasing and satisfying a(a(n)) = 2n+3. ; 1,4,5,7,9,10,11,12,13,15,17,19,21,22,23,24,25,26,27,28,29,31,33,35,37,39,41,43,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,94,95,96,97,98,99,100,101,102 mov $2,1 mov $3,$0 lpb $0 mov $1,0 mul $2,2 trn $0,$2 add $1,$0 trn $0,$2 add $1,$2 lpe lpb $3 add $1,1 sub $3,1 lpe add $1,1 mov $0,$1
programs/oeis/303/A303781.asm
neoneye/loda
22
166827
; A303781: a(2) = 1; for n <> 2, a(n) = gcd(n, A000005(n)), where A000005(n) = number of divisors of n. ; 1,1,1,1,1,2,1,4,3,2,1,6,1,2,1,1,1,6,1,2,1,2,1,8,1,2,1,2,1,2,1,2,1,2,1,9,1,2,1,8,1,2,1,2,3,2,1,2,1,2,1,2,1,2,1,8,1,2,1,12,1,2,3,1,1,2,1,2,1,2,1,12,1,2,3,2,1,2,1,10,1,2,1,12,1,2,1,8,1,6,1,2,1,2,1,12,1,2,3,1 mov $2,$0 seq $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n. trn $2,$0 add $3,$2 add $3,1 gcd $0,$3
oeis/084/A084847.asm
neoneye/loda-programs
11
101475
; A084847: 2*3^n+2^(2n-1)*(n-2). ; Submitted by <NAME> ; 1,4,18,86,418,2022,9650,45334,209730,956870,4312402,19228662,84948962,372287398,1620178674,7008019670,30150864514,129107299206,550530654866,2338786731958,9902578218786,41802362561894,175984622563378 mov $2,$0 lpb $2 sub $0,$3 mul $0,2 mov $1,$0 add $1,$0 mov $0,$1 add $0,2 sub $2,1 mul $3,3 add $3,2 lpe mul $0,2 div $0,4 add $0,1
alloy4fun_models/trainstlt/models/10/Tx2Gqm3JkMDQ5JNNY.als
Kaixi26/org.alloytools.alloy
0
3841
<reponame>Kaixi26/org.alloytools.alloy open main pred idTx2Gqm3JkMDQ5JNNY_prop11 { always ( all t:Train| some t.pos implies once t.pos in Entry) } pred __repair { idTx2Gqm3JkMDQ5JNNY_prop11 } check __repair { idTx2Gqm3JkMDQ5JNNY_prop11 <=> prop11o }
programs/oeis/227/A227121.asm
neoneye/loda
22
164029
<reponame>neoneye/loda<gh_stars>10-100 ; A227121: Number of n X 2 0,1 arrays indicating 2 X 2 subblocks of some larger (n+1) X 3 binary array having a sum of zero, with rows and columns of the latter in lexicographically nondecreasing order. ; 3,7,13,23,40,68,112,178,273,405,583,817,1118,1498,1970,2548,3247,4083,5073,6235,7588,9152,10948,12998,15325,17953,20907,24213,27898,31990,36518,41512,47003,53023,59605,66783,74592,83068,92248,102170,112873,124397,136783,150073,164310,179538,195802,213148,231623,251275,272153,294307,317788,342648,368940,396718,426037,456953,489523,523805,559858,597742,637518,679248,722995,768823,816797,866983,919448,974260,1031488,1091202,1153473,1218373,1285975,1356353,1429582,1505738,1584898,1667140,1752543,1841187,1933153,2028523,2127380,2229808,2335892,2445718,2559373,2676945,2798523,2924197,3054058,3188198,3326710,3469688,3617227,3769423,3926373,4088175 mov $1,1 add $1,$0 seq $1,55417 ; Number of points in N^n of norm <= 2. add $2,$1 add $0,$2
awa/src/awa-components-redirect.adb
fuzzysloth/ada-awa
81
22454
----------------------------------------------------------------------- -- awa-components-redirect -- ASF Core Components -- Copyright (C) 2011 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package body AWA.Components.Redirect is -- ------------------------------ -- Get the redirection link -- ------------------------------ function Get_Link (UI : in UIRedirect; Context : in Faces_Context'Class) return Util.Beans.Objects.Object is begin return UI.Get_Attribute (Context, "link"); end Get_Link; -- ------------------------------ -- If the component is rendered, activate the redirection to the -- specified URI. -- ------------------------------ overriding procedure Encode_Begin (UI : in UIRedirect; Context : in out Faces_Context'Class) is begin if not UI.Is_Rendered (Context) then return; end if; declare Link : constant Util.Beans.Objects.Object := UIRedirect'Class (UI).Get_Link (Context); begin Context.Get_Response.Send_Redirect (Location => Util.Beans.Objects.To_String (Link)); end; end Encode_Begin; end AWA.Components.Redirect;
thirdparty/adasdl/thin/adasdl/AdaSDL_framebuff/sdltests/torturethread_sprogs.adb
Lucretia/old_nehe_ada95
0
8890
<reponame>Lucretia/old_nehe_ada95 -- ----------------------------------------------------------------- -- -- -- -- This is free software; you can redistribute it and/or -- -- modify it under the terms of the GNU General Public -- -- License as published by the Free Software Foundation; either -- -- version 2 of the License, or (at your option) any later version. -- -- -- -- This software is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public -- -- License along with this library; if not, write to the -- -- Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- -- Boston, MA 02111-1307, USA. -- -- -- -- ----------------------------------------------------------------- -- -- ----------------------------------------------------------------- -- -- This is a translation, to the Ada programming language, of the -- -- original C test files written by <NAME> - www.libsdl.org -- -- translation made by <NAME> - www.adapower.net/~avargas -- -- ----------------------------------------------------------------- -- with System.Address_To_Access_Conversions; with Ada.Text_IO; use Ada.Text_IO; with SDL.Thread; package body TortureThread_Sprogs is package Tr renames SDL.Thread; function To_int is new Ada.Unchecked_Conversion (System.Address, C.int); type Volatile_int is new C.int; pragma Volatile (Volatile_int); package int_Ptrs is new System.Address_To_Access_Conversions (Volatile_int); use int_Ptrs; -- ====================================== function SubThreadFunc (data : System.Address) return C.int is begin while To_Pointer (data).all = 0 loop null; -- SDL.Timer.SDL_Delay (10); -- do nothing end loop; return 0; end SubThreadFunc; -- ====================================== type flags_Array is array (C.int range 0 .. NUMTHREADS - 1) of aliased Volatile_int; pragma Convention (C, flags_Array); flags : flags_Array; -- ====================================== function ThreadFunc (data : System.Address) return C.int is type sub_threads_Array is array (C.int range 0 .. NUMTHREADS - 1) of Tr.SDL_Thread_ptr; pragma Convention (C, sub_threads_Array); sub_threads : sub_threads_Array; tid : C.int := To_int (data); begin Put_Line ("Creating Thread " & C.int'Image (tid)); for i in flags'Range loop flags (i) := 0; sub_threads (i) := Tr.CreateThread (SubThreadFunc'Access, To_Address (Object_Pointer'(flags (i)'Access))); end loop; Put_Line ("Thread '" & C.int'Image (tid) & "' waiting for signals"); while time_for_threads_to_die (tid) /= 1 loop null; -- do nothing end loop; Put_Line ("Thread '" & C.int'Image (tid) & "' sending signals to subthreads"); for i in flags'Range loop flags (i) := 1; Tr.WaitThread (sub_threads (i), null); end loop; Put_Line ("Thread '" & C.int'Image (tid) & "' exiting"); return 0; end ThreadFunc; -- ====================================== end TortureThread_Sprogs;
source/streams/a-wttest.ads
ytomino/drake
33
16434
<gh_stars>10-100 pragma License (Unrestricted); with Ada.Streams.Stream_IO; with Ada.Text_IO.Text_Streams; package Ada.Wide_Text_IO.Text_Streams is -- type Stream_Access is access all Streams.Root_Stream_Type'Class; subtype Stream_Access is Streams.Stream_IO.Stream_Access; function Stream ( File : File_Type) -- Open_File_Type return Stream_Access renames Text_IO.Text_Streams.Stream; end Ada.Wide_Text_IO.Text_Streams;
packages/query/src/loader/typescript/grammar/QueryParser.g4
johanholmerin/pgtyped
0
1392
parser grammar QueryParser; options { tokenVocab = QueryLexer; } input : query EOF_STATEMENT? EOF ; query : ignored+ (param ignored*)* ; ignored: (ID | WORD | STRING | COMMA | OB | CB | SPECIAL)+; param : pickParam | arrayPickParam | scalarParam | arrayParam ; scalarParam: SINGULAR_PARAM_MARK paramName; pickParam: SINGULAR_PARAM_MARK paramName OB pickKey (COMMA pickKey)* COMMA? CB; arrayPickParam: PLURAL_PARAM_MARK paramName OB pickKey (COMMA pickKey)* COMMA? CB; arrayParam: PLURAL_PARAM_MARK paramName; paramName: ID; pickKey: ID;
modules/parsers/parser-xsodata/com.sap.xsk.parser.xsodata/src/main/antlr4/com/sap/xsk/parser/xsodata/core/Hdbxsodata.g4
astefanova/xsk
0
7296
<reponame>astefanova/xsk<filename>modules/parsers/parser-xsodata/com.sap.xsk.parser.xsodata/src/main/antlr4/com/sap/xsk/parser/xsodata/core/Hdbxsodata.g4 grammar Hdbxsodata; xsodataDefinition: service annotations? settings?; service : 'service' namespace? body; namespace : 'namespace' QUATED_STRING; body : '{' content? '}'; content : entry content?; entry : ( entity | association) ; entity : object entityset? with? keys? concurrencytoken? navigates? aggregates? parameters? modificationBody? SEMICOLON;//the order is fixed object : 'entity'? (catalogobjectschema '.')? catalogobjectname; //can't deferenciate repoobject here catalogobjectschema : QUATED_STRING; catalogobjectname : QUATED_STRING; entityset : 'as' entitysetname; entitysetname : QUATED_STRING; with : ( withProp | withoutProp ) propertylist; withProp : 'with'; withoutProp : 'without'; propertylist : '(' (columnname (',' columnname)*) ')'; columnname : QUATED_STRING; keys : ('keys'| 'key') ( keylist | keygenerated ); keylist : propertylist; keygenerated : 'generate' 'local' columnname; concurrencytoken : 'concurrencytoken' keylist?; navigates : 'navigates' '(' navlist ')'; navlist : (naventry (',' navlist)*); naventry : assocname 'as' navpropname fromend?; assocname : QUATED_STRING; navpropname : QUATED_STRING; fromend : 'from' ( 'principal' | 'dependent' ); aggregates : 'aggregates' 'always' aggregatestuple?; aggregatestuple : '(' (aggregate (',' aggregate)*) ')'; aggregate : aggregatefunction 'of' columnname; aggregatefunction : ( 'SUM' | 'AVG' | 'MIN' | 'MAX' ); parameters :'parameters' 'via' parameterskeyand? 'entity' parameterentitysetname? parametersresultsprop?; parameterskeyand :'key' 'and'; parameterentitysetname :QUATED_STRING; parametersresultsprop :'results' 'property' QUATED_STRING; modificationBody : modification modification* ; modification : create | update | delete;//the order is random create : 'create' modificationspec; update : 'update' modificationspec; delete : 'delete' modificationspec; modificationspec : ( (modificationaction events?) | events | forbidden ); modificationaction : 'using' action; forbidden : 'forbidden'; action : QUATED_STRING; events : 'events' '(' eventlist ')'; eventlist : (eventlistElement (',' eventlistElement)*); eventlistElement : eventtype action; eventtype : ( 'before' | 'after' | 'precommit' | 'postcommit' ); association : associationdef assocrefconstraint? principalend dependentend ( assoctable | storage | modificationBody )? SEMICOLON; associationdef : 'association' assocname; assocrefconstraint : 'with' 'referential' 'constraint'; principalend : 'principal' end; dependentend : 'dependent' end; end : endref multiplicity; endref : endtype joinpropertieslist?; endtype : entitysetname; joinpropertieslist : propertylist; multiplicity : 'multiplicity' multiplicityvalue ; multiplicityvalue : ( '"1"' | '"0..1"' | '"1..*"' | '"*"' ); assoctable : 'over' repoobject overprincipalend overdependentend modificationBody?; repoobject : QUATED_STRING; overprincipalend : 'principal' overend; overdependentend : 'dependent' overend; overend : propertylist; storage : ( nostorage | storageend modificationBody? ); nostorage : 'no' 'storage'; storageend : 'storage' 'on' ( 'principal' | 'dependent' ); annotations : 'annotations' annotationsbody; annotationsbody : '{' annotationconfig annotationconfig? '}'; annotationconfig : 'enable' 'OData4SAP' SEMICOLON; settings : 'settings' settingsbody; settingsbody :'{' settingselement* '}'; settingselement : supportnull | contentcashecontrol | metadatacashecontrol | hints | limits;//order is random supportnull : 'support' 'null' SEMICOLON; contentcashecontrol : 'content' 'cache-control' QUATED_STRING SEMICOLON; metadatacashecontrol : 'metadata' 'cache-control' QUATED_STRING SEMICOLON; hints : 'hints' hintlist? nullvalue? SEMICOLON; hintlist : ( hintvalue (',' hintvalue)* ); hintvalue : QUATED_STRING; nullvalue : 'null'; limits : 'limits' limitvalue (',' limitvalue)* SEMICOLON; limitvalue : (maxrecords | maxexpandedrecords) EQ INT; maxrecords :'max_records'; maxexpandedrecords :'max_expanded_records'; SEMICOLON : ';' ; EQ : '=' ; QUATED_STRING : '"' (ESC | ~[{}])*? '"' ; COMMA : ',' ; COLON : ':'; ESC : '\\"' | '\\\\'; // 2-char sequences \" and \\ WS : [ \t\r\n\u000C]+ -> skip; // toss out whitespace LINE_COMMENT : '//' .*? '\r'? '\n' -> skip ; // Match "//" stuff '\n' COMMENT : '/*' .*? '*/' -> skip ; // Match "/*" stuff "*/" INT : [0-9]+; //MULTIPLISITY_STRING : '"' (~[\r\n"] | '""')* '"';
test/invlpga.asm
km2m/nasm
2,219
20617
;Testname=unoptimized; Arguments=-fbin -oinvlpga.bin; Files=stdout stderr invlpga.bin ;Testname=optimized; Arguments=-fbin -oinvlpga.bin -Ox; Files=stdout stderr invlpga.bin bits 32 invlpga invlpga ax,ecx invlpga eax,ecx bits 64 invlpga invlpga eax,ecx invlpga rax,ecx
src/lv-objx-list.ads
Fabien-Chouteau/ada-lvlg
3
22906
<filename>src/lv-objx-list.ads pragma Style_Checks (Off); with Lv.Style; with System; with Lv.Objx.Label; with Lv.Objx.Page; with Lv.Objx.Btn; package Lv.Objx.List is subtype Instance is Obj_T; type Style_T is (Style_Bg, Style_Scrl, Style_Sb, Style_Btn_Rel, Style_Btn_Pr, Style_Btn_Tgl_Rel, Style_Btn_Tgl_Pr, Style_Btn_Ina); -- Create a list objects -- @param par pointer to an object, it will be the parent of the new list -- @param copy pointer to a list object, if not NULL then the new object will be copied from it -- @return pointer to the created list function Create (Par : Obj_T; Copy : Instance) return Instance; -- Delete all children of the scrl object, without deleting scrl child. -- @param obj pointer to an object procedure Clean (Self : Instance); -- Add a list element to the list -- @param self pointer to list object -- @param img_fn file name of an image before the text (NULL if unused) -- @param txt text of the list element (NULL if unused) -- @param rel_action pointer to release action function (like with lv_btn) -- @return pointer to the new list element which can be customized (a button) function Add (Self : Instance; Img_Gn : System.Address; Txt : C_String_Ptr; Rel_Action : Action_Func_T) return Btn.Instance; ---------------------- -- Setter functions -- ---------------------- -- Make a button selected -- @param self pointer to a list object -- @param btn pointer to a button to select procedure Set_Btn_Selected (Self : Instance; Btn : Obj_T); -- Set scroll animation duration on 'list_up()' 'list_down()' 'list_focus()' -- @param self pointer to a list object -- @param anim_time duration of animation [ms] procedure Set_Anim_Time (Self : Instance; Anim_Time : Uint16_T); -- Set the scroll bar mode of a list -- @param self pointer to a list object -- @param sb_mode the new mode from 'lv_page_sb_mode_t' enum procedure Set_Sb_Mode (Self : Instance; Mode : Lv.Objx.Page.Mode_T); -- Set a style of a list -- @param self pointer to a list object -- @param type which style should be set -- @param style pointer to a style procedure Set_Style (Self : Instance; Type_P : Style_T; Style : Lv.Style.Style); ---------------------- -- Getter functions -- ---------------------- -- Get the text of a list element -- @param btn pointer to list element -- @return pointer to the text function Btn_Text (Self : Instance) return C_String_Ptr; -- Get the label object from a list element -- @param self pointer to a list element (button) -- @return pointer to the label from the list element or NULL if not found function Btn_Label (Self : Instance) return Label.Instance; -- Get the image object from a list element -- @param self pointer to a list element (button) -- @return pointer to the image from the list element or NULL if not found function Btn_Img (Self : Instance) return Obj_T; -- Get the next button from list. (Starts from the bottom button) -- @param self pointer to a list object -- @param prev_btn pointer to button. Search the next after it. -- @return pointer to the next button or NULL when no more buttons function Prev_Btn (Self : Instance; Prev : Obj_T) return Obj_T; -- Get the previous button from list. (Starts from the top button) -- @param self pointer to a list object -- @param prev_btn pointer to button. Search the previous before it. -- @return pointer to the previous button or NULL when no more buttons function Next_Btn (Self : Instance; Next : Obj_T) return Obj_T; -- Get the currently selected button -- @param self pointer to a list object -- @return pointer to the selected button function Btn_Selected (Self : Instance) return Obj_T; -- Get scroll animation duration -- @param self pointer to a list object -- @return duration of animation [ms] function Anim_Time (Self : Instance) return Uint16_T; -- Get the scroll bar mode of a list -- @param self pointer to a list object -- @return scrollbar mode from 'lv_page_sb_mode_t' enum function Sb_Mode (Self : Instance) return Lv.Objx.Page.Mode_T; -- Get a style of a list -- @param self pointer to a list object -- @param type which style should be get -- @return style pointer to a style function Style (Self : Instance; Type_P : Style_T) return Lv.Style.Style; -- Other functions -- Move the list elements up by one -- @param self pointer a to list object procedure Up (Self : Instance); -- Move the list elements down by one -- @param self pointer to a list object procedure Down (Self : Instance); -- Focus on a list button. It ensures that the button will be visible on the list. -- @param self pointer to a list button to focus -- @param anim_en true: scroll with animation, false: without animation procedure Focus (Self : Instance; Anim_En : U_Bool); ------------- -- Imports -- ------------- pragma Import (C, Create, "lv_list_create"); pragma Import (C, Clean, "lv_list_clean"); pragma Import (C, Add, "lv_list_add"); pragma Import (C, Set_Btn_Selected, "lv_list_set_btn_selected"); pragma Import (C, Set_Anim_Time, "lv_list_set_anim_time"); pragma Import (C, Set_Sb_Mode, "lv_list_set_sb_mode_inline"); pragma Import (C, Set_Style, "lv_list_set_style"); pragma Import (C, Btn_Text, "lv_list_get_btn_text"); pragma Import (C, Btn_Label, "lv_list_get_btn_label"); pragma Import (C, Btn_Img, "lv_list_get_btn_img"); pragma Import (C, Prev_Btn, "lv_list_get_prev_btn"); pragma Import (C, Next_Btn, "lv_list_get_next_btn"); pragma Import (C, Btn_Selected, "lv_list_get_btn_selected"); pragma Import (C, Anim_Time, "lv_list_get_anim_time"); pragma Import (C, Sb_Mode, "lv_list_get_sb_mode_inline"); pragma Import (C, Style, "lv_list_get_style"); pragma Import (C, Up, "lv_list_up"); pragma Import (C, Down, "lv_list_down"); pragma Import (C, Focus, "lv_list_focus"); for Style_T'Size use 8; for Style_T use (Style_Bg => 0, Style_Scrl => 1, Style_Sb => 2, Style_Btn_Rel => 3, Style_Btn_Pr => 4, Style_Btn_Tgl_Rel => 5, Style_Btn_Tgl_Pr => 6, Style_Btn_Ina => 7); end Lv.Objx.List;
tests/issue47.asm
jonfoster/customasm
1
104112
<reponame>jonfoster/customasm ; ::: #ruledef { ld {addr} => 0x00 @ addr`8 ld x => 0xff } ld 0x11 ; = 0x0011 ld x ; = 0xff ; ::: #ruledef { ld x => 0xff ld {addr} => 0x00 @ addr`8 } ld 0x11 ; = 0x0011 ld x ; = 0xff ; ::: #ruledef { ld {addr} => 0x00 @ addr`8 ld x => 0xff @ 0x22 } ld 0x11 ; = 0x0011 ld x ; = 0xff22 ; ::: #ruledef { ld ({addr}) => 0x00 @ addr`8 ld ({addr}, x) => 0xff @ addr`8 } ld (0x11) ; = 0x0011 ld (0x22, x) ; = 0xff22 ; ::: #ruledef { ld ({addr}) => 0x00 @ addr`8 ld ({addr}, x) => 0xff @ addr`8 } ld (0x11) ld (0x22), x) ; error: no match
Task/Draw-a-clock/Ada/draw-a-clock.ada
LaudateCorpus1/RosettaCodeData
1
7992
with Ada.Numerics.Elementary_Functions; with Ada.Calendar.Formatting; with Ada.Calendar.Time_Zones; with SDL.Video.Windows.Makers; with SDL.Video.Renderers.Makers; with SDL.Events.Events; procedure Draw_A_Clock is use Ada.Calendar; use Ada.Calendar.Formatting; Window : SDL.Video.Windows.Window; Renderer : SDL.Video.Renderers.Renderer; Event : SDL.Events.Events.Events; Offset : Time_Zones.Time_Offset; procedure Draw_Clock (Stamp : Time) is use SDL.C; use Ada.Numerics.Elementary_Functions; Radi : constant array (0 .. 59) of int := (0 | 15 | 30 | 45 => 2, 5 | 10 | 20 | 25 | 35 | 40 | 50 | 55 => 1, others => 0); Diam : constant array (0 .. 59) of int := (0 | 15 | 30 | 45 => 5, 5 | 10 | 20 | 25 | 35 | 40 | 50 | 55 => 3, others => 1); Width : constant int := Window.Get_Surface.Size.Width; Height : constant int := Window.Get_Surface.Size.Height; Radius : constant Float := Float (int'Min (Width, Height)); R_1 : constant Float := 0.48 * Radius; R_2 : constant Float := 0.35 * Radius; R_3 : constant Float := 0.45 * Radius; R_4 : constant Float := 0.47 * Radius; Hour : constant Hour_Number := Formatting.Hour (Stamp, Offset); Minute : constant Minute_Number := Formatting.Minute (Stamp, Offset); Second : constant Second_Number := Formatting.Second (Stamp); function To_X (A : Float; R : Float) return int is (Width / 2 + int (R * Sin (A, 60.0))); function To_Y (A : Float; R : Float) return int is (Height / 2 - int (R * Cos (A, 60.0))); begin SDL.Video.Renderers.Makers.Create (Renderer, Window.Get_Surface); Renderer.Set_Draw_Colour ((0, 0, 150, 255)); Renderer.Fill (Rectangle => (0, 0, Width, Height)); Renderer.Set_Draw_Colour ((200, 200, 200, 255)); for A in 0 .. 59 loop Renderer.Fill (Rectangle => (To_X (Float (A), R_1) - Radi (A), To_Y (Float (A), R_1) - Radi (A), Diam (A), Diam (A))); end loop; Renderer.Set_Draw_Colour ((200, 200, 0, 255)); Renderer.Draw (Line => ((Width / 2, Height / 2), (To_X (5.0 * (Float (Hour) + Float (Minute) / 60.0), R_2), To_Y (5.0 * (Float (Hour) + Float (Minute) / 60.0), R_2)))); Renderer.Draw (Line => ((Width / 2, Height / 2), (To_X (Float (Minute) + Float (Second) / 60.0, R_3), To_Y (Float (Minute) + Float (Second) / 60.0, R_3)))); Renderer.Set_Draw_Colour ((220, 0, 0, 255)); Renderer.Draw (Line => ((Width / 2, Height / 2), (To_X (Float (Second), R_4), To_Y (Float (Second), R_4)))); Renderer.Fill (Rectangle => (Width / 2 - 3, Height / 2 - 3, 7, 7)); end Draw_Clock; function Poll_Quit return Boolean is use type SDL.Events.Event_Types; begin while SDL.Events.Events.Poll (Event) loop if Event.Common.Event_Type = SDL.Events.Quit then return True; end if; end loop; return False; end Poll_Quit; begin Offset := Time_Zones.UTC_Time_Offset; if not SDL.Initialise (Flags => SDL.Enable_Screen) then return; end if; SDL.Video.Windows.Makers.Create (Win => Window, Title => "Draw a clock", Position => SDL.Natural_Coordinates'(X => 10, Y => 10), Size => SDL.Positive_Sizes'(300, 300), Flags => SDL.Video.Windows.Resizable); loop Draw_Clock (Clock); Window.Update_Surface; delay 0.200; exit when Poll_Quit; end loop; Window.Finalize; SDL.Finalise; end Draw_A_Clock;
src/frontend/Experimental_Ada_ROSE_Connection/parser/support/source/indented_text.adb
ouankou/rose
488
25163
<filename>src/frontend/Experimental_Ada_ROSE_Connection/parser/support/source/indented_text.adb with Ada.Characters.Handling; with Ada.Wide_Text_IO; package body Indented_Text is package Ach renames Ada.Characters.Handling; package Awti renames Ada.Wide_Text_IO; ----------- -- PRIVATE: ----------- procedure Trace_Put (Message : in Wide_String) is begin if Trace_On then Awti.Put (Message); end if; end Trace_Put; ----------- -- PRIVATE: ----------- procedure Trace_Put_Line (Message : in Wide_String) is begin if Trace_On then Awti.Put_Line ("$$$ " & Message); end if; end Trace_Put_Line; -- Used below to control which routines are used for output: procedure Put (Message : in Wide_String) renames Trace_Put; procedure Put_Line (Message : in Wide_String) renames Trace_Put_Line; ------------ -- EXPORTED: ------------ procedure Indent (This : in out Class) is begin This.Indent_Level := This.Indent_Level + 1; end Indent; ------------ -- EXPORTED: ------------ procedure Dedent (This : in out Class) is begin if This.Indent_Level = 0 then Put_Line ("(Attempted negative indent)"); else This.Indent_Level := This.Indent_Level - 1; end if; end Dedent; ------------ -- EXPORTED: ------------ procedure New_Line (This : in out Class) is begin Put_Line (""); This.Line_In_Progress := False; end New_Line; ------------ -- EXPORTED: ------------ procedure End_Line (This : in out Class) is begin if This.Line_In_Progress then This.New_Line; end if; end End_Line; ------------ -- EXPORTED: ------------ procedure Put (This : in out Class; Message : in String) is begin This.Put (ACH.To_Wide_String (Message)); end Put; ------------ -- EXPORTED: ------------ procedure Put (This : in out Class; Message : in Wide_String) is begin This.Put_Indent_If_Needed; Put (Message); end Put; ------------ -- EXPORTED: ------------ procedure Put_Indented_Line (This : in out Class; Message : in String) is begin This.Put_Indented_Line (ACH.To_Wide_String (Message)); end Put_Indented_Line; ------------ -- EXPORTED: ------------ procedure Put_Indented_Line (This : in out Class; Message : in Wide_String) is begin This.Put_Indent_If_Needed; Put_Line (Message); This.Line_In_Progress := False; end Put_Indented_Line; ------------ -- PRIVATE: ------------ procedure Put_Indent_If_Needed (This : in out Class) is begin if not This.Line_In_Progress then Put (This.White_Space); This.Line_In_Progress := True; end if; end Put_Indent_If_Needed; ------------ -- PRIVATE: ------------ function White_Space (This : in Class) return Wide_String is ((1 .. This.Indent_Level * 2 => ' ')); end Indented_Text;
tests/miaf/invalid-num-pixels.asm
y-guyon/ComplianceWarden
3
242767
<filename>tests/miaf/invalid-num-pixels.asm<gh_stars>1-10 %define BE(a) ( ((((a)>>24)&0xFF) << 0) + ((((a)>>16)&0xFF) << 8) + ((((a)>>8)&0xFF) << 16) + ((((a)>>0)&0xFF) << 24) ) ftyp_start: dd BE(ftyp_end - ftyp_start) db "ftyp" db "isom" dd BE(0x00) db "mif1", "miaf" ftyp_end: meta_start: dd BE(meta_end - meta_start) db "meta" dd BE(0) hdlr_start: dd BE(hdlr_end - hdlr_start) db "hdlr" db 0x00 ; version(8) db 0x00, 0x00, 0x00 ; flags(24) db 0x00, 0x00, 0x00, 0x00 ; pre_defined(32) db 0x70, 0x69, 0x63, 0x74 ; handler_type(32) ('pict') db 0x00, 0x00, 0x00, 0x00 ; reserved1(32) db 0x00, 0x00, 0x00, 0x00 ; reserved2(32) db 0x00, 0x00, 0x00, 0x00 ; reserved3(32) db 0x00 ; name(8) hdlr_end: pitm_start: dd BE(pitm_end - pitm_start) db "pitm" dd BE(0) db 0xaa, 0xbb pitm_end: iloc_start: dd BE(iloc_end - iloc_start) db "iloc" dd BE(0x01000000) dd BE(2) ; 2 items dd BE(0x00030000) ; construction_method(1) dw 0 dw 0 dd BE(0x00040000) ; construction_method(1) dw 0 dw 0 iloc_end: iref_start: dd BE(iref_end - iref_start) db "iref" db 0x01, 0x00, 0x00, 0x00 ; version=1 thmb_start: dd BE(thmb_end - thmb_start) dd "thmb" dd BE(3) ; from_item_ID db 0x00, 0x01 ; reference_count dd BE(4) ; to_item_ID thmb_end: iref_end: iinf_start: dd BE(iinf_end - iinf_start) db "iinf" dd BE(0) db 0x00, 0x00 iinf_end: iprp_start: dd BE(iprp_end - iprp_start) db "iprp" ipco_start: dd BE(ipco_end - ipco_start) db "ipco" ispe_start: dd BE(ispe_end - ispe_start) db "ispe" dd 0 dd BE(1), BE(1) ; width, height ispe_end: ispe2_start: dd BE(ispe2_end - ispe2_start) db "ispe" dd 0 dd BE(1000), BE(1000) ; width, height ispe2_end: ipco_end: ipma_start: dd BE(ipma_end - ipma_start) dd "ipma" db 0x00 ; "version(8)" db 0x00, 0x00, 0x00 ; "flags(24)" db 0x00, 0x00, 0x00, 0x02 ; "entry_count(32)" db 0x00, 0x03 ; "item_ID(16)" db 0x01 ; "association_count(8)" db 0x82 ; "essential(1)" "property_index(7)" db 0x00, 0x04 ; "item_ID(16)" db 0x01 ; "association_count(8)" db 0x81 ; "essential(1)" "property_index(7)" ipma_end: iprp_end: meta_end: ; vim: syntax=nasm
oeis/349/A349862.asm
neoneye/loda-programs
11
9892
<filename>oeis/349/A349862.asm ; A349862: a(n) is the maximum value of binomial(n-2*k,k) with 0 <= k <= floor(n/3). ; Submitted by <NAME>(w1) ; 1,1,1,1,2,3,4,5,6,10,15,21,28,36,56,84,120,165,220,330,495,715,1001,1365,2002,3003,4368,6188,8568,12376,18564,27132,38760,54264,77520,116280,170544,245157,346104,490314,735471,1081575,1562275,2220075,3124550,4686825,6906900,10015005,14307150 pow $1,$0 lpb $0 sub $0,1 add $3,1 mov $2,$3 trn $2,$0 bin $2,$0 trn $2,$1 add $1,$2 lpe mov $0,$1
tests/cross-assemblers/kickass/entry.asm
shazz/shazzam
0
24737
// Define two segments .segmentdef InitSegment [start=$2000] *= $0801 "Basic Upstart" BasicUpstart(start) // 10 sys$0810 *= $0810 "Program" start: inc $d020 inc $d021 jmp $2000 #import "init.asm"
oeis/144/A144327.asm
neoneye/loda-programs
11
25962
<gh_stars>10-100 ; A144327: Prime numbers p such that p - 1 is the fourth a-figurate number and nineteenth b-figurate number for some a and b. ; Submitted by <NAME> ; 191,1217,1559,1901,2243,2927,4637,6689,8741,9767,12161,12503,13187,14897,15581,15923,16607,17291,19001,20369,21737,22079,23447,23789,24473,25841,26183,27551,27893,30971,33023,35759,37811,38153,39521 mov $2,$0 add $2,6 pow $2,2 lpb $2 mov $3,$4 add $3,19 add $3,$4 add $3,$4 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 mov $1,$0 max $1,0 cmp $1,$0 mul $2,$1 sub $2,1 add $4,57 lpe mov $0,$4 sub $0,57 mul $0,3 add $0,191
programs/oeis/131/A131089.asm
neoneye/loda
22
163128
; A131089: a(n) = Sum_{d|n} (2 - mu(d)). ; 1,4,4,6,4,8,4,8,6,8,4,12,4,8,8,10,4,12,4,12,8,8,4,16,6,8,8,12,4,16,4,12,8,8,8,18,4,8,8,16,4,16,4,12,12,8,4,20,6,12,8,12,4,16,8,16,8,8,4,24,4,8,12,14,8,16,4,12,8,16,4,24,4,8,12,12,8,16 seq $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n. sub $0,1 mul $0,2 bin $1,$0 sub $0,$1 add $0,2
FlaxVM/bin/Debug/Readchar.asm
DreamVB/FlaxVM
0
97387
<reponame>DreamVB/FlaxVM # Read char and repeate it SYS 1 STA A LDA A DUP SYS 4 SYS 4 PUSH 10 SYS 4 POP POP POP HLT
tier-1/xcb/source/thin/xcb-xcb_glx_get_color_table_parameterfv_cookie_t.ads
charlie5/cBound
2
23019
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces.C; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_glx_get_color_table_parameterfv_cookie_t is -- Item -- type Item is record sequence : aliased Interfaces.C.unsigned; end record; -- Item_Array -- type Item_Array is array (Interfaces.C .size_t range <>) of aliased xcb .xcb_glx_get_color_table_parameterfv_cookie_t .Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_glx_get_color_table_parameterfv_cookie_t.Item, Element_Array => xcb.xcb_glx_get_color_table_parameterfv_cookie_t.Item_Array, Default_Terminator => (others => <>)); subtype Pointer is C_Pointers.Pointer; -- Pointer_Array -- type Pointer_Array is array (Interfaces.C .size_t range <>) of aliased xcb .xcb_glx_get_color_table_parameterfv_cookie_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_glx_get_color_table_parameterfv_cookie_t.Pointer, Element_Array => xcb.xcb_glx_get_color_table_parameterfv_cookie_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_glx_get_color_table_parameterfv_cookie_t;
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/lto15.adb
best08618/asylo
7
16392
-- { dg-do compile } -- { dg-options "-O -flto -g" { target lto } } package body Lto15 is function Proc (Data : Arr) return R is begin return (Data'Length, Data); end; end Lto15;
code/chapter1/boot.asm
asegid/lucasOS
8
3510
<reponame>asegid/lucasOS org 7c00h mov ax, cs mov es, ax mov ax, msg mov bp, ax mov cx, msgLen mov ax, 1301h mov bx, 000fh mov dl, 0 int 10h msg: db "hello world, welcome to OS!" msgLen: equ $ - msg times 510 - ($ - $$) db 0 dw 0aa55h
src/Mx_lite.g4
AegeanYan/MyCompiler_byJAVA
0
6674
grammar Mx_lite; @header{ package Parser; } program: subProgram*; subProgram : declarationStmt | functionDef | classDecl; functionDef: returnType? Identifier '(' functionparameterDef ')' suite; //可以是构造函数 lambdaDef: '[&]' '(' functionparameterDef ')' '->' suite '(' expressionList? ')'; functionparameterDef : (varType varDeclaration (',' varType varDeclaration)*)?; expressionList: expression (',' expression)*; suite: '{' statement* '}'; statement : suiteStmt | primeStmt | controlStmt | expressionStmt | ';' ; suiteStmt:suite; expressionStmt:expression ';'; controlStmt : If '(' cond = expression ')' trueStmt=statement (Else falseStmt=statement)? #IfStmt | Return expression? ';' #ReturnStmt | For '(' init=expression? ';' cond=expression?';'step=expression?')'statement #ForStmt | While '(' expression ')' statement #WhileStmt | Continue ';' #ContinueStmt | Break ';' #BreakStmt ; //forinit:expression | varDef; // //forstop:expression; primeStmt:varDef';'; declarationStmt: varDef ';'; classDecl: Class Identifier '{' subClassDecl* '}' ';'; subClassDecl:functionDef | declarationStmt; expression : Identifier #IdExpr | constant #ConstExpr | 'new' creator #NewExpr | Identifier '('expressionList?')' #FuncCallExpr | lambdaDef #LambDefExpr | This #ThisExpr | '('expression')' #SubExpr | expression '.' Identifier ('('expressionList?')')? #MemberAccessExpr | expression '.' '('Identifier ('('expressionList?')')? ')' #MemberAccessExpr | array=expression '[' index=expression ']' #IndexExpr //| expression '(' expressionList? ')' #FunctionCallExpr | <assoc=right> op = ('++' | '--') expression #PrefixExpr | expression op = ('++' | '--') #SuffixExpr | <assoc=right> op = ('+' | '-') expression #UnaryExpr | <assoc=right> op = ('!' | '~') expression #UnaryExpr | expression op = ('*' | '/' | '%') expression #BinaryExpr | expression op = ('+' | '-') expression #BinaryExpr | expression op = ('<<' | '>>') expression #BinaryExpr | expression op = ('<' | '<=' | '>' | '>=') expression #BinaryExpr | expression op = ('==' | '!=') expression #BinaryExpr | expression op = '&' expression #BinaryExpr | expression op = '^' expression #BinaryExpr | expression op = '|' expression #BinaryExpr | expression op = '&&' expression #BinaryExpr | expression op = '||' expression #BinaryExpr | <assoc=right> expression op = '=' expression #BinaryExpr ; varDef: varType varDeclaration (',' varDeclaration)*; varDeclaration:Identifier ('=' expression)?; creator : builtinType ('['']')+('['expression']')* #WrongArrayCreator1 | builtinType ('['expression']')+('['']')+('['expression']')+ #WrongArrayCreator2 | builtinType ('['expression']')+('['']')+('['expression']')+('['']')+ #WrongArrayCreator2 | builtinType ('['expression']')+('['']')* #NewArrayCreator | builtinType '(' ')' #NewClass | builtinType #NewNArray ; returnType: Void | varType; varType: arrayType | builtinType; arrayType: builtinType '[' ']' | arrayType '[' ']'; builtinType : Int | Bool | String | Identifier; //identifier是class constant :DecimalInteger | StringConstant | Boolconstant | Nullconstant ; Boolconstant : True | False; Nullconstant: Null; //reserved words StringConstant :'"' (BackSlash | DbQuotation|.)*? '"'; Int : 'int'; Bool : 'bool'; Void : 'void'; True : 'true'; False : 'false'; Null : 'null'; String : 'string'; If : 'if'; Else : 'else'; Return : 'return'; Class : 'class'; While : 'while'; For : 'for'; Break : 'break'; Continue : 'continue'; New : 'new'; This : 'this'; Dot : '.'; LeftParen : '('; RightParen : ')'; LeftBracket : '['; RightBracket : ']'; LeftBrace : '{'; RightBrace : '}'; Less : '<'; LessEqual : '<='; Greater : '>'; GreaterEqual : '>='; LeftShift : '<<'; RightShift : '>>'; Plus : '+'; SelfPlus : '++'; Minus : '-'; SelfMinus : '--'; Mul : '*'; Div : '/'; Mod : '%'; And : '&'; Or : '|'; AndAnd : '&&'; OrOr : '||'; Caret : '^'; Not : '!'; Tilde : '~'; Question : '?'; Colon : ':'; Semi : ';'; Comma : ','; Assign : '='; Equal : '=='; NotEqual : '!='; BackSlash : '\\\\'; DbQuotation : '\\"'; Identifier : [a-zA-Z] [a-zA-Z_0-9]* ; //N DecimalInteger : [1-9] [0-9]* | '0' ; Whitespace : [ \t]+ -> skip ; Newline : ( '\r' '\n'? | '\n' ) -> skip ; BlockComment : '/*' .*? '*/' -> skip //?使得不贪婪了 ; LineComment : '//' ~[\r\n]* -> skip ;
programs/oeis/139/A139698.asm
karttu/loda
1
6485
; A139698: Binomial transform of [1, 25, 25, 25, ...]. ; 1,26,76,176,376,776,1576,3176,6376,12776,25576,51176,102376,204776,409576,819176,1638376,3276776,6553576,13107176,26214376,52428776,104857576,209715176,419430376,838860776,1677721576,3355443176,6710886376,13421772776,26843545576 mov $1,2 pow $1,$0 sub $1,1 mul $1,25 add $1,1
oeis/156/A156635.asm
neoneye/loda-programs
11
4385
; A156635: 144*n^2 - n. ; 143,574,1293,2300,3595,5178,7049,9208,11655,14390,17413,20724,24323,28210,32385,36848,41599,46638,51965,57580,63483,69674,76153,82920,89975,97318,104949,112868,121075,129570,138353,147424,156783,166430,176365,186588,197099,207898,218985,230360,242023,253974,266213,278740,291555,304658,318049,331728,345695,359950,374493,389324,404443,419850,435545,451528,467799,484358,501205,518340,535763,553474,571473,589760,608335,627198,646349,665788,685515,705530,725833,746424,767303,788470,809925,831668 add $0,1 mul $0,144 bin $0,2 div $0,72
programs/oeis/281/A281500.asm
neoneye/loda
22
81136
; A281500: Reduced denominators of f(n) = (n+1)/(2^(2+n)-2) with A026741(n+1) as numerators. ; 2,3,14,15,62,63,254,255,1022,1023,4094,4095,16382,16383,65534,65535,262142,262143,1048574,1048575,4194302,4194303,16777214,16777215,67108862,67108863,268435454,268435455,1073741822,1073741823,4294967294,4294967295,17179869182,17179869183,68719476734,68719476735,274877906942,274877906943,1099511627774,1099511627775,4398046511102,4398046511103,17592186044414,17592186044415,70368744177662,70368744177663,281474976710654,281474976710655,1125899906842622,1125899906842623,4503599627370494,4503599627370495,18014398509481982,18014398509481983,72057594037927934,72057594037927935,288230376151711742,288230376151711743,1152921504606846974,1152921504606846975,4611686018427387902,4611686018427387903,18446744073709551614,18446744073709551615,73786976294838206462,73786976294838206463,295147905179352825854,295147905179352825855,1180591620717411303422,1180591620717411303423,4722366482869645213694,4722366482869645213695,18889465931478580854782,18889465931478580854783,75557863725914323419134,75557863725914323419135,302231454903657293676542,302231454903657293676543,1208925819614629174706174,1208925819614629174706175,4835703278458516698824702,4835703278458516698824703,19342813113834066795298814,19342813113834066795298815,77371252455336267181195262,77371252455336267181195263,309485009821345068724781054,309485009821345068724781055,1237940039285380274899124222,1237940039285380274899124223,4951760157141521099596496894,4951760157141521099596496895,19807040628566084398385987582,19807040628566084398385987583,79228162514264337593543950334,79228162514264337593543950335,316912650057057350374175801342,316912650057057350374175801343,1267650600228229401496703205374,1267650600228229401496703205375 mov $1,4 lpb $0 sub $0,2 mul $1,4 lpe add $1,$0 sub $1,2 mov $0,$1
unordnung_auch_assembler/asm/attiny13/sleepIRQ/withoutSleep_but_INT0.asm
no-go/Blink_atmega328p
0
12642
<reponame>no-go/Blink_atmega328p .include "myTiny13.h" .equ LED,0 .equ TASTER,1 ;irq Vector .org 0x0000 rjmp Main rjmp EXT_INT0 ; IRQ0 Handler ; IRQ routine ----------------- .org 0x0010 EXT_INT0: ; toggleLED sbis PORTB,LED ; if LED = 1 then rjmp setLED cbi PORTB,LED ; LED := 0; return; reti setLED: ; else sbi PORTB,LED ; LED := 1; return; reti .org 0x0030 Main: sbi DDRB,LED ; output cbi DDRB,TASTER ; input ; configure Sleepmode to power-down mode: SM[1:0] = 10 ; INTO on logical change ISC0[1:0] = 01 ldi A,0b00010001 out MCUCR,A ; Enable int0 IRQ ldi A,0b01000000 out GIMSK,A sei mainLoop: ;sbis PORTB,LED ; if LED = 1 skip sleep ;sleep rjmp mainLoop
grammar/antlr4/synthesis/schemaversion/java/Schemaversion.g4
sthagen/odata-url-parser
2
5248
<filename>grammar/antlr4/synthesis/schemaversion/java/Schemaversion.g4 grammar Schemaversion; schemaversion : '$'? Schemaversion '=' ( '*' | Unreserved+ ); Schemaversion : S C H E M A V E R S I O N; Unreserved : Alpha | Digit | '-' | '.' | '_' | '~'; Alpha : A | B | C | D | E | F | G | H | I | J | K | L | M | N |O | P | Q | R | S | T | U | V | W | X |Y | Z; Digit : [0-9]; fragment A : [aA]; fragment B : [bB]; fragment C : [cC]; fragment D : [dD]; fragment E : [eE]; fragment F : [fF]; fragment G : [gG]; fragment H : [hH]; fragment I : [iI]; fragment J : [jJ]; fragment K : [kK]; fragment L : [lL]; fragment M : [mM]; fragment N : [nN]; fragment O : [oO]; fragment P : [pP]; fragment Q : [qQ]; fragment R : [rR]; fragment S : [sS]; fragment T : [tT]; fragment U : [uU]; fragment V : [vV]; fragment W : [wW]; fragment X : [xX]; fragment Y : [yY]; fragment Z : [zZ];
source/web-rss.ads
ytomino/web-ada
2
30098
<filename>source/web-rss.ads<gh_stars>1-10 -- <link rel="alternate" type="application/rss+xml" title="RSS2.0" href="*" /> package Web.RSS is procedure RSS_Start ( Stream : not null access Ada.Streams.Root_Stream_Type'Class; Title : in String; Description : in String; Link : in String); procedure RSS_Item ( Stream : not null access Ada.Streams.Root_Stream_Type'Class; Title : in String; Description : in String; Link : in String); procedure RSS_End ( Stream : not null access Ada.Streams.Root_Stream_Type'Class); end Web.RSS;
antlr4/AB1.g4
davidkellis/pegparser
15
3273
grammar AB1; a : a 'a' | 'a'; b : b 'b' | a;
vp8/decoder/arm/neon/dequantizeb_neon.asm
mrchapp/libvpx
1
19612
<filename>vp8/decoder/arm/neon/dequantizeb_neon.asm ; ; Copyright (c) 2010 The VP8 project authors. All Rights Reserved. ; ; Use of this source code is governed by a BSD-style license ; that can be found in the LICENSE file in the root of the source ; tree. An additional intellectual property rights grant can be found ; in the file PATENTS. All contributing project authors may ; be found in the AUTHORS file in the root of the source tree. ; EXPORT |vp8_dequantize_b_loop_neon| ARM REQUIRE8 PRESERVE8 AREA ||.text||, CODE, READONLY, ALIGN=2 ; r0 short *Q, ; r1 short *DQC ; r2 short *DQ |vp8_dequantize_b_loop_neon| PROC vld1.16 {q0, q1}, [r0] vld1.16 {q2, q3}, [r1] vmul.i16 q4, q0, q2 vmul.i16 q5, q1, q3 vst1.16 {q4, q5}, [r2] bx lr ENDP END
examples/version.adb
ytomino/yaml-ada
4
7359
<reponame>ytomino/yaml-ada with Ada.Text_IO; with YAML; procedure version is begin Ada.Text_IO.Put_Line (YAML.Version); end version;
sit-wt-runtime/src/main/resources/quit-safari.scpt
Xenuzever/sit-wt-all
16
1174
tell application "Safari" quit end tell
libsrc/_DEVELOPMENT/adt/p_forward_list_alt/c/sdcc_iy/p_forward_list_alt_prev_callee.asm
meesokim/z88dk
0
8222
<reponame>meesokim/z88dk ; void *p_forward_list_alt_prev_callee(forward_list_alt_t *list, void *item) SECTION code_adt_p_forward_list_alt PUBLIC p_forward_list_alt_prev_callee EXTERN p_forward_list_prev_callee defc p_forward_list_alt_prev_callee = p_forward_list_prev_callee INCLUDE "adt/p_forward_list_alt/z80/asm_p_forward_list_alt_prev.asm"
src/tests/spectre_v1_arch.asm
hw-sw-contracts/revizor
29
87926
.intel_syntax noprefix LFENCE # delay the cond. jump MOV rax, 0 LEA rbx, [rbx + rax + 1] LEA rbx, [rbx + rax - 1] LEA rbx, [rbx + rax + 1] LEA rbx, [rbx + rax - 1] LEA rbx, [rbx + rax + 1] LEA rbx, [rbx + rax - 1] LEA rbx, [rbx + rax + 1] LEA rbx, [rbx + rax - 1] LEA rbx, [rbx + rax + 1] LEA rbx, [rbx + rax - 1] # reduce the entropy in rbx AND rbx, 0b1000000 CMP rbx, 0 JE .l1 # misprediction # rbx != 0 MOV rax, [r14 + 1024] SHL rax, 2 AND rax, 0b111111000000 MOV rax, [r14 + rax] # leakage happens here .l1: MFENCE
.emacs.d/elpa/wisi-3.1.3/sal-gen_bounded_definite_vectors.adb
caqg/linux-home
0
30923
-- Abstract : -- -- See spec. -- -- Copyright (C) 2017 - 2019 Free Software Foundation, Inc. -- -- This library is free software; you can redistribute it and/or modify it -- under terms of the GNU General Public License as published by the Free -- Software Foundation; either version 3, or (at your option) any later -- version. This library is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- As a special exception under Section 7 of GPL version 3, you are granted -- additional permissions described in the GCC Runtime Library Exception, -- version 3.1, as published by the Free Software Foundation. pragma License (Modified_GPL); package body SAL.Gen_Bounded_Definite_Vectors with Spark_Mode is pragma Suppress (All_Checks); function Length (Container : in Vector) return Ada.Containers.Count_Type is (Ada.Containers.Count_Type (To_Peek_Index (Container.Last))); function Is_Full (Container : in Vector) return Boolean is begin return Length (Container) = Capacity; end Is_Full; procedure Clear (Container : in out Vector) is begin Container.Last := No_Index; end Clear; function Element (Container : Vector; Index : Index_Type) return Element_Type is (Container.Elements (Peek_Type (Index - Index_Type'First + 1))); procedure Replace_Element (Container : in out Vector; Index : in Index_Type; New_Item : in Element_Type) is begin Container.Elements (To_Peek_Index (Index)) := New_Item; end Replace_Element; function Last_Index (Container : Vector) return Extended_Index is (Container.Last); procedure Append (Container : in out Vector; New_Item : in Element_Type) is J : constant Peek_Type := To_Peek_Index (Container.Last + 1); begin Container.Elements (J) := New_Item; Container.Last := Container.Last + 1; end Append; procedure Prepend (Container : in out Vector; New_Item : in Element_Type) is J : constant Peek_Type := Peek_Type (Container.Last + 1 - Index_Type'First + 1); begin Container.Elements (2 .. J) := Container.Elements (1 .. J - 1); Container.Elements (1) := New_Item; Container.Last := Container.Last + 1; end Prepend; procedure Insert (Container : in out Vector; New_Item : in Element_Type; Before : in Extended_Index) is J : constant Peek_Type := To_Peek_Index ((if Before = No_Index then Container.Last + 1 else Before)); K : constant Base_Peek_Type := To_Peek_Index (Container.Last); begin Container.Elements (J + 1 .. K + 1) := Container.Elements (J .. K); Container.Elements (J) := New_Item; Container.Last := Container.Last + 1; end Insert; function "+" (Item : in Element_Type) return Vector is begin return Result : Vector do Append (Result, Item); end return; end "+"; function "&" (Left : in Vector; Right : in Element_Type) return Vector is begin -- WORKAROUND: If init Result with ":= Left", GNAT Community 2019 -- checks Default_Initial_Condition (which fails when Left is not -- empty)! That is only supposed to be checked when initialized by -- default. Reported to AdaCore as ticket S724-042. return Result : Vector do Result := Left; Append (Result, Right); end return; end "&"; procedure Delete_First (Container : in out Vector; Count : in Ada.Containers.Count_Type := 1) is use Ada.Containers; begin if Count = 0 then return; end if; declare New_Last : constant Extended_Index := Extended_Index (Integer (Container.Last) - Integer (Count)); J : constant Base_Peek_Type := Base_Peek_Type (Count); K : constant Peek_Type := To_Peek_Index (Container.Last); begin -- Delete items 1 .. J, shift remaining down. Container.Elements (1 .. K - J) := Container.Elements (J + 1 .. K); Container.Last := New_Last; end; end Delete_First; end SAL.Gen_Bounded_Definite_Vectors;
programs/oeis/054/A054900.asm
karttu/loda
1
241261
; A054900: (n) = floor(n/16) + floor(n/256) + floor(n/4096) + floor(n/65536) + .... ; 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6 mov $1,$0 div $1,16
jitasm/test/x86.asm
Traderain/ProjectNovigrad
2
5485
<gh_stars>1-10 .686 .model flat, c .xmm .code ;---------------------------------------- ; SAL ;---------------------------------------- masm_test_sal proc sal al, cl sal al, 1 sal al, 2 sal al, -1 sal ax, cl sal ax, 1 sal ax, 2 sal eax, cl sal eax, 1 sal eax, 2 sal byte ptr[eax], cl sal byte ptr[eax], 1 sal byte ptr[eax], 2 sal word ptr[eax], cl sal word ptr[eax], 1 sal word ptr[eax], 2 sal dword ptr[eax], cl sal dword ptr[eax], 1 sal dword ptr[eax], 2 masm_test_sal endp ;---------------------------------------- ; SAR ;---------------------------------------- masm_test_sar proc sar al, cl sar al, 1 sar al, 2 sar al, -1 sar ax, cl sar ax, 1 sar ax, 2 sar eax, cl sar eax, 1 sar eax, 2 sar byte ptr[eax], cl sar byte ptr[eax], 1 sar byte ptr[eax], 2 sar word ptr[eax], cl sar word ptr[eax], 1 sar word ptr[eax], 2 sar dword ptr[eax], cl sar dword ptr[eax], 1 sar dword ptr[eax], 2 masm_test_sar endp ;---------------------------------------- ; SHL ;---------------------------------------- masm_test_shl proc shl al, cl shl al, 1 shl al, 2 shl al, -1 shl ax, cl shl ax, 1 shl ax, 2 shl eax, cl shl eax, 1 shl eax, 2 shl byte ptr[eax], cl shl byte ptr[eax], 1 shl byte ptr[eax], 2 shl word ptr[eax], cl shl word ptr[eax], 1 shl word ptr[eax], 2 shl dword ptr[eax], cl shl dword ptr[eax], 1 shl dword ptr[eax], 2 masm_test_shl endp ;---------------------------------------- ; SHR ;---------------------------------------- masm_test_shr proc shr al, cl shr al, 1 shr al, 2 shr al, -1 shr ax, cl shr ax, 1 shr ax, 2 shr eax, cl shr eax, 1 shr eax, 2 shr byte ptr[eax], cl shr byte ptr[eax], 1 shr byte ptr[eax], 2 shr word ptr[eax], cl shr word ptr[eax], 1 shr word ptr[eax], 2 shr dword ptr[eax], cl shr dword ptr[eax], 1 shr dword ptr[eax], 2 masm_test_shr endp ;---------------------------------------- ; RCL ;---------------------------------------- masm_test_rcl proc rcl al, cl rcl al, 1 rcl al, 2 rcl al, -1 rcl ax, cl rcl ax, 1 rcl ax, 2 rcl eax, cl rcl eax, 1 rcl eax, 2 rcl byte ptr[eax], cl rcl byte ptr[eax], 1 rcl byte ptr[eax], 2 rcl word ptr[eax], cl rcl word ptr[eax], 1 rcl word ptr[eax], 2 rcl dword ptr[eax], cl rcl dword ptr[eax], 1 rcl dword ptr[eax], 2 masm_test_rcl endp ;---------------------------------------- ; RCR ;---------------------------------------- masm_test_rcr proc rcr al, cl rcr al, 1 rcr al, 2 rcr al, -1 rcr ax, cl rcr ax, 1 rcr ax, 2 rcr eax, cl rcr eax, 1 rcr eax, 2 rcr byte ptr[eax], cl rcr byte ptr[eax], 1 rcr byte ptr[eax], 2 rcr word ptr[eax], cl rcr word ptr[eax], 1 rcr word ptr[eax], 2 rcr dword ptr[eax], cl rcr dword ptr[eax], 1 rcr dword ptr[eax], 2 masm_test_rcr endp ;---------------------------------------- ; ROL ;---------------------------------------- masm_test_rol proc rol al, cl rol al, 1 rol al, 2 rol al, -1 rol ax, cl rol ax, 1 rol ax, 2 rol eax, cl rol eax, 1 rol eax, 2 rol byte ptr[eax], cl rol byte ptr[eax], 1 rol byte ptr[eax], 2 rol word ptr[eax], cl rol word ptr[eax], 1 rol word ptr[eax], 2 rol dword ptr[eax], cl rol dword ptr[eax], 1 rol dword ptr[eax], 2 masm_test_rol endp ;---------------------------------------- ; ROR ;---------------------------------------- masm_test_ror proc ror al, cl ror al, 1 ror al, 2 ror al, -1 ror ax, cl ror ax, 1 ror ax, 2 ror eax, cl ror eax, 1 ror eax, 2 ror byte ptr[eax], cl ror byte ptr[eax], 1 ror byte ptr[eax], 2 ror word ptr[eax], cl ror word ptr[eax], 1 ror word ptr[eax], 2 ror dword ptr[eax], cl ror dword ptr[eax], 1 ror dword ptr[eax], 2 masm_test_ror endp ;---------------------------------------- ; INC/DEC ;---------------------------------------- masm_test_inc_dec proc inc al inc ax inc eax inc byte ptr[eax] inc word ptr[eax] inc dword ptr[eax] dec al dec ax dec eax dec byte ptr[eax] dec word ptr[eax] dec dword ptr[eax] masm_test_inc_dec endp ;---------------------------------------- ; PUSH/POP ;---------------------------------------- masm_test_push_pop proc push ax push word ptr[eax] push 1h push 100h push 10000h push -1h push -100h push -10000h pop ax pop word ptr[eax] push eax push dword ptr[eax] pop eax pop dword ptr[eax] masm_test_push_pop endp ;---------------------------------------- ; ADD ;---------------------------------------- masm_test_add proc add al, al add ax, ax add eax, eax add al, 1h add al, -1h add ax, 1h add ax, 100h add ax, -1h add ax, -100h add eax, 1h add eax, 100h add eax, 10000h add eax, -1h add eax, -100h add eax, -10000h add cl, 1h add cl, -1h add cx, 1h add cx, 100h add cx, -1h add cx, -100h add ecx, 1h add ecx, 100h add ecx, 10000h add ecx, -1h add ecx, -100h add ecx, -10000h add byte ptr[eax], 1 add word ptr[eax], 1 add dword ptr[eax], 1 add al, byte ptr[eax] add ax, word ptr[eax] add eax, dword ptr[eax] add byte ptr[eax], al add word ptr[eax], ax add dword ptr[eax], eax masm_test_add endp ;---------------------------------------- ; OR ;---------------------------------------- masm_test_or proc or al, al or ax, ax or eax, eax or al, 1h or al, -1h or ax, 1h or ax, 100h or ax, -1h or ax, -100h or eax, 1h or eax, 100h or eax, 10000h or eax, -1h or eax, -100h or eax, -10000h or cl, 1h or cl, -1h or cx, 1h or cx, 100h or cx, -1h or cx, -100h or ecx, 1h or ecx, 100h or ecx, 10000h or ecx, -1h or ecx, -100h or ecx, -10000h or byte ptr[eax], 1 or word ptr[eax], 1 or dword ptr[eax], 1 or al, byte ptr[eax] or ax, word ptr[eax] or eax, dword ptr[eax] or byte ptr[eax], al or word ptr[eax], ax or dword ptr[eax], eax masm_test_or endp ;---------------------------------------- ; ADC ;---------------------------------------- masm_test_adc proc adc al, al adc ax, ax adc eax, eax adc al, 1h adc al, -1h adc ax, 1h adc ax, 100h adc ax, -1h adc ax, -100h adc eax, 1h adc eax, 100h adc eax, 10000h adc eax, -1h adc eax, -100h adc eax, -10000h adc cl, 1h adc cl, -1h adc cx, 1h adc cx, 100h adc cx, -1h adc cx, -100h adc ecx, 1h adc ecx, 100h adc ecx, 10000h adc ecx, -1h adc ecx, -100h adc ecx, -10000h adc byte ptr[eax], 1 adc word ptr[eax], 1 adc dword ptr[eax], 1 adc al, byte ptr[eax] adc ax, word ptr[eax] adc eax, dword ptr[eax] adc byte ptr[eax], al adc word ptr[eax], ax adc dword ptr[eax], eax masm_test_adc endp ;---------------------------------------- ; SBB ;---------------------------------------- masm_test_sbb proc sbb al, al sbb ax, ax sbb eax, eax sbb al, 1h sbb al, -1h sbb ax, 1h sbb ax, 100h sbb ax, -1h sbb ax, -100h sbb eax, 1h sbb eax, 100h sbb eax, 10000h sbb eax, -1h sbb eax, -100h sbb eax, -10000h sbb cl, 1h sbb cl, -1h sbb cx, 1h sbb cx, 100h sbb cx, -1h sbb cx, -100h sbb ecx, 1h sbb ecx, 100h sbb ecx, 10000h sbb ecx, -1h sbb ecx, -100h sbb ecx, -10000h sbb byte ptr[eax], 1 sbb word ptr[eax], 1 sbb dword ptr[eax], 1 sbb al, byte ptr[eax] sbb ax, word ptr[eax] sbb eax, dword ptr[eax] sbb byte ptr[eax], al sbb word ptr[eax], ax sbb dword ptr[eax], eax masm_test_sbb endp ;---------------------------------------- ; AND ;---------------------------------------- masm_test_and proc and al, al and ax, ax and eax, eax and al, 1h and al, -1h and ax, 1h and ax, 100h and ax, -1h and ax, -100h and eax, 1h and eax, 100h and eax, 10000h and eax, -1h and eax, -100h and eax, -10000h and cl, 1h and cl, -1h and cx, 1h and cx, 100h and cx, -1h and cx, -100h and ecx, 1h and ecx, 100h and ecx, 10000h and ecx, -1h and ecx, -100h and ecx, -10000h and byte ptr[eax], 1 and word ptr[eax], 1 and dword ptr[eax], 1 and al, byte ptr[eax] and ax, word ptr[eax] and eax, dword ptr[eax] and byte ptr[eax], al and word ptr[eax], ax and dword ptr[eax], eax masm_test_and endp ;---------------------------------------- ; SUB ;---------------------------------------- masm_test_sub proc sub al, al sub ax, ax sub eax, eax sub al, 1h sub al, -1h sub ax, 1h sub ax, 100h sub ax, -1h sub ax, -100h sub eax, 1h sub eax, 100h sub eax, 10000h sub eax, -1h sub eax, -100h sub eax, -10000h sub cl, 1h sub cl, -1h sub cx, 1h sub cx, 100h sub cx, -1h sub cx, -100h sub ecx, 1h sub ecx, 100h sub ecx, 10000h sub ecx, -1h sub ecx, -100h sub ecx, -10000h sub byte ptr[eax], 1 sub word ptr[eax], 1 sub dword ptr[eax], 1 sub al, byte ptr[eax] sub ax, word ptr[eax] sub eax, dword ptr[eax] sub byte ptr[eax], al sub word ptr[eax], ax sub dword ptr[eax], eax masm_test_sub endp ;---------------------------------------- ; XOR ;---------------------------------------- masm_test_xor proc xor al, al xor ax, ax xor eax, eax xor al, 1h xor al, -1h xor ax, 1h xor ax, 100h xor ax, -1h xor ax, -100h xor eax, 1h xor eax, 100h xor eax, 10000h xor eax, -1h xor eax, -100h xor eax, -10000h xor cl, 1h xor cl, -1h xor cx, 1h xor cx, 100h xor cx, -1h xor cx, -100h xor ecx, 1h xor ecx, 100h xor ecx, 10000h xor ecx, -1h xor ecx, -100h xor ecx, -10000h xor byte ptr[eax], 1 xor word ptr[eax], 1 xor dword ptr[eax], 1 xor al, byte ptr[eax] xor ax, word ptr[eax] xor eax, dword ptr[eax] xor byte ptr[eax], al xor word ptr[eax], ax xor dword ptr[eax], eax masm_test_xor endp ;---------------------------------------- ; CMP ;---------------------------------------- masm_test_cmp proc cmp al, al cmp ax, ax cmp eax, eax cmp al, 1h cmp al, -1h cmp ax, 1h cmp ax, 100h cmp ax, -1h cmp ax, -100h cmp eax, 1h cmp eax, 100h cmp eax, 10000h cmp eax, -1h cmp eax, -100h cmp eax, -10000h cmp cl, 1h cmp cl, -1h cmp cx, 1h cmp cx, 100h cmp cx, -1h cmp cx, -100h cmp ecx, 1h cmp ecx, 100h cmp ecx, 10000h cmp ecx, -1h cmp ecx, -100h cmp ecx, -10000h cmp byte ptr[eax], 1 cmp word ptr[eax], 1 cmp dword ptr[eax], 1 cmp al, byte ptr[eax] cmp ax, word ptr[eax] cmp eax, dword ptr[eax] cmp byte ptr[eax], al cmp word ptr[eax], ax cmp dword ptr[eax], eax masm_test_cmp endp ;---------------------------------------- ; XCHG ;---------------------------------------- masm_test_xchg proc xchg al, al xchg ax, ax xchg eax, eax xchg al, cl xchg cl, al xchg ax, cx xchg cx, ax xchg eax, ecx xchg ecx, eax xchg ecx, edx xchg edx, ecx xchg al, byte ptr[ecx] xchg byte ptr[ecx], al xchg cl, byte ptr[eax] xchg byte ptr[eax], cl xchg ax, word ptr[ecx] xchg word ptr[ecx], ax xchg cx, word ptr[eax] xchg word ptr[eax], cx xchg eax, dword ptr[ecx] xchg dword ptr[ecx], eax xchg ecx, dword ptr[eax] xchg dword ptr[eax], ecx masm_test_xchg endp ;---------------------------------------- ; TEST ;---------------------------------------- masm_test_test proc test al, al test ax, ax test eax, eax test al, 1 test ax, 1 test eax, 1 test al, -1 test ax, -1 test eax, -1 test cl, 1 test cx, 1 test ecx, 1 test cl, -1 test cx, -1 test ecx, -1 test al, cl test ax, cx test eax, ecx test cl, al test cx, ax test ecx, eax test byte ptr[eax], 1 test word ptr[eax], 1 test dword ptr[eax], 1 test byte ptr[eax], cl test word ptr[eax], cx test dword ptr[eax], ecx masm_test_test endp ;---------------------------------------- ; MOV/MOVZX ;---------------------------------------- masm_test_mov proc mov al, al mov ax, ax mov eax, eax mov al, cl mov ax, cx mov eax, ecx mov byte ptr[eax], cl mov word ptr[eax], cx mov dword ptr[eax], ecx mov al, byte ptr[ecx] mov ax, word ptr[ecx] mov eax, dword ptr[ecx] mov al, 1 mov al, -1 mov ax, 1 mov ax, -1 mov eax, 1 mov eax, -1 mov byte ptr[eax], 1 mov word ptr[eax], 1 mov dword ptr[eax], 1 movzx ax, cl movzx eax, cl movzx eax, cx movzx ax, byte ptr[ecx] movzx eax, byte ptr[ecx] movzx eax, word ptr[ecx] masm_test_mov endp ;---------------------------------------- ; LEA ;---------------------------------------- masm_test_lea proc lea eax, dword ptr[eax] lea eax, dword ptr[esp] lea eax, dword ptr[ebp] lea eax, dword ptr[eax + ecx] lea eax, dword ptr[ecx + eax] lea eax, dword ptr[esp + ecx] lea eax, dword ptr[ecx + esp] lea eax, dword ptr[ebp + ecx] lea eax, dword ptr[ecx + ebp] lea eax, dword ptr[esp + ebp] lea eax, dword ptr[ebp + esp] lea eax, dword ptr[eax + 1h] lea eax, dword ptr[esp + 1h] lea eax, dword ptr[ebp + 1h] lea eax, dword ptr[eax + 100h] lea eax, dword ptr[esp + 100h] lea eax, dword ptr[ebp + 100h] lea eax, dword ptr[eax + 10000h] lea eax, dword ptr[esp + 10000h] lea eax, dword ptr[ebp + 10000h] lea eax, dword ptr[eax * 2] lea eax, dword ptr[ebp * 2] lea eax, dword ptr[eax * 4] lea eax, dword ptr[ebp * 4] lea eax, dword ptr[eax * 8] lea eax, dword ptr[ebp * 8] lea eax, dword ptr[eax * 2 + 1h] lea eax, dword ptr[ebp * 2 + 1h] lea eax, dword ptr[eax * 2 + 100h] lea eax, dword ptr[ebp * 2 + 100h] lea eax, dword ptr[eax * 2 + 10000h] lea eax, dword ptr[ebp * 2 + 10000h] lea eax, dword ptr[eax + ecx * 2] lea eax, dword ptr[ecx + eax * 2] lea eax, dword ptr[esp + ecx * 2] lea eax, dword ptr[ebp + ecx * 2] lea eax, dword ptr[ecx + ebp * 2] lea eax, dword ptr[esp + ebp * 2] lea eax, dword ptr[eax + ecx + 1h] lea eax, dword ptr[ecx + eax + 1h] lea eax, dword ptr[esp + ecx + 1h] lea eax, dword ptr[ecx + esp + 1h] lea eax, dword ptr[ebp + ecx + 1h] lea eax, dword ptr[ecx + ebp + 1h] lea eax, dword ptr[esp + ebp + 1h] lea eax, dword ptr[ebp + esp + 1h] lea eax, dword ptr[eax + ecx + 100h] lea eax, dword ptr[ecx + eax + 100h] lea eax, dword ptr[esp + ecx + 100h] lea eax, dword ptr[ecx + esp + 100h] lea eax, dword ptr[ebp + ecx + 100h] lea eax, dword ptr[ecx + ebp + 100h] lea eax, dword ptr[esp + ebp + 100h] lea eax, dword ptr[ebp + esp + 100h] lea eax, dword ptr[eax + ecx + 10000h] lea eax, dword ptr[ecx + eax + 10000h] lea eax, dword ptr[esp + ecx + 10000h] lea eax, dword ptr[ecx + esp + 10000h] lea eax, dword ptr[ebp + ecx + 10000h] lea eax, dword ptr[ecx + ebp + 10000h] lea eax, dword ptr[esp + ebp + 10000h] lea eax, dword ptr[ebp + esp + 10000h] lea eax, dword ptr[eax + ecx * 2 + 1h] lea eax, dword ptr[ecx + eax * 2 + 1h] lea eax, dword ptr[esp + ecx * 2 + 1h] lea eax, dword ptr[ebp + ecx * 2 + 1h] lea eax, dword ptr[ecx + ebp * 2 + 1h] lea eax, dword ptr[esp + ebp * 2 + 1h] lea eax, dword ptr[eax + ecx * 2 + 100h] lea eax, dword ptr[ecx + eax * 2 + 100h] lea eax, dword ptr[esp + ecx * 2 + 100h] lea eax, dword ptr[ebp + ecx * 2 + 100h] lea eax, dword ptr[ecx + ebp * 2 + 100h] lea eax, dword ptr[esp + ebp * 2 + 100h] lea eax, dword ptr[eax + ecx * 2 + 10000h] lea eax, dword ptr[ecx + eax * 2 + 10000h] lea eax, dword ptr[esp + ecx * 2 + 10000h] lea eax, dword ptr[ebp + ecx * 2 + 10000h] lea eax, dword ptr[ecx + ebp * 2 + 10000h] lea eax, dword ptr[esp + ebp * 2 + 10000h] lea eax, dword ptr[eax - 1h] lea eax, dword ptr[eax - 100h] lea eax, dword ptr[eax - 10000h] masm_test_lea endp ;---------------------------------------- ; FLD ;---------------------------------------- masm_test_fld proc fld real4 ptr[esp] fld real8 ptr[esp] fld real10 ptr[esp] fld st(0) fld st(7) masm_test_fld endp ;---------------------------------------- ; JMP ;---------------------------------------- masm_test_jmp proc ; jump short loop L1 loope L1 loopne L1 jmp L1 ja L1 jae L1 jb L1 jbe L1 jc L1 jcxz L1 jecxz L1 je L1 jg L1 jge L1 jl L1 jle L1 jna L1 jnae L1 jnb L1 jnbe L1 jnc L1 jne L1 jng L1 jnge L1 jnl L1 jnle L1 jno L1 jnp L1 jns L1 jnz L1 jo L1 jp L1 jpe L1 jpo L1 js L1 jz L1 L1: pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes pabsb xmm0, xmmword ptr[esp + ecx + 100h] ; 10 bytes ; jump near jmp L1 ja L1 jae L1 jb L1 jbe L1 jc L1 je L1 jg L1 jge L1 jl L1 jle L1 jna L1 jnae L1 jnb L1 jnbe L1 jnc L1 jne L1 jng L1 jnge L1 jnl L1 jnle L1 jno L1 jnp L1 jns L1 jnz L1 jo L1 jp L1 jpe L1 jpo L1 js L1 jz L1 masm_test_jmp endp ;---------------------------------------- ; MOVSB/MOVSW/MOVSD/MOVSQ ;---------------------------------------- masm_test_movs proc movsb movsw movsd rep movsb rep movsw rep movsd ;movsq ;rep movsq lodsb lodsw lodsd rep lodsb rep lodsw rep lodsd ;lodsq ;rep lodsq stosb stosw stosd rep stosb rep stosw rep stosd ;stosq ;rep stosq cmpsb cmpsw cmpsd ;cmpsq masm_test_movs endp ;---------------------------------------- ; NEG/NOT ;---------------------------------------- masm_test_neg_not proc neg al neg ax neg eax neg byte ptr[esp] neg word ptr[esp] neg dword ptr[esp] not al not ax not eax not byte ptr[esp] not word ptr[esp] not dword ptr[esp] masm_test_neg_not endp ;---------------------------------------- ; DIV/IDIV/MUL ;---------------------------------------- masm_test_div_idiv_mul proc div al div ax div eax div byte ptr[esp] div word ptr[esp] div dword ptr[esp] idiv al idiv ax idiv eax idiv byte ptr[esp] idiv word ptr[esp] idiv dword ptr[esp] mul al mul ax mul eax mul byte ptr[esp] mul word ptr[esp] mul dword ptr[esp] masm_test_div_idiv_mul endp ;---------------------------------------- ; IMUL ;---------------------------------------- masm_test_imul proc imul al imul ax imul eax imul byte ptr[esp] imul word ptr[esp] imul dword ptr[esp] imul ax, ax imul ax, word ptr[esp] imul eax, eax imul eax, dword ptr[esp] imul ax, ax, 1h imul ax, ax, -1h imul ax, ax, 100h imul eax, eax, 1h imul eax, eax, -1h imul eax, eax, 100h masm_test_imul endp ;---------------------------------------- ; FST/FSTP ;---------------------------------------- masm_test_fst proc fst real4 ptr[esp] fst real8 ptr[esp] fst st(0) fst st(7) fstp real4 ptr[esp] fstp real8 ptr[esp] fstp real10 ptr[esp] fstp st(0) fstp st(7) masm_test_fst endp ;---------------------------------------- ; setcc ;---------------------------------------- masm_test_setcc proc seta bl seta byte ptr[esp] setae bl setae byte ptr[esp] setb bl setb byte ptr[esp] setbe bl setbe byte ptr[esp] setc bl setc byte ptr[esp] sete bl sete byte ptr[esp] setg bl setg byte ptr[esp] setge bl setge byte ptr[esp] setl bl setl byte ptr[esp] setle bl setle byte ptr[esp] setna bl setna byte ptr[esp] setnae bl setnae byte ptr[esp] setnb bl setnb byte ptr[esp] setnbe bl setnbe byte ptr[esp] setnc bl setnc byte ptr[esp] setne bl setne byte ptr[esp] setng bl setng byte ptr[esp] setnge bl setnge byte ptr[esp] setnl bl setnl byte ptr[esp] setnle bl setnle byte ptr[esp] setno bl setno byte ptr[esp] setnp bl setnp byte ptr[esp] setns bl setns byte ptr[esp] setnz bl setnz byte ptr[esp] seto bl seto byte ptr[esp] setp bl setp byte ptr[esp] setpe bl setpe byte ptr[esp] setpo bl setpo byte ptr[esp] sets bl sets byte ptr[esp] setz bl setz byte ptr[esp] masm_test_setcc endp ;---------------------------------------- ; cmovcc ;---------------------------------------- masm_test_cmovcc proc cmova bx, dx cmova bx, word ptr[esp] cmovae bx, dx cmovae bx, word ptr[esp] cmovb bx, dx cmovb bx, word ptr[esp] cmovbe bx, dx cmovbe bx, word ptr[esp] cmovc bx, dx cmovc bx, word ptr[esp] cmove bx, dx cmove bx, word ptr[esp] cmovg bx, dx cmovg bx, word ptr[esp] cmovge bx, dx cmovge bx, word ptr[esp] cmovl bx, dx cmovl bx, word ptr[esp] cmovle bx, dx cmovle bx, word ptr[esp] cmovna bx, dx cmovna bx, word ptr[esp] cmovnae bx, dx cmovnae bx, word ptr[esp] cmovnb bx, dx cmovnb bx, word ptr[esp] cmovnbe bx, dx cmovnbe bx, word ptr[esp] cmovnc bx, dx cmovnc bx, word ptr[esp] cmovne bx, dx cmovne bx, word ptr[esp] cmovng bx, dx cmovng bx, word ptr[esp] cmovnge bx, dx cmovnge bx, word ptr[esp] cmovnl bx, dx cmovnl bx, word ptr[esp] cmovnle bx, dx cmovnle bx, word ptr[esp] cmovno bx, dx cmovno bx, word ptr[esp] cmovnp bx, dx cmovnp bx, word ptr[esp] cmovns bx, dx cmovns bx, word ptr[esp] cmovnz bx, dx cmovnz bx, word ptr[esp] cmovo bx, dx cmovo bx, word ptr[esp] cmovp bx, dx cmovp bx, word ptr[esp] cmovpe bx, dx cmovpe bx, word ptr[esp] cmovpo bx, dx cmovpo bx, word ptr[esp] cmovs bx, dx cmovs bx, word ptr[esp] cmovz bx, dx cmovz bx, word ptr[esp] cmova ebx, edx cmova ebx, dword ptr[esp] cmovae ebx, edx cmovae ebx, dword ptr[esp] cmovb ebx, edx cmovb ebx, dword ptr[esp] cmovbe ebx, edx cmovbe ebx, dword ptr[esp] cmovc ebx, edx cmovc ebx, dword ptr[esp] cmove ebx, edx cmove ebx, dword ptr[esp] cmovg ebx, edx cmovg ebx, dword ptr[esp] cmovge ebx, edx cmovge ebx, dword ptr[esp] cmovl ebx, edx cmovl ebx, dword ptr[esp] cmovle ebx, edx cmovle ebx, dword ptr[esp] cmovna ebx, edx cmovna ebx, dword ptr[esp] cmovnae ebx, edx cmovnae ebx, dword ptr[esp] cmovnb ebx, edx cmovnb ebx, dword ptr[esp] cmovnbe ebx, edx cmovnbe ebx, dword ptr[esp] cmovnc ebx, edx cmovnc ebx, dword ptr[esp] cmovne ebx, edx cmovne ebx, dword ptr[esp] cmovng ebx, edx cmovng ebx, dword ptr[esp] cmovnge ebx, edx cmovnge ebx, dword ptr[esp] cmovnl ebx, edx cmovnl ebx, dword ptr[esp] cmovnle ebx, edx cmovnle ebx, dword ptr[esp] cmovno ebx, edx cmovno ebx, dword ptr[esp] cmovnp ebx, edx cmovnp ebx, dword ptr[esp] cmovns ebx, edx cmovns ebx, dword ptr[esp] cmovnz ebx, edx cmovnz ebx, dword ptr[esp] cmovo ebx, edx cmovo ebx, dword ptr[esp] cmovp ebx, edx cmovp ebx, dword ptr[esp] cmovpe ebx, edx cmovpe ebx, dword ptr[esp] cmovpo ebx, edx cmovpo ebx, dword ptr[esp] cmovs ebx, edx cmovs ebx, dword ptr[esp] cmovz ebx, edx cmovz ebx, dword ptr[esp] masm_test_cmovcc endp ;---------------------------------------- ; General-Purpose Instructions B~ ;---------------------------------------- masm_test_gpi_b proc bsf bx, dx bsf bx, word ptr[esp] bsf ebx, edx bsf ebx, dword ptr[esp] bsr bx, dx bsr bx, word ptr[esp] bsr ebx, edx bsr ebx, dword ptr[esp] bswap ebx bt bx, dx bt word ptr[eax], dx bt ebx, edx bt dword ptr[ecx], edx bt bx, 55h bt word ptr[eax], 55h bt ebx, 55h bt dword ptr[ecx], 55h btc bx, dx btc word ptr[eax], dx btc ebx, edx btc dword ptr[ecx], edx btc bx, 55h btc word ptr[eax], 55h btc ebx, 55h btc dword ptr[ecx], 55h btr bx, dx btr word ptr[eax], dx btr ebx, edx btr dword ptr[ecx], edx btr bx, 55h btr word ptr[eax], 55h btr ebx, 55h btr dword ptr[ecx], 55h bts bx, dx bts word ptr[eax], dx bts ebx, edx bts dword ptr[ecx], edx bts bx, 55h bts word ptr[eax], 55h bts ebx, 55h bts dword ptr[ecx], 55h call bx call ebx cbw cwde clc cld cli cmc cmpxchg bl, dl cmpxchg byte ptr[esp], dl cmpxchg bx, dx cmpxchg word ptr[eax], dx cmpxchg ebx, edx cmpxchg dword ptr[ecx], edx cmpxchg8b qword ptr[ecx] cpuid cwd cdq masm_test_gpi_b endp ;---------------------------------------- ; General-Purpose Instructions E~ ;---------------------------------------- masm_test_gpi_e proc enter 100h, 0 enter 100h, 1 enter 100h, 2 hlt in al, 0AAh in ax, 0AAh in eax, 0AAh in al, dx in ax, dx in eax, dx insb insw insd rep insb rep insw rep insd int 3 int 1 into invd invlpg dword ptr[esp] iret iretd ;iretq lar bx, dx lar bx, word ptr[esp] lar ebx, edx lar ebx, word ptr[esp] ;lar rbx, rdx ;lar rbx, word ptr[esp] leave db 0Fh ;lldt cx db 0h db 0D1h db 0Fh ;lldt word ptr[ecx] db 00h db 11h db 0Fh ;lmsw cx db 01h db 0F1h db 0Fh ;lmsw word ptr[ecx] db 01h db 31h ;movbe bx, word ptr[esp] ;movbe ebx, dword ptr[esp] ;movbe word ptr[esp], bx ;movbe dword ptr[esp], ebx ;movbe rbx, qword ptr[esp] ;movbe qword ptr[esp], rbx movsx bx, dl movsx bx, byte ptr[esp] movsx ebx, dl movsx ebx, byte ptr[esp] movsx ebx, dx movsx ebx, word ptr[esp] ;movsx rbx, dl ;movsx rbx, byte ptr[esp] ;movsx rbx, dx ;movsx rbx, word ptr[esp] ;movsxd rbx, edx ;movsxd rbx, dword ptr[esp] nop out 0AAh, al out 0AAh, ax out 0AAh, eax out dx, al out dx, ax out dx, eax outsb outsw outsd rep outsb rep outsw rep outsd popa popad popf popfd ;popfq pusha pushad pushf pushfd ;pushfq db 0Fh ;rdmsr db 32h rdpmc rdtsc ret ret 1 ret -1 rsm scasb scasw scasd ;scasq sgdt dword ptr[esp] shld bx, dx, 1 shld word ptr[esp], dx, 1 shld bx, dx, cl shld word ptr[esp], dx, cl shld ebx, edx, 1 shld dword ptr[esp], edx, 1 shld ebx, edx, cl shld dword ptr[esp], edx, cl ;shld rbx, rdx, 1 ;shld qword ptr[esp], rdx, 1 ;shld rbx, rdx, cl ;shld qword ptr[esp], rdx, cl shrd bx, dx, 1 shrd word ptr[esp], dx, 1 shrd bx, dx, cl shrd word ptr[esp], dx, cl shrd ebx, edx, 1 shrd dword ptr[esp], edx, 1 shrd ebx, edx, cl shrd dword ptr[esp], edx, cl ;shrd rbx, rdx, 1 ;shrd qword ptr[esp], rdx, 1 ;shrd rbx, rdx, cl ;shrd qword ptr[esp], rdx, cl sidt dword ptr[esp] sldt bx sldt word ptr[esp] ;sldt r8 smsw bx smsw word ptr[esp] ;smsw r8 stc std sti sysenter db 0Fh ;sysexit db 35h ;swapgs ;syscall ;sysret ud2 verr bx verr word ptr[esp] verw bx verw word ptr[esp] wait xadd bl, dl xadd byte ptr[esp], dl xadd bx, dx xadd word ptr[esp], dx xadd ebx, edx xadd dword ptr[esp], edx ;xadd rbx, rdx ;xadd qword ptr[esp], rdx db 0Fh ;wbinvd db 09h db 0Fh ;wrmsr db 30h xgetbv xlatb masm_test_gpi_e endp ;---------------------------------------- ; FPU ;---------------------------------------- masm_test_fpu proc f2xm1 fabs fadd st(0), st(2) fadd st(1), st(0) fadd real4 ptr[ebx] fadd real8 ptr[edx] faddp faddp st(1), st(0) fiadd word ptr[esp] fiadd real4 ptr[ebx] fbld real10 ptr[edi] fbstp real10 ptr[edi] fchs fclex fnclex fcmovb st(0), st(2) fcmovbe st(0), st(2) fcmove st(0), st(2) fcmovnb st(0), st(2) fcmovnbe st(0), st(2) fcmovne st(0), st(2) fcmovnu st(0), st(2) fcmovu st(0), st(2) fcom fcom st(1) fcom real4 ptr[ebx] fcom real8 ptr[edx] fcomp fcomp st(1) fcomp real4 ptr[ebx] fcomp real8 ptr[edx] fcompp fcomi st(0), st(2) fcomip st(0), st(2) fcos fdecstp fdiv st(0), st(2) fdiv st(1), st(0) fdiv real4 ptr[ebx] fdiv real8 ptr[edx] fdivp fdivp st(1), st(0) fidiv word ptr[esp] fidiv real4 ptr[ebx] fdivr st(0), st(2) fdivr st(1), st(0) fdivr real4 ptr[ebx] fdivr real8 ptr[edx] fdivrp fdivrp st(1), st(0) fidivr word ptr[esp] fidivr real4 ptr[ebx] ffree st(1) ficom word ptr[esp] ficom real4 ptr[ebx] ficomp word ptr[esp] ficomp real4 ptr[ebx] fild word ptr[esp] fild real4 ptr[ebx] fild real8 ptr[edx] fincstp finit fninit fist word ptr[esp] fist real4 ptr[ebx] fistp word ptr[esp] fistp real4 ptr[ebx] fistp real8 ptr[edx] fisttp word ptr[esp] fisttp real4 ptr[ebx] fisttp real8 ptr[edx] fld real4 ptr[ecx] fld real8 ptr[esi] fld real10 ptr[esp] fld st(2) fld1 fldcw word ptr[ebp] fldenv [ebp] fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul st(0), st(2) fmul st(1), st(0) fmul real4 ptr[ebx] fmul real8 ptr[edx] fmulp fmulp st(1), st(0) fimul word ptr[esp] fimul real4 ptr[ebx] fnop fpatan fprem fprem1 fptan frndint frstor [ebp] fsave [edi] fnsave [edi] fscale fsin fsincos fsqrt fst real4 ptr[ebx] fst real8 ptr[edx] fst st(1) fstp st(1) fstp real4 ptr[ebx] fstp real8 ptr[edx] fstp real10 ptr[edi] fstcw word ptr[esp] fnstcw word ptr[esp] fstenv [ebp] fnstenv [ebp] fstsw word ptr[esp] fstsw ax fnstsw word ptr[esp] fnstsw ax fsub st(0), st(2) fsub st(1), st(0) fsub real4 ptr[ebx] fsub real8 ptr[edx] fsubp fsubp st(1), st(0) fisub word ptr[esp] fisub real4 ptr[ebx] fsubr st(0), st(2) fsubr st(1), st(0) fsubr real4 ptr[ebx] fsubr real8 ptr[edx] fsubrp fsubrp st(1), st(0) fisubr word ptr[esp] fisubr real4 ptr[ebx] ftst fucom fucom st(1) fucomp fucomp st(1) fucompp fucomi st(0), st(2) fucomip st(0), st(2) fwait fxam fxch fxch st(1) fxrstor [esp] fxsave [esp] fxtract fyl2x fyl2xp1 masm_test_fpu endp ;---------------------------------------- ; MMX ;---------------------------------------- masm_test_mmx proc emms packsswb mm1, mm2 packsswb mm1, qword ptr[ebp] packssdw mm1, mm2 packssdw mm1, qword ptr[ebp] packuswb mm1, mm2 packuswb mm1, qword ptr[ebp] paddb mm1, mm2 paddb mm1, qword ptr[ebp] paddw mm1, mm2 paddw mm1, qword ptr[ebp] paddd mm1, mm2 paddd mm1, qword ptr[ebp] paddsb mm1, mm2 paddsb mm1, qword ptr[ebp] paddsw mm1, mm2 paddsw mm1, qword ptr[ebp] paddusb mm1, mm2 paddusb mm1, qword ptr[ebp] paddusw mm1, mm2 paddusw mm1, qword ptr[ebp] pand mm1, mm2 pand mm1, qword ptr[ebp] pandn mm1, mm2 pandn mm1, qword ptr[ebp] pcmpeqb mm1, mm2 pcmpeqb mm1, qword ptr[ebp] pcmpeqw mm1, mm2 pcmpeqw mm1, qword ptr[ebp] pcmpeqd mm1, mm2 pcmpeqd mm1, qword ptr[ebp] pcmpgtb mm1, mm2 pcmpgtb mm1, qword ptr[ebp] pcmpgtw mm1, mm2 pcmpgtw mm1, qword ptr[ebp] pcmpgtd mm1, mm2 pcmpgtd mm1, qword ptr[ebp] pmaddwd mm1, mm2 pmaddwd mm1, qword ptr[ebp] pmulhw mm1, mm2 pmulhw mm1, qword ptr[ebp] pmullw mm1, mm2 pmullw mm1, qword ptr[ebp] por mm1, mm2 por mm1, qword ptr[ebp] psllw mm1, mm3 psllw mm1, qword ptr[ebp + ecx] psllw mm1, 2 pslld mm1, mm3 pslld mm1, qword ptr[ebp + ecx] pslld mm1, 2 psllq mm1, mm3 psllq mm1, qword ptr[ebp + ecx] psllq mm1, 2 psraw mm1, mm3 psraw mm1, qword ptr[ebp + ecx] psraw mm1, 2 psrad mm1, mm3 psrad mm1, qword ptr[ebp + ecx] psrad mm1, 2 psrlw mm1, mm3 psrlw mm1, qword ptr[ebp + ecx] psrlw mm1, 2 psrld mm1, mm3 psrld mm1, qword ptr[ebp + ecx] psrld mm1, 2 psrlq mm1, mm3 psrlq mm1, qword ptr[ebp + ecx] psrlq mm1, 2 psubb mm1, mm2 psubb mm1, qword ptr[ebp] psubw mm1, mm2 psubw mm1, qword ptr[ebp] psubd mm1, mm2 psubd mm1, qword ptr[ebp] psubsb mm1, mm2 psubsb mm1, qword ptr[ebp] psubsw mm1, mm2 psubsw mm1, qword ptr[ebp] psubusb mm1, mm2 psubusb mm1, qword ptr[ebp] psubusw mm1, mm2 psubusw mm1, qword ptr[ebp] punpckhbw mm2, mm3 punpckhbw mm2, qword ptr[esp] punpckhwd mm2, mm3 punpckhwd mm2, qword ptr[esp] punpckhdq mm2, mm3 punpckhdq mm2, qword ptr[esp] punpcklbw mm2, mm3 punpcklbw mm2, dword ptr[esp] punpcklwd mm2, mm3 punpcklwd mm2, dword ptr[esp] punpckldq mm2, mm3 punpckldq mm2, dword ptr[esp] pxor mm2, mm3 pxor mm2, qword ptr[esp] masm_test_mmx endp ;---------------------------------------- ; MMX2 ;---------------------------------------- masm_test_mmx2 proc pavgb mm1, mm2 pavgb mm1, qword ptr[ebp] pavgw mm1, mm2 pavgw mm1, qword ptr[ebp] pextrw ecx, mm2, 1 pinsrw mm1, ecx, 2 pinsrw mm1, word ptr[esp], 1 pmaxsw mm1, mm2 pmaxsw mm1, qword ptr[ebp] pmaxub mm1, mm2 pmaxub mm1, qword ptr[ebp] pminsw mm1, mm2 pminsw mm1, qword ptr[ebp] pminub mm1, mm2 pminub mm1, qword ptr[ebp] pmovmskb eax, mm2 pmulhuw mm1, mm2 pmulhuw mm1, qword ptr[ebp] psadbw mm1, mm2 psadbw mm1, qword ptr[ebp] pshufw mm1, mm2, 10h pshufw mm1, qword ptr[ebp], 1 masm_test_mmx2 endp ;---------------------------------------- ; SSE ;---------------------------------------- masm_test_sse proc addps xmm1, xmm2 addps xmm1, xmmword ptr[ebp] addss xmm1, xmm2 addss xmm1, dword ptr[esi] andps xmm1, xmm2 andps xmm1, xmmword ptr[ebp] andnps xmm1, xmm2 andnps xmm1, xmmword ptr[ebp] cmpeqps xmm1, xmm2 cmpeqps xmm1, xmmword ptr[ebp] cmpltps xmm1, xmm2 cmpltps xmm1, xmmword ptr[ebp] cmpleps xmm1, xmm2 cmpleps xmm1, xmmword ptr[ebp] cmpunordps xmm1, xmm2 cmpunordps xmm1, xmmword ptr[ebp] cmpneqps xmm1, xmm2 cmpneqps xmm1, xmmword ptr[ebp] cmpnltps xmm1, xmm2 cmpnltps xmm1, xmmword ptr[ebp] cmpnleps xmm1, xmm2 cmpnleps xmm1, xmmword ptr[ebp] cmpordps xmm1, xmm2 cmpordps xmm1, xmmword ptr[ebp] cmpeqss xmm1, xmm2 cmpeqss xmm1, dword ptr[esi] cmpltss xmm1, xmm2 cmpltss xmm1, dword ptr[esi] cmpless xmm1, xmm2 cmpless xmm1, dword ptr[esi] cmpunordss xmm1, xmm2 cmpunordss xmm1, dword ptr[esi] cmpneqss xmm1, xmm2 cmpneqss xmm1, dword ptr[esi] cmpnltss xmm1, xmm2 cmpnltss xmm1, dword ptr[esi] cmpnless xmm1, xmm2 cmpnless xmm1, dword ptr[esi] cmpordss xmm1, xmm2 cmpordss xmm1, dword ptr[esi] comiss xmm1, xmm2 comiss xmm1, dword ptr[esi] cvtpi2ps xmm1, mm3 cvtpi2ps xmm1, qword ptr[esi] cvtps2pi mm1, xmm2 cvtps2pi mm1, qword ptr[esi] cvtsi2ss xmm1, ecx cvtsi2ss xmm1, dword ptr[esi] cvtss2si eax, xmm2 cvtss2si ecx, dword ptr[esi] cvttps2pi mm1, xmm2 cvttps2pi mm1, qword ptr[esi] cvttss2si eax, xmm2 cvttss2si ecx, dword ptr[esi] divps xmm1, xmm2 divps xmm1, xmmword ptr[ebp] divss xmm1, xmm2 divss xmm1, dword ptr[esi] ldmxcsr dword ptr[esi] maskmovq mm1, mm2 maxps xmm1, xmm2 maxps xmm1, xmmword ptr[ebp] maxss xmm1, xmm2 maxss xmm1, dword ptr[esi] minps xmm1, xmm2 minps xmm1, xmmword ptr[ebp] minss xmm1, xmm2 minss xmm1, dword ptr[esi] movaps xmm1, xmm2 movaps xmm1, xmmword ptr[ebp] movaps xmmword ptr[esp], xmm2 movhlps xmm1, xmm2 movhps xmm1, qword ptr[esi] movhps qword ptr[edi], xmm2 movlhps xmm1, xmm2 movlps xmm1, qword ptr[esi] movlps qword ptr[edi], xmm2 movmskps eax, xmm2 movntps xmmword ptr[esp], xmm2 movntq qword ptr[edi], mm2 movss xmm1, xmm2 movss xmm1, dword ptr[esi] movss dword ptr[ebp], xmm2 movups xmm1, xmm2 movups xmm1, xmmword ptr[ebp] movups xmmword ptr[esp], xmm2 mulps xmm1, xmm2 mulps xmm1, xmmword ptr[ebp] mulss xmm1, xmm2 mulss xmm1, dword ptr[esi] orps xmm1, xmm2 orps xmm1, xmmword ptr[ebp] prefetcht0 byte ptr[ebp] prefetcht1 byte ptr[ebp] prefetcht2 byte ptr[ebp] prefetchnta byte ptr[ebp] rcpps xmm1, xmm2 rcpps xmm1, xmmword ptr[ebp] rcpss xmm1, xmm2 rcpss xmm1, dword ptr[esi] rsqrtps xmm1, xmm2 rsqrtps xmm1, xmmword ptr[ebp] rsqrtss xmm1, xmm2 rsqrtss xmm1, dword ptr[esi] sfence shufps xmm1, xmm2, 10h shufps xmm1, xmmword ptr[ebp], 20h sqrtps xmm1, xmm2 sqrtps xmm1, xmmword ptr[ebp] sqrtss xmm1, xmm2 sqrtss xmm1, dword ptr[esi] stmxcsr dword ptr[esi] subps xmm1, xmm2 subps xmm1, xmmword ptr[ebp] subss xmm1, xmm2 subss xmm1, dword ptr[esi] ucomiss xmm1, xmm2 ucomiss xmm1, dword ptr[esi] unpckhps xmm1, xmm2 unpckhps xmm1, xmmword ptr[ebp] unpcklps xmm1, xmm2 unpcklps xmm1, xmmword ptr[ebp] xorps xmm1, xmm2 xorps xmm1, xmmword ptr[ebp] masm_test_sse endp ;---------------------------------------- ; SSE2 A~ ;---------------------------------------- masm_test_sse2_a proc addpd xmm0, xmmword ptr[esp] addpd xmm0, xmm0 addsd xmm0, qword ptr[esp] addsd xmm0, xmm0 andpd xmm0, xmmword ptr[esp] andpd xmm0, xmm0 andnpd xmm0, xmmword ptr[esp] andnpd xmm0, xmm0 clflush byte ptr[esp] cmpeqpd xmm0, xmmword ptr[esp] cmpeqpd xmm0, xmm0 cmpltpd xmm0, xmmword ptr[esp] cmpltpd xmm0, xmm0 cmplepd xmm0, xmmword ptr[esp] cmplepd xmm0, xmm0 cmpunordpd xmm0, xmmword ptr[esp] cmpunordpd xmm0, xmm0 cmpneqpd xmm0, xmmword ptr[esp] cmpneqpd xmm0, xmm0 cmpnltpd xmm0, xmmword ptr[esp] cmpnltpd xmm0, xmm0 cmpnlepd xmm0, xmmword ptr[esp] cmpnlepd xmm0, xmm0 cmpordpd xmm0, xmmword ptr[esp] cmpordpd xmm0, xmm0 cmpeqsd xmm0, qword ptr[esp] cmpeqsd xmm0, xmm0 cmpltsd xmm0, qword ptr[esp] cmpltsd xmm0, xmm0 cmplesd xmm0, qword ptr[esp] cmplesd xmm0, xmm0 cmpunordsd xmm0, qword ptr[esp] cmpunordsd xmm0, xmm0 cmpneqsd xmm0, qword ptr[esp] cmpneqsd xmm0, xmm0 cmpnltsd xmm0, qword ptr[esp] cmpnltsd xmm0, xmm0 cmpnlesd xmm0, qword ptr[esp] cmpnlesd xmm0, xmm0 cmpordsd xmm0, qword ptr[esp] cmpordsd xmm0, xmm0 comisd xmm0, qword ptr[esp] comisd xmm0, xmm0 cvtdq2pd xmm0, xmm1 cvtdq2pd xmm0, qword ptr[esp] cvtpd2dq xmm0, xmm1 cvtpd2dq xmm0, xmmword ptr[esp] cvtpd2pi mm0, xmm1 cvtpd2pi mm0, xmmword ptr[esp] cvtpd2ps xmm0, xmm1 cvtpd2ps xmm0, xmmword ptr[esp] cvtpi2pd xmm0, mm1 cvtpi2pd xmm0, qword ptr[esp] cvtps2dq xmm0, xmm1 cvtps2dq xmm0, xmmword ptr[esp] cvtdq2ps xmm0, xmm1 cvtdq2ps xmm0, xmmword ptr[esp] cvtps2pd xmm0, xmm1 cvtps2pd xmm0, qword ptr[esp] cvtsd2si eax, xmm1 cvtsd2si ecx, qword ptr[esp] cvtsd2ss xmm0, xmm1 cvtsd2ss xmm0, qword ptr[esp] cvtsi2sd xmm0, eax; cvtsi2sd xmm0, dword ptr[esp] cvtss2sd xmm0, xmm1 cvtss2sd xmm0, dword ptr[esp] cvttpd2dq xmm0, xmm1 cvttpd2dq xmm0, xmmword ptr[esp] cvttpd2pi mm0, xmm1 cvttpd2pi mm0, xmmword ptr[esp] cvttps2dq xmm0, xmm1 cvttps2dq xmm0, xmmword ptr[esp] cvttsd2si eax, xmm1 cvttsd2si eax, qword ptr[esp] masm_test_sse2_a endp ;---------------------------------------- ; SSE2 D~ ;---------------------------------------- masm_test_sse2_d proc divpd xmm0, xmm1 divpd xmm0, xmmword ptr[esp] divsd xmm0, xmm1 divsd xmm0, qword ptr[esp] lfence maskmovdqu xmm0, xmm1 maxpd xmm0, xmm1 maxpd xmm0, xmmword ptr[esp] maxsd xmm0, xmm1 maxsd xmm0, qword ptr[esp] mfence minpd xmm0, xmm1 minpd xmm0, xmmword ptr[esp] minsd xmm0, xmm1 minsd xmm0, qword ptr[esp] movapd xmm0, xmm1 movapd xmm0, xmmword ptr[esp] movapd xmmword ptr[esp], xmm0 movdqa xmm0, xmm1 movdqa xmm0, xmmword ptr[esp] movdqa xmmword ptr[esp], xmm0 movdqu xmm0, xmm1 movdqu xmm0, xmmword ptr[esp] movdqu xmmword ptr[esp], xmm0 movdq2q mm0, xmm1 movhpd qword ptr[esp], xmm1 movhpd xmm0, qword ptr[esp] movlpd qword ptr[esp], xmm1 movlpd xmm0, qword ptr[esp] movmskpd eax, xmm1 movntdq xmmword ptr[esp], xmm1 movnti dword ptr[esp], eax movntpd xmmword ptr[esp], xmm1 movq2dq xmm0, mm1 movupd xmm0, xmm1 movupd xmm0, xmmword ptr[esp] movupd xmmword ptr[esp], xmm0 mulpd xmm0, xmm1 mulpd xmm0, xmmword ptr[esp] mulsd xmm0, xmm1 mulsd xmm0, qword ptr[esp] orpd xmm0, xmm1 orpd xmm0, xmmword ptr[esp] masm_test_sse2_d endp ;---------------------------------------- ; SSE2 P~ ;---------------------------------------- masm_test_sse2_p proc packsswb xmm0, xmm1 packsswb xmm0, xmmword ptr[esp] packssdw xmm0, xmm1 packssdw xmm0, xmmword ptr[esp] packuswb xmm0, xmm1 packuswb xmm0, xmmword ptr[esp] paddb xmm0, xmm1 paddb xmm0, xmmword ptr[esp] paddw xmm0, xmm1 paddw xmm0, xmmword ptr[esp] paddd xmm0, xmm1 paddd xmm0, xmmword ptr[esp] paddq mm0, mm1 paddq mm0, qword ptr[esp] paddq xmm0, xmm1 paddq xmm0, xmmword ptr[esp] paddsb xmm0, xmm1 paddsb xmm0, xmmword ptr[esp] paddsw xmm0, xmm1 paddsw xmm0, xmmword ptr[esp] paddusb xmm0, xmm1 paddusb xmm0, xmmword ptr[esp] paddusw xmm0, xmm1 paddusw xmm0, xmmword ptr[esp] pand xmm0, xmm1 pand xmm0, xmmword ptr[esp] pandn xmm0, xmm1 pandn xmm0, xmmword ptr[esp] pause pavgb xmm0, xmm1 pavgb xmm0, xmmword ptr[esp] pavgw xmm0, xmm1 pavgw xmm0, xmmword ptr[esp] pcmpeqb xmm0, xmm1 pcmpeqb xmm0, xmmword ptr[esp] pcmpeqw xmm0, xmm1 pcmpeqw xmm0, xmmword ptr[esp] pcmpeqd xmm0, xmm1 pcmpeqd xmm0, xmmword ptr[esp] pcmpgtb xmm0, xmm1 pcmpgtb xmm0, xmmword ptr[esp] pcmpgtw xmm0, xmm1 pcmpgtw xmm0, xmmword ptr[esp] pcmpgtd xmm0, xmm1 pcmpgtd xmm0, xmmword ptr[esp] pextrw eax, xmm1, 1 pinsrw xmm0, ecx, 3 pinsrw xmm0, word ptr[esp], 4 pmaddwd xmm0, xmm1 pmaddwd xmm0, xmmword ptr[esp] pmaxsw xmm0, xmm1 pmaxsw xmm0, xmmword ptr[esp] pmaxub xmm0, xmm1 pmaxub xmm0, xmmword ptr[esp] pminsw xmm0, xmm1 pminsw xmm0, xmmword ptr[esp] pminub xmm0, xmm1 pminub xmm0, xmmword ptr[esp] pmovmskb eax, xmm1 pmulhuw xmm0, xmm1 pmulhuw xmm0, xmmword ptr[esp] pmulhw xmm0, xmm1 pmulhw xmm0, xmmword ptr[esp] pmullw xmm0, xmm1 pmullw xmm0, xmmword ptr[esp] pmuludq mm0, mm1 pmuludq mm0, qword ptr[esp] pmuludq xmm0, xmm1 pmuludq xmm0, xmmword ptr[esp] por xmm0, xmm1 por xmm0, xmmword ptr[esp] psadbw xmm0, xmm1 psadbw xmm0, xmmword ptr[esp] pshufd xmm0, xmm1, 1Bh pshufd xmm0, xmmword ptr[esp], 0Bh pshufhw xmm0, xmm1, 1Ah pshufhw xmm0, xmmword ptr[esp], 18h pshuflw xmm0, xmm1, 14h pshuflw xmm0, xmmword ptr[esp], 12h psllw xmm0, xmm1 psllw xmm0, xmmword ptr[ebp] psllw xmm0, 2 pslld xmm0, xmm1 pslld xmm0, xmmword ptr[ebp] pslld xmm0, 2 psllq xmm0, xmm1 psllq xmm0, xmmword ptr[ebp] psllq xmm0, 2 pslldq xmm0, 2 psraw xmm0, xmm1 psraw xmm0, xmmword ptr[ebp] psraw xmm0, 2 psrad xmm0, xmm1 psrad xmm0, xmmword ptr[ebp] psrad xmm0, 2 psrlw xmm0, xmm1 psrlw xmm0, xmmword ptr[ebp] psrlw xmm0, 2 psrld xmm0, xmm1 psrld xmm0, xmmword ptr[ebp] psrld xmm0, 2 psrlq xmm0, xmm1 psrlq xmm0, xmmword ptr[ebp] psrlq xmm0, 2 psrldq xmm0, 2 psubb xmm0, xmm1 psubb xmm0, xmmword ptr[esp] psubw xmm0, xmm1 psubw xmm0, xmmword ptr[esp] psubd xmm0, xmm1 psubd xmm0, xmmword ptr[esp] psubq mm0, mm1 psubq mm0, qword ptr[esp] psubq xmm0, xmm1 psubq xmm0, xmmword ptr[esp] psubsb xmm0, xmm1 psubsb xmm0, xmmword ptr[esp] psubsw xmm0, xmm1 psubsw xmm0, xmmword ptr[esp] psubusb xmm0, xmm1 psubusb xmm0, xmmword ptr[esp] psubusw xmm0, xmm1 psubusw xmm0, xmmword ptr[esp] punpckhbw xmm0, xmm1 punpckhbw xmm0, xmmword ptr[esp] punpckhwd xmm0, xmm1 punpckhwd xmm0, xmmword ptr[esp] punpckhdq xmm0, xmm1 punpckhdq xmm0, xmmword ptr[esp] punpckhqdq xmm0, xmm1 punpckhqdq xmm0, xmmword ptr[esp] punpcklbw xmm0, xmm1 punpcklbw xmm0, xmmword ptr[esp] punpcklwd xmm0, xmm1 punpcklwd xmm0, xmmword ptr[esp] punpckldq xmm0, xmm1 punpckldq xmm0, xmmword ptr[esp] punpcklqdq xmm0, xmm1 punpcklqdq xmm0, xmmword ptr[esp] pxor xmm0, xmm1 pxor xmm0, xmmword ptr[esp] masm_test_sse2_p endp ;---------------------------------------- ; SSE2 S~ ;---------------------------------------- masm_test_sse2_s proc shufpd xmm0, xmm1, 2 shufpd xmm0, xmmword ptr[esp], 1 sqrtpd xmm0, xmm1 sqrtpd xmm0, xmmword ptr[esp] sqrtsd xmm0, xmm1 sqrtsd xmm0, qword ptr[ebp] subpd xmm0, xmm1 subpd xmm0, xmmword ptr[esp] subsd xmm0, xmm1 subsd xmm0, qword ptr[ebp] ucomisd xmm0, xmm1 ucomisd xmm0, qword ptr[ebp] unpckhpd xmm0, xmm1 unpckhpd xmm0, xmmword ptr[esp] unpcklpd xmm0, xmm1 unpcklpd xmm0, xmmword ptr[esp] xorpd xmm0, xmm1 xorpd xmm0, xmmword ptr[esp] masm_test_sse2_s endp ;---------------------------------------- ; MOVD/MOVQ ;---------------------------------------- masm_test_movd_movq proc movd mm0, dword ptr[eax] movd mm0, eax movq mm0, qword ptr[eax] movd dword ptr[eax], mm0 movd eax, mm0 movq qword ptr[eax], mm0 movd xmm0, dword ptr[eax] movd xmm0, eax movq xmm0, qword ptr[eax] movd dword ptr[eax], xmm0 movd eax, xmm0 movq qword ptr[eax], xmm0 movq mm0, mm1 movq mm0, qword ptr[eax] movq qword ptr[eax], mm0 movq xmm0, xmm0 movq xmm0, qword ptr[eax] movq qword ptr[eax], xmm0 masm_test_movd_movq endp ;---------------------------------------- ; MOVSD/MOVSS ;---------------------------------------- masm_test_movsd_movss proc movsd xmm0, xmm1 movsd xmm0, qword ptr[esp] movsd qword ptr[esp], xmm0 movss xmm0, xmm1 movss xmm0, dword ptr[esp] movss dword ptr[esp], xmm0 masm_test_movsd_movss endp ;---------------------------------------- ; SSE3 ;---------------------------------------- masm_test_sse3 proc addsubps xmm0, xmm1 addsubps xmm0, xmmword ptr[ebp] addsubpd xmm0, xmm1 addsubpd xmm0, xmmword ptr[ebp] fisttp word ptr[ebp] fisttp dword ptr[ebp] fisttp qword ptr[ebp] haddps xmm0, xmm1 haddps xmm0, xmmword ptr[ebp] haddpd xmm0, xmm1 haddpd xmm0, xmmword ptr[ebp] hsubps xmm0, xmm1 hsubps xmm0, xmmword ptr[ebp] hsubpd xmm0, xmm1 hsubpd xmm0, xmmword ptr[ebp] lddqu xmm0, xmmword ptr[ebp] movddup xmm0, xmm1 movddup xmm0, qword ptr[ebp] movshdup xmm0, xmm1 movshdup xmm0, xmmword ptr[ebp] movsldup xmm0, xmm1 movsldup xmm0, xmmword ptr[ebp] monitor eax,ecx,edx mwait eax,ecx masm_test_sse3 endp ;---------------------------------------- ; SSSE3 ;---------------------------------------- masm_test_ssse3 proc pabsb mm0, mm1 pabsb mm0, qword ptr[esp] pabsb xmm0, xmm1 pabsb xmm0, xmmword ptr[esp] pabsw mm0, mm1 pabsw mm0, qword ptr[esp] pabsw xmm0, xmm1 pabsw xmm0, xmmword ptr[esp] pabsd mm0, mm1 pabsd mm0, qword ptr[esp] pabsd xmm0, xmm1 pabsd xmm0, xmmword ptr[esp] palignr mm0, mm1, 2 palignr mm0, qword ptr[esp], 3 palignr xmm0, xmm1, 4 palignr xmm0, xmmword ptr[esp], 5 phaddw mm0, mm1 phaddw mm0, qword ptr[esp] phaddw xmm0, xmm1 phaddw xmm0, xmmword ptr[esp] phaddd mm0, mm1 phaddd mm0, qword ptr[esp] phaddd xmm0, xmm1 phaddd xmm0, xmmword ptr[esp] phaddsw mm0, mm1 phaddsw mm0, qword ptr[esp] phaddsw xmm0, xmm1 phaddsw xmm0, xmmword ptr[esp] phsubw mm0, mm1 phsubw mm0, qword ptr[esp] phsubw xmm0, xmm1 phsubw xmm0, xmmword ptr[esp] phsubd mm0, mm1 phsubd mm0, qword ptr[esp] phsubd xmm0, xmm1 phsubd xmm0, xmmword ptr[esp] phsubsw mm0, mm1 phsubsw mm0, qword ptr[esp] phsubsw xmm0, xmm1 phsubsw xmm0, xmmword ptr[esp] pmaddubsw mm0, mm1 pmaddubsw mm0, qword ptr[esp] pmaddubsw xmm0, xmm1 pmaddubsw xmm0, xmmword ptr[esp] pmulhrsw mm0, mm1 pmulhrsw mm0, qword ptr[esp] pmulhrsw xmm0, xmm1 pmulhrsw xmm0, xmmword ptr[esp] pshufb mm0, mm1 pshufb mm0, qword ptr[esp] pshufb xmm0, xmm1 pshufb xmm0, xmmword ptr[esp] psignb mm0, mm1 psignb mm0, qword ptr[esp] psignb xmm0, xmm1 psignb xmm0, xmmword ptr[esp] psignw mm0, mm1 psignw mm0, qword ptr[esp] psignw xmm0, xmm1 psignw xmm0, xmmword ptr[esp] psignd mm0, mm1 psignd mm0, qword ptr[esp] psignd xmm0, xmm1 psignd xmm0, xmmword ptr[esp] masm_test_ssse3 endp ;---------------------------------------- ; SSE4.1 ;---------------------------------------- masm_test_sse4_1 proc blendps xmm1, xmm2, 1 blendps xmm1, xmmword ptr[esp], 2 blendpd xmm1, xmm2, 3 blendpd xmm1, xmmword ptr[esp], 4 blendvps xmm1, xmm2, xmm0 blendvps xmm1, xmmword ptr[esp], xmm0 blendvpd xmm1, xmm2, xmm0 blendvpd xmm1, xmmword ptr[esp], xmm0 dpps xmm1, xmm2, 1 dpps xmm1, xmmword ptr[esp], 2 dppd xmm1, xmm2, 0 dppd xmm1, xmmword ptr[esp], 1 extractps eax, xmm2, 1 extractps dword ptr[esp], xmm2, 0 insertps xmm1, xmm2, 68h insertps xmm1, dword ptr[esp], 0 movntdqa xmm1, xmmword ptr[esp] mpsadbw xmm1, xmm2, 1 mpsadbw xmm1, xmmword ptr[esp], 4 packusdw xmm1, xmm2 packusdw xmm1, xmmword ptr[esp] pblendvb xmm1, xmm2, xmm0 pblendvb xmm1, xmmword ptr[esp], xmm0 pblendw xmm1, xmm2, 1 pblendw xmm1, xmmword ptr[esp], 2 pcmpeqq xmm1, xmm2 pcmpeqq xmm1, xmmword ptr[esp] pextrb eax, xmm2, 1 pextrb byte ptr[esp], xmm2, 2 pextrw word ptr[esp], xmm2, 1 pextrd eax, xmm2, 3 pextrd dword ptr[esp], xmm2, 2 phminposuw xmm2, xmm4 phminposuw xmm3, xmmword ptr[esp] pinsrb xmm1, eax, 0 pinsrb xmm1, byte ptr[esp], 2 pinsrd xmm1, eax, 1 pinsrd xmm1, dword ptr[esp], 0 pmaxsb xmm1, xmm2 pmaxsb xmm1, xmmword ptr[esp] pmaxsd xmm1, xmm2 pmaxsd xmm1, xmmword ptr[esp] pmaxuw xmm1, xmm2 pmaxuw xmm1, xmmword ptr[esp] pmaxud xmm1, xmm2 pmaxud xmm1, xmmword ptr[esp] pminsb xmm1, xmm2 pminsb xmm1, xmmword ptr[esp] pminsd xmm1, xmm2 pminsd xmm1, xmmword ptr[esp] pminuw xmm1, xmm2 pminuw xmm1, xmmword ptr[esp] pminud xmm1, xmm2 pminud xmm1, xmmword ptr[esp] pmovsxbw xmm1, xmm2 pmovsxbw xmm1, qword ptr[esp] pmovsxbd xmm1, xmm2 pmovsxbd xmm1, dword ptr[esp] pmovsxbq xmm1, xmm2 pmovsxbq xmm1, word ptr[esp] pmovsxwd xmm1, xmm2 pmovsxwd xmm1, qword ptr[esp] pmovsxwq xmm1, xmm2 pmovsxwq xmm1, dword ptr[esp] pmovsxdq xmm1, xmm2 pmovsxdq xmm1, qword ptr[esp] pmovzxbw xmm1, xmm2 pmovzxbw xmm1, qword ptr[esp] pmovzxbd xmm1, xmm2 pmovzxbd xmm1, dword ptr[esp] pmovzxbq xmm1, xmm2 pmovzxbq xmm1, word ptr[esp] pmovzxwd xmm1, xmm2 pmovzxwd xmm1, qword ptr[esp] pmovzxwq xmm1, xmm2 pmovzxwq xmm1, dword ptr[esp] pmovzxdq xmm1, xmm2 pmovzxdq xmm1, qword ptr[esp] pmuldq xmm1, xmm2 pmuldq xmm1, xmmword ptr[esp] pmulld xmm1, xmm2 pmulld xmm1, xmmword ptr[esp] ptest xmm1, xmm2 ptest xmm1, xmmword ptr[esp] roundps xmm1, xmm2, 0 roundps xmm1, xmmword ptr[esp], 1 roundpd xmm1, xmm2, 2 roundpd xmm1, xmmword ptr[esp], 3 roundss xmm1, xmm2, 0 roundss xmm1, dword ptr[esp], 1 roundsd xmm1, xmm2, 2 roundsd xmm1, qword ptr[esp], 3 masm_test_sse4_1 endp ;---------------------------------------- ; SSE4.2 ;---------------------------------------- masm_test_sse4_2 proc crc32 eax, bh crc32 eax, byte ptr[esi] crc32 eax, bx crc32 eax, word ptr[esi] crc32 eax, ecx crc32 eax, dword ptr[esi] pcmpestri xmm2, xmm1, 0 pcmpestri xmm2, xmmword ptr[esi], 0 pcmpestrm xmm2, xmm1, 1 pcmpestrm xmm2, xmmword ptr[esi], 1 pcmpistri xmm2, xmm1, 0 pcmpistri xmm2, xmmword ptr[esi], 0 pcmpistrm xmm2, xmm1, 1 pcmpistrm xmm2, xmmword ptr[esi], 1 pcmpgtq xmm0, xmm1 pcmpgtq xmm0, xmmword ptr[esi] popcnt ax, cx popcnt bx, word ptr[esi] popcnt eax, ecx popcnt eax, dword ptr[esi] masm_test_sse4_2 endp ;---------------------------------------- ; AVX A~ ;---------------------------------------- masm_test_avx_a proc vaddpd xmm1, xmm2, xmm3 vaddpd xmm1, xmm2, xmmword ptr[edx] vaddpd ymm1, ymm2, ymm3 vaddpd ymm1, ymm2, [edx] vaddps xmm1, xmm2, xmm3 vaddps xmm1, xmm2, xmmword ptr[edx] vaddps ymm1, ymm2, ymm3 vaddps ymm1, ymm2, [edx] vaddsd xmm1, xmm2, xmm4 vaddsd xmm1, xmm2, qword ptr[edx] vaddss xmm1, xmm2, xmm5 vaddss xmm1, xmm2, dword ptr[edx] vaddsubpd xmm1, xmm2, xmm3 vaddsubpd xmm1, xmm2, [edx] vaddsubpd ymm1, ymm2, ymm3 vaddsubpd ymm1, ymm2, [edx] vaddsubps xmm1, xmm2, xmm3 vaddsubps xmm1, xmm2, [edx] vaddsubps ymm1, ymm2, ymm3 vaddsubps ymm1, ymm2, [edx] aesenc xmm1, xmm2 aesenc xmm1, [edx] vaesenc xmm1, xmm2, xmm3 vaesenc xmm1, xmm2, [edx] aesenclast xmm1, xmm2 aesenclast xmm1, [edx] vaesenclast xmm1, xmm2, xmm3 vaesenclast xmm1, xmm2, [edx] aesdec xmm1, xmm2 aesdec xmm1, [edx] vaesdec xmm1, xmm2, xmm3 vaesdec xmm1, xmm2, [edx] aesdeclast xmm1, xmm2 aesdeclast xmm1, [edx] vaesdeclast xmm1, xmm2, xmm3 vaesdeclast xmm1, xmm2, [edx] aesimc xmm1, xmm2 aesimc xmm1, [edx] vaesimc xmm1, xmm2 vaesimc xmm1, [edx] aeskeygenassist xmm1, xmm2, 3 aeskeygenassist xmm1, [edx], 3 vaeskeygenassist xmm1, xmm2, 3 vaeskeygenassist xmm1, [edx], 3 vandpd xmm1, xmm2, xmm3 vandpd xmm1, xmm2, [edx] vandpd ymm1, ymm2, ymm3 vandpd ymm1, ymm2, [edx] vandps xmm1, xmm2, xmm3 vandps xmm1, xmm2, [edx] vandps ymm1, ymm2, ymm3 vandps ymm1, ymm2, [edx] vandnpd xmm1, xmm2, xmm3 vandnpd xmm1, xmm2, [edx] vandnpd ymm1, ymm2, ymm3 vandnpd ymm1, ymm2, [edx] vandnps xmm1, xmm2, xmm3 vandnps xmm1, xmm2, [edx] vandnps ymm1, ymm2, ymm3 vandnps ymm1, ymm2, [edx] masm_test_avx_a endp ;---------------------------------------- ; AVX B~ ;---------------------------------------- masm_test_avx_b proc vblendpd xmm1, xmm2, xmm2, 3 vblendpd xmm1, xmm2, [edx], 3 vblendpd ymm1, ymm2, ymm2, 3 vblendpd ymm1, ymm2, [edx], 3 vblendps xmm1, xmm2, xmm2, 3 vblendps xmm1, xmm2, [edx], 3 vblendps ymm1, ymm2, ymm2, 3 vblendps ymm1, ymm2, [edx], 3 vblendvpd xmm1, xmm2, xmm2, xmm3 vblendvpd xmm1, xmm2, [edx], xmm3 vblendvpd ymm1, ymm2, ymm2, ymm3 vblendvpd ymm1, ymm2, [edx], ymm3 vblendvps xmm1, xmm2, xmm2, xmm3 vblendvps xmm1, xmm2, [edx], xmm3 vblendvps ymm1, ymm2, ymm2, ymm3 vblendvps ymm1, ymm2, [edx], ymm3 vbroadcastss xmm1, dword ptr[edx] vbroadcastss ymm1, dword ptr[edx] vbroadcastsd ymm1, qword ptr[edx] vbroadcastf128 ymm1, xmmword ptr[edx] vcmppd xmm1, xmm2, xmm2, 3 vcmppd xmm1, xmm2, [edx], 3 vcmppd ymm1, ymm2, ymm2, 3 vcmppd ymm1, ymm2, [edx], 3 vcmpps xmm1, xmm2, xmm2, 3 vcmpps xmm1, xmm2, [edx], 3 vcmpps ymm1, ymm2, ymm2, 3 vcmpps ymm1, ymm2, [edx], 3 vcmpsd xmm1, xmm2, xmm2, 3 vcmpsd xmm1, xmm2, qword ptr[edx], 3 vcmpss xmm1, xmm2, xmm2, 3 vcmpss xmm1, xmm2, dword ptr[edx], 3 vcomisd xmm1, xmm2 vcomisd xmm1, qword ptr[edx] vcomiss xmm1, xmm2 vcomiss xmm1, dword ptr[edx] vcvtdq2pd xmm1, xmm2 vcvtdq2pd xmm1, qword ptr[edx] vcvtdq2pd ymm1, xmm2 vcvtdq2pd ymm1, xmmword ptr[edx] vcvtdq2ps xmm1, xmm2 vcvtdq2ps xmm1, xmmword ptr[edx] vcvtdq2ps ymm1, ymm2 vcvtdq2ps ymm1, ymmword ptr[edx] vcvtpd2dq xmm1, xmm2 vcvtpd2dq xmm1, xmmword ptr[edx] vcvtpd2dq xmm1, ymm2 vcvtpd2dq xmm1, ymmword ptr[edx] vcvtpd2ps xmm1, xmm2 vcvtpd2ps xmm1, xmmword ptr[edx] vcvtpd2ps xmm1, ymm2 vcvtpd2ps xmm1, ymmword ptr[edx] vcvtps2dq xmm1, xmm2 vcvtps2dq xmm1, xmmword ptr[edx] vcvtps2dq ymm1, ymm2 vcvtps2dq ymm1, ymmword ptr[edx] vcvtps2pd xmm1, xmm2 vcvtps2pd xmm1, qword ptr[edx] vcvtps2pd ymm1, xmm2 vcvtps2pd ymm1, xmmword ptr[edx] vcvtsd2si esp, xmm2 vcvtsd2si esp, qword ptr[edx] ;vcvtsd2si rsp, xmm2 ;vcvtsd2si rsp, qword ptr[edx] vcvtsd2ss xmm1, xmm2, xmm2 vcvtsd2ss xmm1, xmm2, qword ptr[edx] vcvtsi2sd xmm1, xmm2, ebx vcvtsi2sd xmm1, xmm2, dword ptr[edx] ;vcvtsi2sd xmm1, xmm2, rbx ;vcvtsi2sd xmm1, xmm2, qword ptr[edx] vcvtsi2ss xmm1, xmm2, ebx vcvtsi2ss xmm1, xmm2, dword ptr[edx] ;vcvtsi2ss xmm1, xmm2, rbx ;vcvtsi2ss xmm1, xmm2, qword ptr[edx] vcvtss2sd xmm1, xmm2, xmm2 vcvtss2sd xmm1, xmm2, dword ptr[edx] vcvtss2si ecx, xmm2 vcvtss2si ecx, dword ptr[edx] ;vcvtss2si rcx, xmm2 ;vcvtss2si rcx, dword ptr[edx] vcvttpd2dq xmm1, xmm2 vcvttpd2dq xmm1, xmmword ptr[edx] vcvttpd2dq xmm1, ymm2 vcvttpd2dq xmm1, ymmword ptr[edx] vcvttps2dq xmm1, xmm2 vcvttps2dq xmm1, xmmword ptr[edx] vcvttps2dq ymm1, ymm2 vcvttps2dq ymm1, ymmword ptr[edx] vcvttsd2si ecx, xmm2 vcvttsd2si ecx, qword ptr[edx] ;vcvttsd2si rcx, xmm2 ;vcvttsd2si rcx, qword ptr[edx] vcvttss2si ecx, xmm2 vcvttss2si ecx, dword ptr[edx] ;vcvttss2si rcx, xmm2 ;vcvttss2si rcx, dword ptr[edx] masm_test_avx_b endp ;---------------------------------------- ; AVX D~ ;---------------------------------------- masm_test_avx_d proc vdivpd xmm1, xmm2, xmm3 vdivpd xmm1, xmm2, xmmword ptr[edx] vdivpd ymm1, ymm2, ymm3 vdivpd ymm1, ymm2, ymmword ptr[edx] vdivps xmm1, xmm2, xmm3 vdivps xmm1, xmm2, xmmword ptr[edx] vdivps ymm1, ymm2, ymm3 vdivps ymm1, ymm2, ymmword ptr[edx] vdivsd xmm1, xmm2, xmm3 vdivsd xmm1, xmm2, [edx] vdivss xmm1, xmm2, xmm3 vdivss xmm1, xmm2, [edx] vdppd xmm1, xmm2, xmm3, 5 vdppd xmm1, xmm2, xmmword ptr[edx], 5 vdpps xmm1, xmm2, xmm3, 5 vdpps xmm1, xmm2, xmmword ptr[edx], 5 vdpps ymm1, ymm2, ymm3, 5 vdpps ymm1, ymm2, ymmword ptr[edx], 5 vextractf128 xmm1, ymm2, 1 vextractf128 xmmword ptr[edx], ymm2, 1 vextractps eax, xmm2, 5 vextractps dword ptr[eax], xmm2, 5 vhaddpd xmm1, xmm2, xmm3 vhaddpd xmm1, xmm2, xmmword ptr[edx] vhaddpd ymm1, ymm2, ymm3 vhaddpd ymm1, ymm2, ymmword ptr[edx] vhaddps xmm1, xmm2, xmm3 vhaddps xmm1, xmm2, xmmword ptr[edx] vhaddps ymm1, ymm2, ymm3 vhaddps ymm1, ymm2, ymmword ptr[edx] vhsubpd xmm1, xmm2, xmm3 vhsubpd xmm1, xmm2, xmmword ptr[edx] vhsubpd ymm1, ymm2, ymm3 vhsubpd ymm1, ymm2, ymmword ptr[edx] vhsubps xmm1, xmm2, xmm3 vhsubps xmm1, xmm2, xmmword ptr[edx] vhsubps ymm1, ymm2, ymm3 vhsubps ymm1, ymm2, ymmword ptr[edx] vinsertf128 ymm1, ymm2, xmm3, 1 vinsertf128 ymm1, ymm2, xmmword ptr[edx], 1 vinsertps xmm1, xmm2, xmm3, 1 vinsertps xmm1, xmm2, [edx], 1 vlddqu xmm1, xmmword ptr[edx] vlddqu ymm1, ymmword ptr[edx] vldmxcsr dword ptr[edx] vmaskmovdqu xmm1, xmm2 vmaskmovps xmm1, xmm2, xmmword ptr[edx] vmaskmovps ymm1, ymm2, ymmword ptr[edx] vmaskmovpd xmm1, xmm2, xmmword ptr[edx] vmaskmovpd ymm1, ymm2, ymmword ptr[edx] vmaskmovps xmmword ptr[edx], xmm2, xmm3 vmaskmovps ymmword ptr[edx], ymm2, ymm3 vmaskmovpd xmmword ptr[edx], xmm2, xmm3 vmaskmovpd ymmword ptr[edx], ymm2, ymm3 vmaxpd xmm1, xmm2, xmm3 vmaxpd xmm1, xmm2, xmmword ptr[edx] vmaxpd ymm1, ymm2, ymm3 vmaxpd ymm1, ymm2, ymmword ptr[edx] vmaxps xmm1, xmm2, xmm3 vmaxps xmm1, xmm2, xmmword ptr[edx] vmaxps ymm1, ymm2, ymm3 vmaxps ymm1, ymm2, ymmword ptr[edx] vmaxsd xmm1, xmm2, xmm3 vmaxsd xmm1, xmm2, qword ptr[edx] vmaxss xmm1, xmm2, xmm3 vmaxss xmm1, xmm2, dword ptr[edx] vminpd xmm1, xmm2, xmm3 vminpd xmm1, xmm2, xmmword ptr[edx] vminpd ymm1, ymm2, ymm3 vminpd ymm1, ymm2, ymmword ptr[edx] vminps xmm1, xmm2, xmm3 vminps xmm1, xmm2, xmmword ptr[edx] vminps ymm1, ymm2, ymm3 vminps ymm1, ymm2, ymmword ptr[edx] vminsd xmm1, xmm2, xmm3 vminsd xmm1, xmm2, qword ptr[edx] vminss xmm1, xmm2, xmm3 vminss xmm1, xmm2, dword ptr[edx] vmovapd xmm1, xmm2 vmovapd xmm1, xmmword ptr[edx] vmovapd xmmword ptr[edx], xmm2 vmovapd ymm1, ymm2 vmovapd ymm1, ymmword ptr[edx] vmovapd ymmword ptr[edx], ymm2 vmovaps xmm1, xmm2 vmovaps xmm1, xmmword ptr[edx] vmovaps xmmword ptr[edx], xmm2 vmovaps ymm1, ymm2 vmovaps ymm1, ymmword ptr[edx] vmovaps ymmword ptr[edx], ymm2 vmovd xmm3, edx vmovd xmm3, dword ptr[edx] vmovd eax, xmm4 vmovd dword ptr[eax], xmm4 vmovq xmm3, xmm4 vmovq xmm3, qword ptr[edx] vmovq qword ptr[eax], xmm4 ;vmovq xmm3, rdx ;vmovq rax, xmm4 vmovddup xmm3, xmm4 vmovddup xmm3, qword ptr[edx] vmovddup ymm3, ymm4 vmovddup ymm3, ymmword ptr[edx] vmovdqa xmm3, xmm4 vmovdqa xmm3, xmmword ptr[edx] vmovdqa xmmword ptr[eax], xmm4 vmovdqa ymm3, ymm4 vmovdqa ymm3, ymmword ptr[edx] vmovdqa ymmword ptr[eax], ymm4 vmovdqu xmm3, xmm4 vmovdqu xmm3, xmmword ptr[edx] vmovdqu xmmword ptr[eax], xmm4 vmovdqu ymm3, ymm4 vmovdqu ymm3, ymmword ptr[edx] vmovdqu ymmword ptr[eax], ymm4 vmovhlps xmm3, xmm4, xmm5 vmovhpd xmm3, xmm4, qword ptr[edx] vmovhpd qword ptr[eax], xmm4 vmovhps xmm3, xmm4, qword ptr[edx] vmovhps qword ptr[eax], xmm4 vmovlhps xmm3, xmm4, xmm5 vmovlpd xmm3, xmm4, qword ptr[edx] vmovlpd qword ptr[eax], xmm4 vmovlps xmm3, xmm4, qword ptr[edx] vmovlps qword ptr[eax], xmm4 vmovmskpd eax, xmm5 vmovmskpd eax, ymm5 ;vmovmskpd rax, xmm5 ;vmovmskpd rax, ymm5 vmovmskps eax, xmm5 vmovmskps eax, ymm5 ;vmovmskps rax, xmm5 ;vmovmskps rax, ymm5 vmovntdq xmmword ptr[eax], xmm5 vmovntdq ymmword ptr[eax], ymm5 vmovntdqa xmm3, xmmword ptr[edi] vmovntpd xmmword ptr[eax], xmm5 vmovntpd ymmword ptr[eax], ymm5 vmovntps xmmword ptr[eax], xmm5 vmovntps ymmword ptr[eax], ymm5 vmovsd xmm3, xmm5, xmm6 vmovsd xmm3, qword ptr[edi] vmovsd qword ptr[eax], xmm5 vmovshdup xmm3, xmm5 vmovshdup xmm3, xmmword ptr[edi] vmovshdup ymm3, ymm5 vmovshdup ymm3, ymmword ptr[edi] vmovsldup xmm3, xmm5 vmovsldup xmm3, xmmword ptr[edi] vmovsldup ymm3, ymm5 vmovsldup ymm3, ymmword ptr[edi] vmovss xmm3, xmm5, xmm6 vmovss xmm3, dword ptr[edi] vmovss dword ptr[eax], xmm5 vmovupd xmm3, xmm5 vmovupd xmm3, xmmword ptr[edi] vmovupd xmmword ptr[eax], xmm3 vmovupd ymm3, ymm5 vmovupd ymm3, ymmword ptr[edi] vmovupd ymmword ptr[eax], ymm3 vmovups xmm3, xmm5 vmovups xmm3, xmmword ptr[edi] vmovups xmmword ptr[eax], xmm3 vmovups ymm3, ymm5 vmovups ymm3, ymmword ptr[edi] vmovups ymmword ptr[eax], ymm3 vmpsadbw xmm3, xmm5, xmm6, 2 vmpsadbw xmm3, xmm5, xmmword ptr[edi], 2 vmulpd xmm3, xmm5, xmm6 vmulpd xmm3, xmm5, xmmword ptr[edi] vmulpd ymm3, ymm5, ymm6 vmulpd ymm3, ymm5, ymmword ptr[edi] vmulps xmm3, xmm5, xmm6 vmulps xmm3, xmm5, xmmword ptr[edi] vmulps ymm3, ymm5, ymm6 vmulps ymm3, ymm5, ymmword ptr[edi] vmulsd xmm3, xmm5, xmm6 vmulsd xmm3, xmm5, qword ptr[edi] vmulss xmm3, xmm5, xmm6 vmulss xmm3, xmm5, dword ptr[edi] masm_test_avx_d endp ;---------------------------------------- ; AVX O~ ;---------------------------------------- masm_test_avx_o proc vorpd xmm1, xmm2, xmm3 vorpd xmm1, xmm2, xmmword ptr[edx] vorpd ymm1, ymm2, ymm3 vorpd ymm1, ymm2, ymmword ptr[edx] vorps xmm1, xmm2, xmm3 vorps xmm1, xmm2, xmmword ptr[edx] vorps ymm1, ymm2, ymm3 vorps ymm1, ymm2, ymmword ptr[edx] vpabsb xmm1, xmm2 vpabsb xmm1, xmmword ptr[edx] vpabsw xmm1, xmm2 vpabsw xmm1, xmmword ptr[edx] vpabsd xmm1, xmm2 vpabsd xmm1, xmmword ptr[edx] vpacksswb xmm1, xmm2, xmm3 vpacksswb xmm1, xmm2, xmmword ptr[edx] vpackssdw xmm1, xmm2, xmm3 vpackssdw xmm1, xmm2, xmmword ptr[edx] vpackuswb xmm1, xmm2, xmm3 vpackuswb xmm1, xmm2, xmmword ptr[edx] vpackusdw xmm1, xmm2, xmm3 vpackusdw xmm1, xmm2, xmmword ptr[edx] vpaddb xmm1, xmm2, xmm3 vpaddb xmm1, xmm2, xmmword ptr[edx] vpaddw xmm1, xmm2, xmm3 vpaddw xmm1, xmm2, xmmword ptr[edx] vpaddd xmm1, xmm2, xmm3 vpaddd xmm1, xmm2, xmmword ptr[edx] vpaddq xmm1, xmm2, xmm3 vpaddq xmm1, xmm2, xmmword ptr[edx] vpaddsb xmm1, xmm2, xmm3 vpaddsb xmm1, xmm2, xmmword ptr[edx] vpaddsw xmm1, xmm2, xmm3 vpaddsw xmm1, xmm2, xmmword ptr[edx] vpaddusb xmm1, xmm2, xmm3 vpaddusb xmm1, xmm2, xmmword ptr[edx] vpaddusw xmm1, xmm2, xmm3 vpaddusw xmm1, xmm2, xmmword ptr[edx] vpalignr xmm1, xmm2, xmm3, 1 vpalignr xmm1, xmm2, xmmword ptr[edx], 1 vpand xmm1, xmm2, xmm3 vpand xmm1, xmm2, xmmword ptr[edx] vpandn xmm1, xmm2, xmm3 vpandn xmm1, xmm2, xmmword ptr[edx] vpavgb xmm1, xmm2, xmm3 vpavgb xmm1, xmm2, xmmword ptr[edx] vpavgw xmm1, xmm2, xmm3 vpavgw xmm1, xmm2, xmmword ptr[edx] vpblendvb xmm1, xmm2, xmmword ptr[edx], xmm4 vpblendvb xmm1, xmm2, xmm3, xmm4 vpblendw xmm1, xmm2, xmmword ptr[edx], 5 vpblendw xmm1, xmm2, xmm3, 5 pclmulqdq xmm1, xmmword ptr[edx], 1 pclmulqdq xmm1, xmm2, 1 vpclmulqdq xmm1, xmm2, xmmword ptr[edx], 1 vpclmulqdq xmm1, xmm2, xmm3, 1 vpcmpeqb xmm0, xmm1, xmm2 vpcmpeqb xmm0, xmm1, xmmword ptr[esi] vpcmpeqw xmm0, xmm1, xmm2 vpcmpeqw xmm0, xmm1, xmmword ptr[esi] vpcmpeqd xmm0, xmm1, xmm2 vpcmpeqd xmm0, xmm1, xmmword ptr[esi] vpcmpeqq xmm0, xmm1, xmm2 vpcmpeqq xmm0, xmm1, xmmword ptr[esi] vpcmpgtb xmm0, xmm1, xmm2 vpcmpgtb xmm0, xmm1, xmmword ptr[esi] vpcmpgtw xmm0, xmm1, xmm2 vpcmpgtw xmm0, xmm1, xmmword ptr[esi] vpcmpgtd xmm0, xmm1, xmm2 vpcmpgtd xmm0, xmm1, xmmword ptr[esi] vpcmpgtq xmm0, xmm1, xmm2 vpcmpgtq xmm0, xmm1, xmmword ptr[esi] vpcmpestri xmm2, xmm1, 0 vpcmpestri xmm2, xmmword ptr[esi], 0 vpcmpestrm xmm2, xmm1, 1 vpcmpestrm xmm2, xmmword ptr[esi], 1 vpcmpistri xmm2, xmm1, 0 vpcmpistri xmm2, xmmword ptr[esi], 0 vpcmpistrm xmm2, xmm1, 1 vpcmpistrm xmm2, xmmword ptr[esi], 1 vpermilpd xmm1, xmm2, xmm3 vpermilpd xmm1, xmm2, xmmword ptr[esi] vpermilpd ymm4, ymm5, ymm6 vpermilpd ymm4, ymm5, ymmword ptr[esp] vpermilpd xmm1, xmm2, 1 vpermilpd xmm1, xmmword ptr[esi], 2 vpermilpd ymm4, ymm5, 3 vpermilpd ymm4, ymmword ptr[esp], 4 vpermilps xmm1, xmm2, xmm3 vpermilps xmm1, xmm2, xmmword ptr[esi] vpermilps ymm4, ymm5, ymm6 vpermilps ymm4, ymm5, ymmword ptr[esp] vpermilps xmm1, xmm2, 3 vpermilps xmm1, xmmword ptr[esp], 2 vpermilps ymm4, ymm5, 1 vpermilps ymm4, ymmword ptr[esp], 1 vperm2f128 ymm4, ymm5, ymm6, 1 vperm2f128 ymm4, ymm5, ymmword ptr[esp], 2 vpextrb ecx, xmm7, 13 vpextrb byte ptr[esi], xmm7, 5 db 0C5h ; vpextrw edx, xmm7, 6 db 0F9h db 0C5h db 0D7h db 006h vpextrw word ptr[esp], xmm7, 4 vpextrd eax, xmm7, 3 vpextrd dword ptr[esp], xmm7, 2 vphaddw xmm7, xmm6, xmm5 vphaddw xmm7, xmm6, xmmword ptr[esp] vphaddd xmm7, xmm6, xmm5 vphaddd xmm7, xmm6, xmmword ptr[esp] vphaddsw xmm7, xmm6, xmm5 vphaddsw xmm7, xmm6, xmmword ptr[esp] vphminposuw xmm7, xmm5 vphminposuw xmm7, xmmword ptr[esp] vphsubw xmm7, xmm6, xmm5 vphsubw xmm7, xmm6, xmmword ptr[esp] vphsubd xmm7, xmm6, xmm5 vphsubd xmm7, xmm6, xmmword ptr[esp] vphsubsw xmm7, xmm6, xmm5 vphsubsw xmm7, xmm6, xmmword ptr[esp] vpinsrb xmm2, xmm0, ebx, 15 vpinsrb xmm2, xmm0, byte ptr[esi], 7 vpinsrw xmm2, xmm0, ecx, 6 vpinsrw xmm2, xmm0, word ptr[edi], 5 vpinsrd xmm2, xmm1, eax, 3 vpinsrd xmm2, xmm0, dword ptr[esp], 2 vpmaddwd xmm2, xmm1, xmm6 vpmaddwd xmm2, xmm1, xmmword ptr[esi] vpmaddubsw xmm2, xmm1, xmm5 vpmaddubsw xmm2, xmm1, xmmword ptr[esi] vpmaxsb xmm6, xmm5, xmm4 vpmaxsb xmm6, xmm5, xmmword ptr[esi] vpmaxsw xmm6, xmm5, xmm4 vpmaxsw xmm6, xmm5, xmmword ptr[esi] vpmaxsd xmm6, xmm5, xmm4 vpmaxsd xmm6, xmm5, xmmword ptr[esi] vpmaxub xmm6, xmm5, xmm4 vpmaxub xmm6, xmm5, xmmword ptr[esi] vpmaxuw xmm6, xmm5, xmm4 vpmaxuw xmm6, xmm5, xmmword ptr[esi] vpmaxud xmm6, xmm5, xmm4 vpmaxud xmm6, xmm5, xmmword ptr[esi] vpminsb xmm6, xmm5, xmm4 vpminsb xmm6, xmm5, xmmword ptr[esi] vpminsw xmm6, xmm5, xmm4 vpminsw xmm6, xmm5, xmmword ptr[esi] vpminsd xmm6, xmm5, xmm4 vpminsd xmm6, xmm5, xmmword ptr[esi] vpminub xmm6, xmm5, xmm4 vpminub xmm6, xmm5, xmmword ptr[esi] vpminuw xmm6, xmm5, xmm4 vpminuw xmm6, xmm5, xmmword ptr[esi] vpminud xmm6, xmm5, xmm4 vpminud xmm6, xmm5, xmmword ptr[esi] vpmovmskb ecx, xmm5 vpmovsxbw xmm1, xmm2 vpmovsxbw xmm1, qword ptr[esp] vpmovsxbd xmm1, xmm2 vpmovsxbd xmm1, dword ptr[esp] vpmovsxbq xmm1, xmm2 vpmovsxbq xmm1, word ptr[esp] vpmovsxwd xmm1, xmm2 vpmovsxwd xmm1, qword ptr[esp] vpmovsxwq xmm1, xmm2 vpmovsxwq xmm1, dword ptr[esp] vpmovsxdq xmm1, xmm2 vpmovsxdq xmm1, qword ptr[esp] vpmovzxbw xmm1, xmm2 vpmovzxbw xmm1, qword ptr[esp] vpmovzxbd xmm1, xmm2 vpmovzxbd xmm1, dword ptr[esp] vpmovzxbq xmm1, xmm2 vpmovzxbq xmm1, word ptr[esp] vpmovzxwd xmm1, xmm2 vpmovzxwd xmm1, qword ptr[esp] vpmovzxwq xmm1, xmm2 vpmovzxwq xmm1, dword ptr[esp] vpmovzxdq xmm1, xmm2 vpmovzxdq xmm1, qword ptr[esp] vpmulhuw xmm2, xmm3, xmm4 vpmulhuw xmm2, xmm3, [esi] vpmulhrsw xmm2, xmm3, xmm4 vpmulhrsw xmm2, xmm3, [esi] vpmulhw xmm2, xmm3, xmm4 vpmulhw xmm2, xmm3, [esi] vpmullw xmm2, xmm3, xmm4 vpmullw xmm2, xmm3, [esi] vpmulld xmm2, xmm3, xmm4 vpmulld xmm2, xmm3, [esi] vpmuludq xmm2, xmm3, xmm4 vpmuludq xmm2, xmm3, [esi] vpmuldq xmm2, xmm3, xmm4 vpmuldq xmm2, xmm3, [esi] vpor xmm2, xmm3, xmm4 vpor xmm2, xmm3, [esi] vpsadbw xmm2, xmm3, xmm4 vpsadbw xmm2, xmm3, [esi] vpshufb xmm2, xmm3, xmm4 vpshufb xmm2, xmm3, [esi] vpshufd xmm2, xmm3, 1 vpshufd xmm2, [esi], 2 vpshufhw xmm2, xmm3, 3 vpshufhw xmm2, [esi], 4 vpshuflw xmm2, xmm3, 5 vpshuflw xmm2, [esi], 6 vpsignb xmm5, xmm0, xmm1 vpsignb xmm5, xmm0, [esi] vpsignw xmm5, xmm0, xmm1 vpsignw xmm5, xmm0, [esi] vpsignd xmm5, xmm0, xmm1 vpsignd xmm5, xmm0, [esi] vpsllw xmm7, xmm5, xmm2 vpsllw xmm7, xmm5, [esi] vpsllw xmm7, xmm5, 1 vpslld xmm7, xmm5, xmm2 vpslld xmm7, xmm5, [esi] vpslld xmm7, xmm5, 1 vpsllq xmm7, xmm5, xmm2 vpsllq xmm7, xmm5, [esi] vpsllq xmm7, xmm5, 1 vpslldq xmm7, xmm5, 1 vpsraw xmm7, xmm5, xmm2 vpsraw xmm7, xmm5, [esi] vpsraw xmm7, xmm5, 1 vpsrad xmm7, xmm5, xmm2 vpsrad xmm7, xmm5, [esi] vpsrad xmm7, xmm5, 1 vpsrlw xmm7, xmm5, xmm2 vpsrlw xmm7, xmm5, [esi] vpsrlw xmm7, xmm5, 1 db 0C5h ;vpsrld xmm7, xmm5, xmm2 db 0D1h db 0D2h db 0FAh db 0C5h ;vpsrld xmm7, xmm5, [esi] db 0D1h db 0D2h db 03Eh vpsrld xmm7, xmm5, 1 vpsrlq xmm7, xmm5, xmm2 vpsrlq xmm7, xmm5, [esi] vpsrlq xmm7, xmm5, 1 vpsrldq xmm7, xmm5, 1 vptest xmm1, xmm0 vptest xmm1, xmmword ptr[esi] vptest ymm1, ymm0 vptest ymm1, ymmword ptr[esi] vtestps xmm1, xmm0 vtestps xmm1, [esi] vtestps ymm1, ymm0 vtestps ymm1, [esi] vtestpd xmm1, xmm0 vtestpd xmm1, [esi] vtestpd ymm1, ymm0 vtestpd ymm1, [esi] vpsubb xmm2, xmm3, xmm7 vpsubb xmm2, xmm3, [esi] vpsubw xmm2, xmm3, xmm7 vpsubw xmm2, xmm3, [esi] vpsubd xmm2, xmm3, xmm7 vpsubd xmm2, xmm3, [esi] vpsubq xmm2, xmm3, xmm7 vpsubq xmm2, xmm3, [esi] vpsubsb xmm2, xmm3, xmm7 vpsubsb xmm2, xmm3, [esi] vpsubsw xmm2, xmm3, xmm7 vpsubsw xmm2, xmm3, [esi] vpsubusb xmm2, xmm3, xmm7 vpsubusb xmm2, xmm3, [esi] vpsubusw xmm2, xmm3, xmm7 vpsubusw xmm2, xmm3, [esi] vpunpckhbw xmm1, xmm2, xmm3 vpunpckhbw xmm1, xmm2, [esi] vpunpckhwd xmm1, xmm2, xmm3 vpunpckhwd xmm1, xmm2, [esi] vpunpckhdq xmm1, xmm2, xmm3 vpunpckhdq xmm1, xmm2, [esi] vpunpckhqdq xmm1, xmm2, xmm3 vpunpckhqdq xmm1, xmm2, [esi] vpunpcklbw xmm1, xmm2, xmm3 vpunpcklbw xmm1, xmm2, [esi] vpunpcklwd xmm1, xmm2, xmm3 vpunpcklwd xmm1, xmm2, [esi] vpunpckldq xmm1, xmm2, xmm3 vpunpckldq xmm1, xmm2, [esi] vpunpcklqdq xmm1, xmm2, xmm3 vpunpcklqdq xmm1, xmm2, [esi] vpxor xmm1, xmm2, xmm3 vpxor xmm1, xmm2, [esi] masm_test_avx_o endp ;---------------------------------------- ; AVX R~ ;---------------------------------------- masm_test_avx_r proc vrcpps xmm5, xmm0 vrcpps xmm5, [esi] vrcpps ymm4, ymm0 vrcpps ymm4, [esi] vrcpss xmm5, xmm3, xmm0 vrcpss xmm5, xmm3, [esi] vrsqrtps xmm5, xmm0 vrsqrtps xmm5, [esi] vrsqrtps ymm4, ymm0 vrsqrtps ymm4, [esi] vrsqrtss xmm5, xmm3, xmm0 vrsqrtss xmm5, xmm3, dword ptr[esi] vroundpd xmm1, xmm3, 1 vroundpd xmm1, [esi], 2 vroundpd ymm1, ymm2, 1 vroundpd ymm1, [esi], 3 vroundps xmm1, xmm3, 0 vroundps xmm1, [esi], 1 vroundps ymm1, ymm2, 2 vroundps ymm1, [esi], 0 vroundsd xmm1, xmm2, xmm3, 1 vroundsd xmm1, xmm2, qword ptr[esi], 2 vroundss xmm1, xmm2, xmm3, 3 vroundss xmm1, xmm2, dword ptr[edx], 1 vshufpd xmm1, xmm3, xmm4, 1 vshufpd xmm1, xmm3, [esi], 2 vshufpd ymm2, ymm0, ymm5, 3 vshufpd ymm2, ymm0, [esi], 4 vshufps xmm1, xmm3, xmm5, 5 vshufps xmm1, xmm3, [esi], 6 vshufps ymm2, ymm0, ymm6, 7 vshufps ymm2, ymm0, [esi], 8 vsqrtpd xmm7, xmm3 vsqrtpd xmm7, [edx] vsqrtpd ymm7, ymm3 vsqrtpd ymm7, [edx] vsqrtps xmm7, xmm3 vsqrtps xmm7, [edx] vsqrtps ymm7, ymm3 vsqrtps ymm7, [edx] vsqrtsd xmm7, xmm2, xmm4 vsqrtsd xmm7, xmm2, qword ptr[edx] vsqrtss xmm7, xmm2, xmm5 vsqrtss xmm7, xmm2, dword ptr[edx] vstmxcsr dword ptr[esi] vsubpd xmm1, xmm2, xmm3 vsubpd xmm1, xmm2, [edx] vsubpd ymm1, ymm2, ymm3 vsubpd ymm1, ymm2, [edx] vsubps xmm1, xmm2, xmm3 vsubps xmm1, xmm2, [edx] vsubps ymm1, ymm2, ymm3 vsubps ymm1, ymm2, [edx] vsubsd xmm1, xmm2, xmm4 vsubsd xmm1, xmm2, qword ptr[edx] vsubss xmm1, xmm2, xmm5 vsubss xmm1, xmm2, dword ptr[edx] vucomisd xmm4, xmm6 vucomisd xmm3, qword ptr[ebp] vucomiss xmm0, xmm7 vucomiss xmm1, dword ptr[ebx] vunpckhpd xmm1, xmm2, xmm3 vunpckhpd xmm1, xmm2, xmmword ptr[edi] vunpckhpd ymm1, ymm2, ymm4 vunpckhpd ymm1, ymm2, ymmword ptr[esi] vunpckhps xmm1, xmm2, xmm3 vunpckhps xmm1, xmm2, xmmword ptr[edi] vunpckhps ymm1, ymm2, ymm4 vunpckhps ymm1, ymm2, ymmword ptr[esi] vunpcklpd xmm1, xmm2, xmm3 vunpcklpd xmm1, xmm2, xmmword ptr[edi] vunpcklpd ymm1, ymm2, ymm4 vunpcklpd ymm1, ymm2, ymmword ptr[esi] vunpcklps xmm1, xmm2, xmm3 vunpcklps xmm1, xmm2, xmmword ptr[edi] vunpcklps ymm1, ymm2, ymm4 vunpcklps ymm1, ymm2, ymmword ptr[esi] vxorpd xmm1, xmm2, xmm3 vxorpd xmm1, xmm2, xmmword ptr[edi] vxorpd ymm1, ymm2, ymm4 vxorpd ymm1, ymm2, ymmword ptr[esi] vxorps xmm1, xmm2, xmm3 vxorps xmm1, xmm2, xmmword ptr[edi] vxorps ymm1, ymm2, ymm4 vxorps ymm1, ymm2, ymmword ptr[esi] vzeroall vzeroupper masm_test_avx_r endp ;---------------------------------------- ; AVX2 ;---------------------------------------- masm_test_avx2 proc vbroadcastss xmm1, xmm2 vbroadcastss ymm7, xmm2 vbroadcastsd ymm7, xmm2 vbroadcasti128 ymm7, oword ptr[ecx] vextracti128 xmm2, ymm4, 1 vextracti128 xmmword ptr[edi], ymm3, 0 vinserti128 ymm3, ymm2, xmm1, 1 vinserti128 ymm3, ymm2, xmmword ptr[esi], 0 vmovntdqa ymm5, ymmword ptr[esi] vmpsadbw ymm6, ymm4, ymm3, 1 vmpsadbw ymm6, ymm4, ymmword ptr[esi], 2 vpabsb ymm6, ymm5 vpabsb ymm6, ymmword ptr[ecx] vpabsw ymm6, ymm5 vpabsw ymm6, ymmword ptr[ecx] vpabsd ymm6, ymm5 vpabsd ymm6, ymmword ptr[ecx] vpacksswb ymm6, ymm4, ymm3 vpacksswb ymm6, ymm4, ymmword ptr[esi] vpackssdw ymm6, ymm4, ymm3 vpackssdw ymm6, ymm4, ymmword ptr[esi] vpackuswb ymm6, ymm4, ymm3 vpackuswb ymm6, ymm4, ymmword ptr[esi] vpackusdw ymm6, ymm4, ymm3 vpackusdw ymm6, ymm4, ymmword ptr[esi] vpaddb ymm6, ymm4, ymm3 vpaddb ymm6, ymm4, ymmword ptr[esi] vpaddw ymm6, ymm4, ymm3 vpaddw ymm6, ymm4, ymmword ptr[esi] vpaddd ymm6, ymm4, ymm3 vpaddd ymm6, ymm4, ymmword ptr[esi] vpaddq ymm6, ymm4, ymm3 vpaddq ymm6, ymm4, ymmword ptr[esi] vpaddsb ymm6, ymm4, ymm3 vpaddsb ymm6, ymm4, ymmword ptr[esi] vpaddsw ymm6, ymm4, ymm3 vpaddsw ymm6, ymm4, ymmword ptr[esi] vpaddusb ymm6, ymm4, ymm3 vpaddusb ymm6, ymm4, ymmword ptr[esi] vpaddusw ymm6, ymm4, ymm3 vpaddusw ymm6, ymm4, ymmword ptr[esi] vpalignr ymm6, ymm4, ymm3, 2 vpalignr ymm6, ymm4, ymmword ptr[esi], 3 vpand ymm6, ymm4, ymm3 vpand ymm6, ymm4, ymmword ptr[esi] vpandn ymm6, ymm4, ymm3 vpandn ymm6, ymm4, ymmword ptr[esi] vpavgb ymm6, ymm4, ymm3 vpavgb ymm6, ymm4, ymmword ptr[esi] vpavgw ymm6, ymm4, ymm3 vpavgw ymm6, ymm4, ymmword ptr[esi] vpblendvb ymm6, ymm4, ymm3, ymm2 vpblendvb ymm6, ymm4, ymmword ptr[esi], ymm2 vpblendw ymm6, ymm4, ymm3, 0Fh vpblendw ymm6, ymm4, ymmword ptr[esi], 0F0h vpblendd xmm3, xmm2, xmm1, 0Ah vpblendd xmm3, xmm2, xmmword ptr[eax], 03h vpblendd ymm6, ymm4, ymm3, 22h vpblendd ymm6, ymm4, ymmword ptr[esi], 33h vpbroadcastb xmm1, xmm2 vpbroadcastb xmm1, byte ptr[esi] vpbroadcastb ymm7, xmm2 vpbroadcastb ymm7, byte ptr[edi] vpbroadcastw xmm1, xmm2 vpbroadcastw xmm1, word ptr[eax] vpbroadcastw ymm7, xmm2 vpbroadcastw ymm7, word ptr[esi] vpbroadcastd xmm1, xmm2 vpbroadcastd xmm1, dword ptr[edx] vpbroadcastd ymm7, xmm2 vpbroadcastd ymm7, dword ptr[eax] vpbroadcastq xmm1, xmm2 vpbroadcastq xmm1, qword ptr[esi] vpbroadcastq ymm7, xmm2 vpbroadcastq ymm7, qword ptr[esi] vpcmpeqb ymm0, ymm1, ymm2 vpcmpeqb ymm0, ymm1, ymmword ptr[ecx] vpcmpeqw ymm0, ymm1, ymm2 vpcmpeqw ymm0, ymm1, ymmword ptr[ecx] vpcmpeqd ymm0, ymm1, ymm2 vpcmpeqd ymm0, ymm1, ymmword ptr[ecx] vpcmpeqq ymm0, ymm1, ymm2 vpcmpeqq ymm0, ymm1, ymmword ptr[ecx] vpcmpgtb ymm0, ymm1, ymm2 vpcmpgtb ymm0, ymm1, ymmword ptr[ecx] vpcmpgtw ymm0, ymm1, ymm2 vpcmpgtw ymm0, ymm1, ymmword ptr[ecx] vpcmpgtd ymm0, ymm1, ymm2 vpcmpgtd ymm0, ymm1, ymmword ptr[ecx] vpcmpgtq ymm0, ymm1, ymm2 vpcmpgtq ymm0, ymm1, ymmword ptr[ecx] vpermd ymm0, ymm5, ymm3 vpermd ymm0, ymm5, ymmword ptr[esi] vpermq ymm0, ymm3, 5 vpermq ymm0, ymmword ptr[esi], 6 vpermps ymm0, ymm5, ymm3 vpermps ymm0, ymm5, ymmword ptr[esi] vpermpd ymm0, ymm3, 9 vpermpd ymm0, ymmword ptr[esi], 4 vperm2i128 ymm0, ymm1, ymm3, 2 vperm2i128 ymm0, ymm1, ymmword ptr[esi], 1 vphaddw ymm5, ymm6, ymm4 vphaddw ymm5, ymm6, ymmword ptr[eax] vphaddd ymm5, ymm6, ymm4 vphaddd ymm5, ymm6, ymmword ptr[eax] vphaddsw ymm5, ymm6, ymm4 vphaddsw ymm5, ymm6, ymmword ptr[eax] vphsubw ymm5, ymm6, ymm4 vphsubw ymm5, ymm6, ymmword ptr[eax] vphsubd ymm5, ymm6, ymm4 vphsubd ymm5, ymm6, ymmword ptr[eax] vphsubsw ymm5, ymm6, ymm4 vphsubsw ymm5, ymm6, ymmword ptr[eax] vpmaddwd ymm5, ymm6, ymm4 vpmaddwd ymm5, ymm6, ymmword ptr[eax] vpmaddubsw ymm5, ymm6, ymm4 vpmaddubsw ymm5, ymm6, ymmword ptr[eax] vpmaskmovd xmm1, xmm0, xmmword ptr[esi] vpmaskmovd ymm2, ymm7, ymmword ptr[esi] vpmaskmovq xmm3, xmm0, xmmword ptr[ecx] vpmaskmovq ymm4, ymm7, ymmword ptr[eax] vpmaskmovd xmmword ptr[edi], xmm0, xmm1 vpmaskmovd ymmword ptr[eax], ymm7, ymm2 vpmaskmovq xmmword ptr[esp], xmm0, xmm3 vpmaskmovq ymmword ptr[ecx], ymm7, ymm4 vpmaxsb ymm1, ymm2, ymm3 vpmaxsb ymm1, ymm2, ymmword ptr[esi] vpmaxsw ymm1, ymm2, ymm3 vpmaxsw ymm1, ymm2, ymmword ptr[esi] vpmaxsd ymm1, ymm2, ymm3 vpmaxsd ymm1, ymm2, ymmword ptr[esi] vpmaxub ymm1, ymm2, ymm3 vpmaxub ymm1, ymm2, ymmword ptr[esi] vpmaxuw ymm1, ymm2, ymm3 vpmaxuw ymm1, ymm2, ymmword ptr[esi] vpmaxud ymm1, ymm2, ymm3 vpmaxud ymm1, ymm2, ymmword ptr[esi] vpminsb ymm1, ymm2, ymm3 vpminsb ymm1, ymm2, ymmword ptr[esi] vpminsw ymm1, ymm2, ymm3 vpminsw ymm1, ymm2, ymmword ptr[esi] vpminsd ymm1, ymm2, ymm3 vpminsd ymm1, ymm2, ymmword ptr[esi] vpminub ymm1, ymm2, ymm3 vpminub ymm1, ymm2, ymmword ptr[esi] vpminuw ymm1, ymm2, ymm3 vpminuw ymm1, ymm2, ymmword ptr[esi] vpminud ymm1, ymm2, ymm3 vpminud ymm1, ymm2, ymmword ptr[esi] vpmovmskb eax, ymm1 vpmovsxbw ymm7, xmm6 vpmovsxbw ymm7, qword ptr[esp] vpmovsxbd ymm7, xmm6 vpmovsxbd ymm7, dword ptr[ecx] vpmovsxbq ymm7, xmm6 vpmovsxbq ymm7, word ptr[esi] vpmovsxwd ymm7, xmm6 vpmovsxwd ymm7, qword ptr[esp] vpmovsxwq ymm7, xmm6 vpmovsxwq ymm7, dword ptr[ecx] vpmovsxdq ymm7, xmm6 vpmovsxdq ymm7, qword ptr[esp] vpmovzxbw ymm7, xmm6 vpmovzxbw ymm7, qword ptr[esp] vpmovzxbd ymm7, xmm6 vpmovzxbd ymm7, dword ptr[ecx] vpmovzxbq ymm7, xmm6 vpmovzxbq ymm7, word ptr[esi] vpmovzxwd ymm7, xmm6 vpmovzxwd ymm7, qword ptr[esp] vpmovzxwq ymm7, xmm6 vpmovzxwq ymm7, dword ptr[ecx] vpmovzxdq ymm7, xmm6 vpmovzxdq ymm7, qword ptr[esp] vpmulhuw ymm1, ymm2, ymm3 vpmulhuw ymm1, ymm2, ymmword ptr[edi] vpmulhrsw ymm1, ymm2, ymm3 vpmulhrsw ymm1, ymm2, ymmword ptr[edi] vpmulhw ymm1, ymm2, ymm3 vpmulhw ymm1, ymm2, ymmword ptr[edi] vpmullw ymm1, ymm2, ymm3 vpmullw ymm1, ymm2, ymmword ptr[edi] vpmulld ymm1, ymm2, ymm3 vpmulld ymm1, ymm2, ymmword ptr[edi] vpmuludq ymm1, ymm2, ymm3 vpmuludq ymm1, ymm2, ymmword ptr[edi] vpmuldq ymm1, ymm2, ymm3 vpmuldq ymm1, ymm2, ymmword ptr[edi] vpor ymm3, ymm4, ymm5 vpor ymm3, ymm4, ymmword ptr[eax] vpsadbw ymm3, ymm4, ymm5 vpsadbw ymm3, ymm4, ymmword ptr[eax] vpshufb ymm3, ymm6, ymm7 vpshufb ymm3, ymm6, ymmword ptr[ebx] vpshufd ymm3, ymm6, 3 vpshufd ymm3, ymmword ptr[ecx], 4 vpshufhw ymm3, ymm6, 5 vpshufhw ymm3, ymmword ptr[ecx], 6 vpshuflw ymm3, ymm6, 7 vpshuflw ymm3, ymmword ptr[ecx], 8 vpsignb ymm3, ymm4, ymm5 vpsignb ymm3, ymm4, ymmword ptr[eax] vpsignw ymm3, ymm4, ymm5 vpsignw ymm3, ymm4, ymmword ptr[eax] vpsignd ymm3, ymm4, ymm5 vpsignd ymm3, ymm4, ymmword ptr[eax] vpsllw ymm3, ymm6, xmm1 vpsllw ymm3, ymm6, xmmword ptr[esi] vpsllw ymm3, ymm6, 9 vpslld ymm3, ymm6, xmm1 vpslld ymm3, ymm6, xmmword ptr[esi] vpslld ymm3, ymm6, 10 vpsllq ymm3, ymm6, xmm1 vpsllq ymm3, ymm6, xmmword ptr[esi] vpsllq ymm3, ymm6, 11 vpslldq ymm3, ymm6, 12 vpsllvd xmm0, xmm2, xmm1 vpsllvd xmm0, xmm1, xmmword ptr[ecx] vpsllvd ymm3, ymm6, ymm0 vpsllvd ymm3, ymm0, ymmword ptr[ecx] vpsllvq xmm0, xmm2, xmm1 vpsllvq xmm0, xmm1, xmmword ptr[ecx] vpsllvq ymm3, ymm6, ymm0 vpsllvq ymm3, ymm0, ymmword ptr[ecx] vpsraw ymm3, ymm6, xmm1 vpsraw ymm3, ymm6, xmmword ptr[esi] vpsraw ymm3, ymm6, 1 vpsrad ymm3, ymm6, xmm1 vpsrad ymm3, ymm6, xmmword ptr[esi] vpsrad ymm3, ymm6, 2 vpsravd xmm0, xmm2, xmm1 vpsravd xmm0, xmm1, xmmword ptr[ecx] vpsravd ymm3, ymm6, ymm0 vpsravd ymm3, ymm0, ymmword ptr[ecx] vpsrlw ymm3, ymm6, xmm1 vpsrlw ymm3, ymm6, xmmword ptr[esi] vpsrlw ymm3, ymm6, 3 vpsrld ymm3, ymm6, xmm1 vpsrld ymm3, ymm6, xmmword ptr[esi] vpsrld ymm3, ymm6, 4 vpsrlq ymm3, ymm6, xmm1 vpsrlq ymm3, ymm6, xmmword ptr[esi] vpsrlq ymm3, ymm6, 5 vpsrldq ymm3, ymm6, 6 vpsrlvd xmm0, xmm2, xmm1 vpsrlvd xmm0, xmm1, xmmword ptr[ecx] vpsrlvd ymm3, ymm6, ymm0 vpsrlvd ymm3, ymm0, ymmword ptr[ecx] vpsrlvq xmm0, xmm2, xmm1 vpsrlvq xmm0, xmm1, xmmword ptr[ecx] vpsrlvq ymm3, ymm6, ymm0 vpsrlvq ymm3, ymm0, ymmword ptr[ecx] vpsubb ymm1, ymm5, ymm6 vpsubb ymm1, ymm5, ymmword ptr[eax] vpsubw ymm1, ymm5, ymm6 vpsubw ymm1, ymm5, ymmword ptr[eax] vpsubd ymm1, ymm5, ymm6 vpsubd ymm1, ymm5, ymmword ptr[eax] vpsubq ymm1, ymm5, ymm6 vpsubq ymm1, ymm5, ymmword ptr[eax] vpsubsb ymm1, ymm5, ymm6 vpsubsb ymm1, ymm5, ymmword ptr[eax] vpsubsw ymm1, ymm5, ymm6 vpsubsw ymm1, ymm5, ymmword ptr[eax] vpsubusb ymm1, ymm5, ymm6 vpsubusb ymm1, ymm5, ymmword ptr[eax] vpsubusw ymm1, ymm5, ymm6 vpsubusw ymm1, ymm5, ymmword ptr[eax] vpunpckhbw ymm1, ymm5, ymm6 vpunpckhbw ymm1, ymm5, ymmword ptr[eax] vpunpckhwd ymm1, ymm5, ymm6 vpunpckhwd ymm1, ymm5, ymmword ptr[eax] vpunpckhdq ymm1, ymm5, ymm6 vpunpckhdq ymm1, ymm5, ymmword ptr[eax] vpunpckhqdq ymm1, ymm5, ymm6 vpunpckhqdq ymm1, ymm5, ymmword ptr[eax] vpunpcklbw ymm1, ymm5, ymm6 vpunpcklbw ymm1, ymm5, ymmword ptr[eax] vpunpcklwd ymm1, ymm5, ymm6 vpunpcklwd ymm1, ymm5, ymmword ptr[eax] vpunpckldq ymm1, ymm5, ymm6 vpunpckldq ymm1, ymm5, ymmword ptr[eax] vpunpcklqdq ymm1, ymm5, ymm6 vpunpcklqdq ymm1, ymm5, ymmword ptr[eax] vpxor ymm1, ymm5, ymm6 vpxor ymm1, ymm5, ymmword ptr[eax] masm_test_avx2 endp ;---------------------------------------- ; Call graph ;---------------------------------------- masm_test_cfg1 proc L0: mov eax, 2 mov edx, 1 cmp eax, 0 jle L1 dec edx L1: dec eax jne L0 masm_test_cfg1 endp ;---------------------------------------- ; Register allocation ;---------------------------------------- masm_test_register_allocation1 proc push ebp mov ebp,esp push ebx push esi push edi and esp,0FFFFFFF0h mov ebx,esp sub esp,20h mov eax,2 mov ecx,1 xor edx,edx xor esi,esi xor edi,edi mov dword ptr [ebx-4],eax xor eax,eax mov dword ptr [ebx-8],ecx xor ecx,ecx mov dword ptr [ebx-0Ch],edx xor edx,edx mov dword ptr [ebx-10h],esi mov esi,0Ah mov dword ptr [ebx-18h],esi mov esi,dword ptr [ebx-10h] LoopHeadA: cmp edx,5 jg L1 mov dword ptr [ebx-10h],esi mov esi,0Ah jmp LoopB LoopB: inc edx add ecx,edx add eax,ecx add edi,eax mov dword ptr [ebx-1Ch],esi mov esi,dword ptr [ebx-10h] add esi,edi mov dword ptr [ebx-10h],esi mov esi,dword ptr [ebx-1Ch] dec esi jne LoopB mov esi,dword ptr [ebx-18h] dec esi jne L1a jmp LoopEndAa L1a: mov dword ptr [ebx-18h],esi mov esi,dword ptr [ebx-10h] jmp L1 LoopEndAa: jmp LoopEndA L1: dec edx mov dword ptr [ebx-14h],edi mov edi,dword ptr [ebx-0Ch] add edi,esi mov dword ptr [ebx-10h],esi mov esi,dword ptr [ebx-8] add esi,edi mov dword ptr [ebx-0Ch],edi mov edi,dword ptr [ebx-4] add edi,esi mov dword ptr [ebx-8],esi mov dword ptr [ebx-4],edi mov esi,dword ptr [ebx-14h] mov edi,dword ptr [ebx-18h] dec edi jne LoopHeadAa jmp LoopEndA LoopHeadAa: mov dword ptr [ebx-18h],edi mov edi,esi mov esi,dword ptr [ebx-10h] jmp LoopHeadA LoopEndA: lea esp,[ebp-0Ch] pop edi pop esi pop ebx pop ebp ret masm_test_register_allocation1 endp ;---------------------------------------- ; Reassign physical register by register allocator ;---------------------------------------- masm_test_regalloc_reassign_physical_reg proc maskmovdqu xmm0, xmm1 mov edi, esi maskmovdqu xmm0, xmm1 masm_test_regalloc_reassign_physical_reg endp end
test/golang/bug-901.asm
OfekShilon/compiler-explorer
4,668
99412
<reponame>OfekShilon/compiler-explorer<filename>test/golang/bug-901.asm "".Fun STEXT nosplit size=14 args=0x0 locals=0x0 0x0000 00000 (test.go:3) TEXT "".Fun(SB), NOSPLIT, $0-0 0x0000 00000 (test.go:3) FUNCDATA $0, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB) 0x0000 00000 (test.go:3) FUNCDATA $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB) 0x0000 00000 (test.go:3) XORL AX, AX 0x0002 00002 (test.go:4) JMP 7 0x0004 00004 (test.go:4) INCQ AX 0x0007 00007 (test.go:4) CMPQ AX, $10 0x000b 00011 (test.go:4) JLT 4 0x000d 00013 (<unknown line number>) RET 0x0000 31 c0 eb 03 48 ff c0 48 83 f8 0a 7c f7 c3 1...H..H...|.. go.info."".Fun SDWARFINFO size=32 0x0000 02 22 22 2e 46 75 6e 00 00 00 00 00 00 00 00 00 ."".Fun......... 0x0010 00 00 00 00 00 00 00 00 01 9c 00 00 00 00 01 00 ................ rel 8+8 t=1 "".Fun+0 rel 16+8 t=1 "".Fun+14 rel 26+4 t=29 gofile../workspace/go/src/gopractice/io/test.go+0 go.range."".Fun SDWARFRANGE size=0 gclocals·33cdeccccebe80329f1fdbee7f5874cb SRODATA dupok size=8 0x0000 01 00 00 00 00 00 00 00 ........
programs/oeis/089/A089143.asm
karttu/loda
1
129
<gh_stars>1-10 ; A089143: a(n) = 9*2^n - 6. ; 3,12,30,66,138,282,570,1146,2298,4602,9210,18426,36858,73722,147450,294906,589818,1179642,2359290,4718586,9437178,18874362,37748730,75497466,150994938,301989882,603979770,1207959546,2415919098,4831838202,9663676410,19327352826 mov $1,2 pow $1,$0 sub $1,1 mul $1,9 add $1,3
programs/oeis/187/A187949.asm
neoneye/loda
22
240116
; A187949: Positions of 0 in A187948; complement of A187953. ; 2,5,10,13,15,18,23,26,31,34,36,39,44,47,49,52,57,60,65,68,70,73,78,81,86,89,91,94,99,102,104,107,112,115,120,123,125,128,133,136,138,141,146,149,154,157,159,162,167,170,175,178,180,183,188,191,193,196,201,204,209,212,214,217 seq $0,307295 ; If n is even, a(n) = A001950(n/2+1), otherwise a(n) = A001950((n-1)/2+1) + 1. seq $0,3259 ; Complement of A003258. sub $0,4
libsrc/video/tms9918/stdio/generic_console/bordercolour.asm
jpoikela/z88dk
0
174384
; void bordercolor(int c) __z88dk_fastcall; ; ; SECTION code_clib PUBLIC __tms9918_bordercolor EXTERN conio_map_colour EXTERN msx_set_border INCLUDE "video/tms9918/vdp.inc" IF VDP_EXPORT_DIRECT = 1 PUBLIC bordercolor PUBLIC _bordercolor defc bordercolor = __tms9918_bordercolor defc _bordercolor = __tms9918_bordercolor ENDIF __tms9918_bordercolor: ld a,l call conio_map_colour ld l,a jp msx_set_border
oeis/057/A057773.asm
neoneye/loda-programs
11
21268
; A057773: Sum_{i=1..n} nu_2 ( prime(i) - 1), where prime(i) is the i-th prime and nu_2(m) = exponent of highest power of 2 dividing m. ; 0,1,3,4,5,7,11,12,13,15,16,18,21,22,23,25,26,28,29,30,33,34,35,38,43,45,46,47,49,53,54,55,58,59,61,62,64,65,66,68,69,71,72,78,80,81,82,83,84,86,89,90,94,95,103,104,106,107,109,112,113,115,116,117,120,122,123,127,128,130,135,136,137,139,140,141,143,145,149,152,153,155,156,160,161,162,168,171,173,174,175,176,177,178,179,180,182,185,186,188 mov $2,$0 mov $4,$0 lpb $2 mov $0,$4 sub $2,1 sub $0,$2 seq $0,23506 ; Exponent of 2 in prime factorization of prime(n) - 1. add $3,$0 lpe mov $0,$3
_anim/obj14.asm
NatsumiFox/AMPS-Sonic-1-2005
2
83306
<reponame>NatsumiFox/AMPS-Sonic-1-2005 ; --------------------------------------------------------------------------- ; Animation script - lava balls ; --------------------------------------------------------------------------- dc.w byte_E4CC-Ani_obj14 dc.w byte_E4D2-Ani_obj14 dc.w byte_E4D6-Ani_obj14 dc.w byte_E4DC-Ani_obj14 byte_E4CC: dc.b 5, 0, $20, 1, $21, $FF byte_E4D2: dc.b 5, 2, $FC, 0 byte_E4D6: dc.b 5, 3, $43, 4, $44, $FF byte_E4DC: dc.b 5, 5, $FC, 0 even
programs/oeis/253/A253130.asm
jmorken/loda
1
20209
; A253130: Number of length 2+2 0..n arrays with the sum of medians of adjacent triples multiplied by some arrangement of +-1 equal to zero. ; 12,53,152,345,676,1197,1968,3057,4540,6501,9032,12233,16212,21085,26976,34017,42348,52117,63480,76601,91652,108813,128272,150225,174876,202437,233128,267177,304820,346301,391872,441793,496332,555765,620376,690457 mov $2,$0 mov $3,$0 sub $4,$0 mul $0,4 add $4,2 mul $4,$3 add $4,$0 add $4,5 pow $4,2 div $4,3 mov $1,$4 add $1,4 mov $5,$2 mul $5,2 add $1,$5 mov $6,$2 mul $6,$2 mov $5,$6 mul $5,6 add $1,$5 mul $6,$2 mov $5,$6 mul $5,8 add $1,$5
scripts/.itunes-volume.applescript
looking-for-a-job/mac-itunes
1
2067
<reponame>looking-for-a-job/mac-itunes<filename>scripts/.itunes-volume.applescript #!/usr/bin/osascript -- volume.applescript [volume] on run argv if count of argv is 1 then tell application "itunes" to set sound volume to (item 1 of argv) end if tell application "itunes" to sound volume end run
oeis/010/A010973.asm
neoneye/loda-programs
11
90825
<reponame>neoneye/loda-programs ; A010973: a(n) = binomial(n,20). ; 1,21,231,1771,10626,53130,230230,888030,3108105,10015005,30045015,84672315,225792840,573166440,1391975640,3247943160,7307872110,15905368710,33578000610,68923264410,137846528820,269128937220,513791607420,960566918220,1761039350070,3169870830126,5608233007146,9762479679106,16735679449896,28277527346376,47129212243960,77535155627160,125994627894135,202355008436035,321387366339585,505037289962205,785613562163430,1210269541711230,1847253511032930,2794563003870330,4191844505805495,6236646703759395 add $0,20 bin $0,20
pwnlib/shellcraft/templates/powerpc/linux/mkdir.asm
zaratec/pwntools
5
167359
<% from pwnlib.shellcraft.powerpc.linux import syscall %> <%page args="path, mode"/> <%docstring> Invokes the syscall mkdir. See 'man 2 mkdir' for more information. Arguments: path(char): path mode(mode_t): mode </%docstring> ${syscall('SYS_mkdir', path, mode)}
Deck.adb
Entomy/letscode-cards
4
16820
with Ada.Calendar; use Ada.Calendar; package body Deck is function Draw return Card is Result : Index_Type := Random(Index_Generator); begin while Backing(Result).In_Deck = False loop Result := Random(Index_Generator); end loop; Backing(Result).In_Deck := False; return Card(Backing(Result)); end Draw; begin Reset(Index_Generator, Integer(Seconds(Clock))); end Deck;
agda-stdlib/src/Algebra/Module/Definitions/Left.agda
DreamLinuxer/popl21-artifact
5
14434
<filename>agda-stdlib/src/Algebra/Module/Definitions/Left.agda ------------------------------------------------------------------------ -- The Agda standard library -- -- Properties of left-scaling ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary -- The properties are parameterised by the two carriers and -- the result equality. module Algebra.Module.Definitions.Left {a b ℓb} (A : Set a) {B : Set b} (_≈_ : Rel B ℓb) where open import Data.Sum open import Data.Product ------------------------------------------------------------------------ -- Binary operations open import Algebra.Core ------------------------------------------------------------------------ -- Properties of operations LeftIdentity : A → Opₗ A B → Set _ LeftIdentity a _∙ᴮ_ = ∀ m → (a ∙ᴮ m) ≈ m Associative : Op₂ A → Opₗ A B → Set _ Associative _∙ᴬ_ _∙ᴮ_ = ∀ x y m → ((x ∙ᴬ y) ∙ᴮ m) ≈ (x ∙ᴮ (y ∙ᴮ m)) _DistributesOverˡ_ : Opₗ A B → Op₂ B → Set _ _*_ DistributesOverˡ _+_ = ∀ x m n → (x * (m + n)) ≈ ((x * m) + (x * n)) _DistributesOverʳ_⟶_ : Opₗ A B → Op₂ A → Op₂ B → Set _ _*_ DistributesOverʳ _+ᴬ_ ⟶ _+ᴮ_ = ∀ x m n → ((m +ᴬ n) * x) ≈ ((m * x) +ᴮ (n * x)) LeftZero : A → B → Opₗ A B → Set _ LeftZero zᴬ zᴮ _∙_ = ∀ x → (zᴬ ∙ x) ≈ zᴮ RightZero : B → Opₗ A B → Set _ RightZero z _∙_ = ∀ x → (x ∙ z) ≈ z Commutative : Opₗ A B → Set _ Commutative _∙_ = ∀ x y m → (x ∙ (y ∙ m)) ≈ (y ∙ (x ∙ m)) LeftCongruent : Opₗ A B → Set _ LeftCongruent _∙_ = ∀ {x} → (x ∙_) Preserves _≈_ ⟶ _≈_ RightCongruent : ∀ {ℓa} → Rel A ℓa → Opₗ A B → Set _ RightCongruent ≈ᴬ _∙_ = ∀ {m} → (_∙ m) Preserves ≈ᴬ ⟶ _≈_ Congruent : ∀ {ℓa} → Rel A ℓa → Opₗ A B → Set _ Congruent ≈ᴬ ∙ = ∙ Preserves₂ ≈ᴬ ⟶ _≈_ ⟶ _≈_
mibench/security/blowfish/asm/win32.asm
hyu-iot/gem5
7
87406
; Don't even think of reading this code ; It was automatically generated by bf586.pl ; Which is a perl program used to generate the x86 assember for ; any of elf, a.out, Win32, or Solaris ; It can be found in SSLeay 0.7.0+ ; eric <<EMAIL>> ; TITLE bfx86xxxx.asm .386 .model FLAT _TEXT SEGMENT PUBLIC _BF_encrypt EXTRN _des_SPtrans:DWORD _BF_encrypt PROC NEAR push ebp push ebx push esi push edi ; ; Load the 2 words mov eax, DWORD PTR 20[esp] mov ecx, DWORD PTR [eax] mov edx, DWORD PTR 4[eax] ; ; P pointer, s and enc flag mov edi, DWORD PTR 24[esp] xor eax, eax xor ebx, ebx mov ebp, DWORD PTR 28[esp] cmp ebp, 0 je $L000start_decrypt xor ecx, DWORD PTR [edi] ; ; Round 0 ror ecx, 16 mov esi, DWORD PTR 4[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 1 ror edx, 16 mov esi, DWORD PTR 8[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi ; ; Round 2 ror ecx, 16 mov esi, DWORD PTR 12[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 3 ror edx, 16 mov esi, DWORD PTR 16[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi ; ; Round 4 ror ecx, 16 mov esi, DWORD PTR 20[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 5 ror edx, 16 mov esi, DWORD PTR 24[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi ; ; Round 6 ror ecx, 16 mov esi, DWORD PTR 28[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 7 ror edx, 16 mov esi, DWORD PTR 32[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi ; ; Round 8 ror ecx, 16 mov esi, DWORD PTR 36[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 9 ror edx, 16 mov esi, DWORD PTR 40[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi ; ; Round 10 ror ecx, 16 mov esi, DWORD PTR 44[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 11 ror edx, 16 mov esi, DWORD PTR 48[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi ; ; Round 12 ror ecx, 16 mov esi, DWORD PTR 52[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 13 ror edx, 16 mov esi, DWORD PTR 56[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi ; ; Round 14 ror ecx, 16 mov esi, DWORD PTR 60[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 15 ror edx, 16 mov esi, DWORD PTR 64[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi xor edx, DWORD PTR 68[edi] mov eax, DWORD PTR 20[esp] mov DWORD PTR [eax],edx mov DWORD PTR 4[eax],ecx pop edi pop esi pop ebx pop ebp ret $L000start_decrypt: xor ecx, DWORD PTR 68[edi] ; ; Round 16 ror ecx, 16 mov esi, DWORD PTR 64[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 15 ror edx, 16 mov esi, DWORD PTR 60[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi ; ; Round 14 ror ecx, 16 mov esi, DWORD PTR 56[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 13 ror edx, 16 mov esi, DWORD PTR 52[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi ; ; Round 12 ror ecx, 16 mov esi, DWORD PTR 48[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 11 ror edx, 16 mov esi, DWORD PTR 44[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi ; ; Round 10 ror ecx, 16 mov esi, DWORD PTR 40[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 9 ror edx, 16 mov esi, DWORD PTR 36[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi ; ; Round 8 ror ecx, 16 mov esi, DWORD PTR 32[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 7 ror edx, 16 mov esi, DWORD PTR 28[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi ; ; Round 6 ror ecx, 16 mov esi, DWORD PTR 24[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 5 ror edx, 16 mov esi, DWORD PTR 20[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi ; ; Round 4 ror ecx, 16 mov esi, DWORD PTR 16[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 3 ror edx, 16 mov esi, DWORD PTR 12[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi ; ; Round 2 ror ecx, 16 mov esi, DWORD PTR 8[edi] mov al, ch mov bl, cl ror ecx, 16 xor edx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, ch mov bl, cl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor edx, esi ; ; Round 1 ror edx, 16 mov esi, DWORD PTR 4[edi] mov al, dh mov bl, dl ror edx, 16 xor ecx, esi mov esi, DWORD PTR 72[eax*4+edi] mov ebp, DWORD PTR 1096[ebx*4+edi] mov al, dh mov bl, dl add esi, ebp mov eax, DWORD PTR 2120[eax*4+edi] xor esi, eax mov ebp, DWORD PTR 3144[ebx*4+edi] add esi, ebp xor eax, eax xor ecx, esi xor edx, DWORD PTR [edi] mov eax, DWORD PTR 20[esp] mov DWORD PTR [eax],edx mov DWORD PTR 4[eax],ecx pop edi pop esi pop ebx pop ebp ret _BF_encrypt ENDP _TEXT ENDS END
src/crawler_interface.ads
mulander/crawler
1
9678
<reponame>mulander/crawler -- Copyright (c) 2012, mulander <<EMAIL>> -- All rights reserved. -- Use of this source code is governed by a BSD-style license that can be -- found in the LICENSE file. with Ada.Finalization; with Terminal_Interface.Curses; with Crawler.Entities; package Crawler_Interface is package Curses renames Terminal_Interface.Curses; type Screen is new Ada.Finalization.Limited_Controlled with private; -- Print a message on the screen procedure Add (This : in Screen; Str : in String); function Get_Height (This : in Screen) return Curses.Line_Count; function Get_Width (This : in Screen) return Curses.Column_Count; type Frame is new Ada.Finalization.Limited_Controlled with private; -- Initialize a main window (no parent) procedure Make (This : in out Frame; Height : Curses.Line_Count; Width : Curses.Column_Count; Row : Curses.Line_Position; Col : Curses.Column_Position); -- Initialize a subwindow (viewport) with a parent window procedure Make_Sub_Window (This : in out Frame; Parent : Frame; Height : Curses.Line_Count; Width : Curses.Column_Count; Row : Curses.Line_Position; Col : Curses.Column_Position); -- Get the window function Get_Window (This : in Frame) return Curses.Window; -- Get the window function Get_Parent_Window (This : in Frame) return Curses.Window; -- Get window type, if TRUE we have a subwindow, if FALSE we have a main window function Has_Parent_Window (This : in Frame) return Boolean; -- Get height function Get_Height (This : in Frame) return Curses.Line_Count; -- Get Width function Get_Width (This : in Frame) return Curses.Column_Count; -- Get the row (y) position of the window function Get_Row (This : in Frame) return Curses.Line_Position; -- Get the col (x) position of the window function Get_Col (This : in Frame) return Curses.Column_Position; -- Add a character to the window procedure Add (This : in Frame; Character : in Crawler.Entities.Character); -- Add a character at a specific position to the window procedure Add (This : in Frame; Character : in out Crawler.Entities.Character; Row : in Curses.Line_Position; Col : in Curses.Column_Position); -- Center the viewport around a character procedure Center (This : in out Frame; Character : in Crawler.Entities.Character); -- Fill a window with numbers - the window is split in four equal regions, -- each region is filled with a single number, so 4 regions and 4 numbers. -- This is a suggestion of how this will look: -- 0 | 1 -- ----- -- 2 | 3 -- This function is used only for debugging purposes. procedure Fill_Window (This : in out Frame); -- Move a window in a new position (r, c) procedure Move (This : in out Frame; Row : Curses.Line_Position; Col : Curses.Column_Position); -- Refresh the window procedure Refresh (This : in out Frame); -- Define the "erase" character, use an empty character for cleaning a cell or a -- visible character for showing the trace of a game character procedure Erase (This : in Frame; Character : in Crawler.Entities.Character); private type Screen is new Ada.Finalization.Limited_Controlled with record Height : Curses.Line_Position; Width : Curses.Column_Position; end record; overriding procedure Initialize (This: in out Screen); overriding procedure Finalize (This: in out Screen); type Frame is new Ada.Finalization.Limited_Controlled with record Height : Curses.Line_Count; Width : Curses.Column_Count; Row : Curses.Line_Position; Col : Curses.Column_Position; Has_Parent_Window : Boolean; Window : Curses.Window; Parent : Curses.Window; end record; overriding procedure Finalize (This: in out Frame); procedure Internal_Add (This : in Frame; Char : in Character; Row : in Curses.Line_Position; Col : in Curses.Column_Position); end Crawler_Interface;
src/z80asm/dev/z80asm_lib/rld.asm
ahjelm/z88dk
640
170137
; Substitute for z80 rld instruction ; aralbrec 06.2007 ; CPU Min T Max T ; 8080 201 232 ; 8085 197 226 ; gbz80 164 188 ; r2ka 108 125 ; z180 18 18 ; z80 18 18 ; z80n 18 18 SECTION code_l_sccz80 PUBLIC __z80asm__rld __z80asm__rld: jr nc, dorld call dorld scf ret dorld: IF __CPU_INTEL__ ; a = xi, (hl) = jk --> a = xj, (hl) = ki push de push hl ld l, (hl) ld h, 0 ; hl = 00jk ld d, a ; d = xi and 0xf0 ld e, a ; e = x0 ld a, d and 0x0f ld d, a ; d = a = 0i add hl, hl add hl, hl add hl, hl add hl, hl ; a = 0i, hl = 0jk0 add a, l ld l, a ; a = 0i, hl = 0jki ld a, h ; a = 0j, hl = 0jki add a, e ; a = xj, hl = 0jki ld e, l ; a = xj, e = ki pop hl ld (hl), e ; a = xj, (hl) = ki pop de ELSE rlca rlca rlca rlca ; a = bits 32107654 sla a rl (hl) adc a, 0 rla rl (hl) adc a, 0 rla rl (hl) adc a, 0 rla rl (hl) adc a, 0 ENDIF or a ret
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_583.asm
ljhsiun2/medusa
9
165900
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r10 push %r8 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0x127e5, %rsi lea addresses_D_ht+0x15bd9, %rdi nop nop nop xor %rdx, %rdx mov $28, %rcx rep movsw nop sub $55698, %rbp lea addresses_A_ht+0x1c43d, %r10 nop nop nop nop nop add $46857, %rbx movups (%r10), %xmm1 vpextrq $0, %xmm1, %rcx nop nop nop cmp %rdx, %rdx lea addresses_A_ht+0x196f1, %rdx clflush (%rdx) nop and $30892, %r10 movups (%rdx), %xmm0 vpextrq $1, %xmm0, %rsi nop add %rbx, %rbx lea addresses_A_ht+0x98fd, %rsi lea addresses_A_ht+0x14a55, %rdi nop nop nop nop nop xor %r8, %r8 mov $19, %rcx rep movsq nop nop nop nop nop xor $18291, %r10 lea addresses_WC_ht+0x1e93d, %rcx nop nop nop nop nop and %rsi, %rsi mov (%rcx), %r8d nop nop nop nop nop inc %rbp pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r8 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r15 push %r9 push %rbp push %rbx push %rcx push %rdi push %rsi // Load lea addresses_RW+0x53d, %rsi nop nop nop sub $64810, %r9 movb (%rsi), %r15b nop nop add %rsi, %rsi // Store lea addresses_D+0x313d, %rbx nop dec %r11 mov $0x5152535455565758, %rsi movq %rsi, (%rbx) nop inc %rbx // Store lea addresses_D+0x1a73d, %rbp cmp %r9, %r9 mov $0x5152535455565758, %r11 movq %r11, (%rbp) nop nop nop nop dec %r15 // REPMOV lea addresses_A+0x7f3d, %rsi lea addresses_A+0x11c2d, %rdi nop and %rbx, %rbx mov $65, %rcx rep movsb nop nop nop sub %rbp, %rbp // Store lea addresses_D+0x1933d, %r9 nop nop nop nop nop and %rsi, %rsi mov $0x5152535455565758, %rdi movq %rdi, (%r9) nop nop nop nop add %r11, %r11 // Load lea addresses_PSE+0x162e5, %r12 inc %r15 vmovups (%r12), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $0, %xmm3, %rcx nop nop nop nop nop dec %r11 // Faulty Load lea addresses_D+0x313d, %r12 nop nop nop xor %r15, %r15 mov (%r12), %r11w lea oracles, %rbp and $0xff, %r11 shlq $12, %r11 mov (%rbp,%r11,1), %r11 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r15 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_D', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_RW', 'same': False, 'size': 1, 'congruent': 7, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_D', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D', 'same': False, 'size': 8, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_A', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A', 'congruent': 2, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_D', 'same': False, 'size': 8, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_PSE', 'same': False, 'size': 32, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_D', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'58': 21829} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
test/interaction/Issue3152.agda
cruhland/agda
1,989
9422
<gh_stars>1000+ postulate M : Set → Set _>>=_ : ∀ {A B} → M A → (A → M B) → M B _>>_ : ∀ {A B} → M A → M B → M B _<|>_ : ∀ {A} → M A → M A → M A infixr 4 _>>=_ _>>_ infixr -100 _<|>_ expr : ∀ {A} → (A → M A) → (A → M A) expr f a = do x ← {!f a!} y ← {!f x <|> f a!} {!f x <|> f y!} {!f x <|> f y!}
src/main/antlr4/hu/karsany/vau/grammar/datamodel/DataModel.g4
karsany/vau
9
3381
grammar DataModel; s : entries ; entries: (entity|link|ref)+ ; entity : 'entity' entity_name datagroup_definition ; datagroup_definition : ('{' datagroup* '}')? ; link : 'link' link_name 'between' entity_name_with_optional_alias (('and'|',') entity_name_with_optional_alias)* (';'|datagroup_definition) ; entity_name_with_optional_alias : entity_name ('as' alias)?; alias : ID; datagroup : 'datagroup' datagroup_name '{' attributes '}'; ref : 'ref' reference_name '{' reference_attributes '}'; reference_attributes : keys attributes ; keys : key+ ; attributes : attribute* ; attribute : 'attr' attribute_name 'typ' type referencing_def? comment? ';'; referencing_def: 'references' reference_name; key : 'key' attribute_name 'typ' type comment? ';'; comment : STRINGDEF ; STRINGDEF: '"' CHARSEQUENCE? '"' { String s = getText(); s = s.substring(1, s.length() - 1); // strip the leading and trailing quotes s = s.replace("\"\"", "\""); // replace taskName double quotes with single quotes setText(s); } ; fragment CHARSEQUENCE: CHAR+ ; fragment CHAR: ~["] | '\\\n' // Added line | '\\\r\n' // Added line ; type : vautype | nativetype ; nativetype: 'NATIVE' '(' nativetypedef ')' ; nativetypedef: STRINGDEF ; vautype : 'CURRENCY' | 'DATE' | 'LARGETEXT' | 'MIDDLETEXT' | 'MIDDLETEXT' | 'MONEY' | 'PERCENTAGE' | 'SHORTTEXT' | 'SMALLTEXT' | 'FLAG' | 'INTEGER' | 'ID' ; datagroup_name : ID ; entity_name : ID ; link_name : ID; attribute_name : ID ; reference_name : ID ; ID : CHARS (CHARS|SYMBOLS|NUMBERS)*; SYMBOLS : ('_'|'$'); CHARS : [A-Z] ; NUMBERS : [0-9] ; WS : [ \t\r\n]+ -> skip ; COMMENT : '/*' .*? '*/' -> skip ; LINE_COMMENT : '//' ~[\r\n]* -> skip ;
oeis/086/A086403.asm
neoneye/loda-programs
11
1200
; A086403: Numerators in continued fraction representation of (e-1)/(e+1). ; Submitted by <NAME> ; 1,6,61,860,15541,342762,8927353,268163352,9126481321,347074453550,14586253530421,671314736852916,33580323096176221,1814008761930368850,105246088515057569521,6527071496695499679152,430891964870418036393553,30168964612425958047227862,2232934273284391313531255341,174199042280794948413485144460,14286554401298470161219313101061,1228817877553949228813274411835706,110607895534256729063355916378314601,10398370998097686481184269413973408200,1019150965709107531885121758485772318201 mul $0,2 add $0,3 mov $1,1 lpb $0 sub $0,2 mov $3,$2 mov $2,$1 mov $1,$0 mul $1,$2 mul $1,2 add $1,$3 lpe mov $0,$2
src/gl/mac/gl-cgl.ads
Roldak/OpenGLAda
79
20944
-- part of OpenGLAda, (c) 2017 <NAME> -- released under the terms of the MIT license, see the file "COPYING" with System; with Interfaces.C.Extensions; with Interfaces.C.Strings; with GL.Low_Level; with GL.Types; package GL.CGL is pragma Preelaborate; use GL.Types; -- CGL types and constants subtype CGLContextObject is System.Address; subtype CGLPixelFormatObject is System.Address; subtype CGLRendererInfoObject is System.Address; subtype CGLPBufferObject is System.Address; subtype CGLShareGroup is System.Address; type CGLPixelFormatAttribute is (Terminator, kCGLPFAAllRenderers, kCGLPFATripleBuffer, kCGLPFADoubleBuffer, kCGLPFAStereo, kCGLPFAAuxBuffers, kCGLPFAColorSize, kCGLPFAAlphaSize, kCGLPFADepthSize, kCGLPFAStencilSize, kCGLPFAAccumSize, kCGLPFAMinimumPolicy, kCGLPFAMaximumPolicy, kCGLPFAOffScreen, kCGLPFAFullScreen, kCGLPFASampleBuffers, kCGLPFASamples, kCGLPFAAuxDepthStencil, kCGLPFAColorFloat, kCGLPFAMultisample, kCGLPFASupersample, kCGLPFASampleAlpha, kCGLPFARendererID, kCGLPFASingleRenderer, kCGLPFANoRecovery, kCGLPFAAccelerated, kCGLPFAClosestPolicy, kCGLPFARobust, kCGLPFABackingStore, kCGLPFAMPSafe, kCGLPFAWindow, kCGLPFAMultiScreen, kCGLPFACompliant, kCGLPFADisplayMask, kCGLPFAPBuffer, kCGLPFARemotePBuffer, kCGLPFAAllowOfflineRenderers, kCGLPFAAcceleratedCompute, kCGLPFAOpenGLProfile, kCGLPFAVirtualScreenCount); type CGLRendererProperty is (kCGLRPOffScreen, kCGLRPFullScreen, kCGLRPRendererID, kCGLRPAccelerated, kCGLRPRobust, kCGLRPBackingStore, kCGLRPMPSafe, kCGLRPWindow, kCGLRPMultiScreen, kCGLRPCompliant, kCGLRPDisplayMask, kCGLRPBufferModes, kCGLRPColorModes, kCGLRPAccumModes, kCGLRPDepthModes, kCGLRPStencilModes, kCGLRPMaxAuxBuffers, kCGLRPMaxSampleBuffers, kCGLRPMaxSamples, kCGLRPSampleModes, kCGLRPSampleAlpha, kCGLRPVideoMemory, kCGLRPTextureMemory, kCGLRPGPUVertProcCapable, kCGLRPGPUFragProcCapable, kCGLRPRendererCount, kCGLRPOnline, kCGLRPAcceleratedCompute, kCGLRPVideoMemoryMegabytes, kCGLRPTextureMemoryMegabytes); type CGLContextEnable is (kCGLCESwapRectangle, kCGLCESwapLimit, kCGLCERasterization, kCGLCEStateValidation, kCGLCESurfaceBackingSize, kCGLCEDisplayListOptimization, kCGLCEMPEngine, kCGLCECrashOnRemovedFunctions); type CGLContextParameter is (kCGLCPSwapRectangle, kCGLCPSwapInterval, kCGLCPDispatchTableSize, kCGLCPClientStorage, kCGLCPSurfaceTexture, kCGLCPSurfaceOrder, kCGLCPSurfaceOpacity, kCGLCPSurfaceBackingSize, kCGLCPSurfaceSurfaceVolatile, kCGLCPReclaimResources, kCGLCPCurrentRendererID, kCGLCPGPUVertexProcessing, kCGLCPGPUFragmentProcessing, kCGLCPHasDrawable, kCGLCPMPSwapsInFlight); type CGLGlobalOption is (kCGLGOFormatCacheSize, kCGLGOClearFormatCache, kCGLGORetainRenderers, kCGLGOResetLibrary, kCGLGOUseErrorHandler, kCGLGOUseBuildCache); type CGLOpenGLProfile is (kCGLOGLPVersion_Legacy, kCGLOGLPVersion_3_2_Core); type CGLError is (kCGLNoError, kCGLBadAttribute, kCGLBadProperty, kCGLBadPixelFormat, kCGLBadRendererInfo, kCGLBadContext, kCGLBadDrawable, kCGLBadDisplay, kCGLBadState, kCGLBadValue, kCGLBadMatch, kCGLBadEnumeration, kCGLBadOffScreen, kCGLBadFullScreen, kCGLBadWindow, kCGLBadAddress, kCGLBadCodeModule, kCGLBadAlloc, kCGLBadConnection); kCGLMonoscopicBit : constant := 16#00000001#; kCGLStereoscopicBit : constant := 16#00000002#; kCGLSingleBufferBit : constant := 16#00000004#; kCGLDoubleBufferBit : constant := 16#00000008#; kCGLTripleBufferBit : constant := 16#00000010#; kCGL0Bit : constant := 16#00000001#; kCGL1Bit : constant := 16#00000002#; kCGL2Bit : constant := 16#00000004#; kCGL3Bit : constant := 16#00000008#; kCGL4Bit : constant := 16#00000010#; kCGL5Bit : constant := 16#00000020#; kCGL6Bit : constant := 16#00000040#; kCGL8Bit : constant := 16#00000080#; kCGL10Bit : constant := 16#00000100#; kCGL12Bit : constant := 16#00000200#; kCGL16Bit : constant := 16#00000400#; kCGL24Bit : constant := 16#00000800#; kCGL32Bit : constant := 16#00001000#; kCGL48Bit : constant := 16#00002000#; kCGL64Bit : constant := 16#00004000#; kCGL96Bit : constant := 16#00008000#; kCGL128Bit : constant := 16#00010000#; kCGLRGB444Bit : constant := 16#00000040#; kCGLARGB4444Bit : constant := 16#00000080#; kCGLRGB444A8Bit : constant := 16#00000100#; kCGLRGB555Bit : constant := 16#00000200#; kCGLARGB1555Bit : constant := 16#00000400#; kCGLRGB555A8Bit : constant := 16#00000800#; kCGLRGB565Bit : constant := 16#00001000#; kCGLRGB565A8Bit : constant := 16#00002000#; kCGLRGB888Bit : constant := 16#00004000#; kCGLARGB8888Bit : constant := 16#00008000#; kCGLRGB888A8Bit : constant := 16#00010000#; kCGLRGB101010Bit : constant := 16#00020000#; kCGLARGB2101010Bit : constant := 16#00040000#; kCGLRGB101010_A8Bit : constant := 16#00080000#; kCGLRGB121212Bit : constant := 16#00100000#; kCGLARGB12121212Bit : constant := 16#00200000#; kCGLRGB161616Bit : constant := 16#00400000#; kCGLRGBA16161616Bit : constant := 16#00800000#; kCGLRGBFloat64Bit : constant := 16#01000000#; kCGLRGBAFloat64Bit : constant := 16#02000000#; kCGLRGBFloat128Bit : constant := 16#04000000#; kCGLRGBAFloat128Bit : constant := 16#08000000#; kCGLRGBFloat256Bit : constant := 16#10000000#; kCGLRGBAFloat256Bit : constant := 16#20000000#; kCGLSupersampleBit : constant := 16#00000001#; kCGLMultisampleBit : constant := 16#00000002#; type CGLPixelFormatAttribute_Array is array (Positive range <>) of aliased CGLPixelFormatAttribute; -- Pixel format functions function CGLChoosePixelFormat (attribs : access CGLPixelFormatAttribute; pix : access CGLPixelFormatObject; npix : access Int) return CGLError; function CGLDestroyPixelFormat (pix : CGLPixelFormatObject) return CGLError; function CGLDescribePixelFormat (pix : CGLPixelFormatObject; pix_num : Int; attrib : CGLPixelFormatAttribute; value : access Int) return CGLError; procedure CGLReleasePixelFormat (pix : in CGLPixelFormatObject); function CGLRetainPixelFormat (pix : CGLPixelFormatObject) return CGLPixelFormatObject; function CGLGetPixelFormatRetainCount (pix : CGLPixelFormatObject) return UInt; function CGLQueryRendererInfo (display_mask : UInt; rend : access CGLRendererInfoObject; nrend : access Int) return CGLError; function CGLDestroyRendererInfo (rend : CGLRendererInfoObject) return CGLError; function CGLDescribeRenderer (rend : CGLRendererInfoObject; rend_num : Int; prop : CGLRendererProperty; value : access Int) return CGLError; function CGLCreateContext (pix : CGLPixelFormatObject; share : CGLContextObject; ctx : access CGLContextObject) return CGLError; function CGLDestroyContext (ctx : CGLContextObject) return CGLError; function CGLCopyContext (src, dst : CGLContextObject; mask : Low_Level.Bitfield) return CGLError; function CGLRetainContext (ctx : CGLContextObject) return CGLContextObject; procedure CGLReleaseContext (ctx : in CGLContextObject); function CGLGetContextRetainCount (ctx : CGLContextObject) return UInt; function CGLGetPixelFormat (ctx : CGLContextObject) return CGLPixelFormatObject; function CGLCreatePBuffer (width, height : Size; target, internalFormat : Low_Level.Enum; max_level : Int; pbuffer : access CGLPBufferObject) return CGLError; function CGLDestroyPBuffer (pbuffer : CGLPBufferObject) return CGLError; function CGLDescribePBuffer (obj : CGLPBufferObject; width, height : access Size; target, internalFormat : access Low_Level.Enum; mipmap : access Int) return CGLError; function CGLTexImagePBuffer (ctx : CGLContextObject; pbuffer : CGLPBufferObject; source : Low_Level.Enum) return CGLError; function CGLRetainPBuffer (pbuffer : CGLPBufferObject) return CGLPBufferObject; procedure CGLReleasePBuffer (pbuffer : in CGLPBufferObject); function CGLGetPBufferRetainCount (pbuffer : CGLPBufferObject) return UInt; function CGLSetOffScreen (ctx : CGLContextObject; width, height : Size; rowbytes : Int; baseaddr : Interfaces.C.Extensions.void_ptr) return CGLError; function CGLGetOffScreen (ctx : CGLContextObject; width, height : access Size; rowbytes : access Int; baseaddr : access Interfaces.C.Extensions.void_ptr) return CGLError; function CGLSetFullScreen (ctx : CGLContextObject) return CGLError; function CGLSetFullScreenOnDisplay (ctx : CGLContextObject; display_mask : UInt) return CGLError; function CGLSetPBuffer (ctx : CGLContextObject; pbuffer : CGLPBufferObject; face : Low_Level.Enum; level, screen : Int) return CGLError; function CGLGetPBuffer (ctx : CGLContextObject; pbuffer : access CGLPBufferObject; face : access Low_Level.Enum; level, screen : access Int) return CGLError; function CGLClearDrawable (ctx : CGLContextObject) return CGLError; function CGLFlushDrawable (ctx : CGLContextObject) return CGLError; function CGLEnable (ctx : CGLContextObject; pname : CGLContextEnable) return CGLError; function CGLDisable (ctx : CGLContextObject; pname : CGLContextEnable) return CGLError; function CGLIsEnabled (ctx : CGLContextObject; pname : CGLContextEnable; enable : access Int) return CGLError; function CGLSetParameter (ctx : CGLContextObject; pname : CGLContextParameter; params : access constant Int) return CGLError; function CGLGetParameter (ctx : CGLContextObject; pname : CGLContextParameter; params : access Int) return CGLError; function CGLSetVirtualScreen (ctx : CGLContextObject; screen : Int) return CGLError; function CGLGetVirtualScreen (ctx : CGLContextObject; screen : access Int) return CGLError; function CGLUpdateContext (ctx : CGLContextObject) return CGLError; function CGLSetGlobalOption (pname : CGLGlobalOption; params : access constant Int) return CGLError; function CGLGetGlobalOption (pname : CGLGlobalOption; params : access Int) return CGLError; function CGLSetOption (pname : CGLGlobalOption; param : Int) return CGLError; function CGLGetOption (pname : CGLGlobalOption; param : access Int) return CGLError; function CGLLockContext (ctx : CGLContextObject) return CGLError; function CGLUnlockContext (ctx : CGLContextObject) return CGLError; procedure CGLGetVersion (majorvers, minorvers : out Int); function CGLErrorString (error : CGLError) return Interfaces.C.Strings.chars_ptr; function CGLSetCurrentContext (ctx : CGLContextObject) return CGLError; function CGLGetCurrentContext return CGLContextObject; function CGLGetShareGroup (ctx : CGLContextObject) return CGLShareGroup; private C_Enum_Size : constant := 32; for CGLPixelFormatAttribute use (Terminator => 0, kCGLPFAAllRenderers => 1, kCGLPFATripleBuffer => 3, kCGLPFADoubleBuffer => 5, kCGLPFAStereo => 6, kCGLPFAAuxBuffers => 7, kCGLPFAColorSize => 8, kCGLPFAAlphaSize => 11, kCGLPFADepthSize => 12, kCGLPFAStencilSize => 13, kCGLPFAAccumSize => 14, kCGLPFAMinimumPolicy => 51, kCGLPFAMaximumPolicy => 52, kCGLPFAOffScreen => 53, kCGLPFAFullScreen => 54, kCGLPFASampleBuffers => 55, kCGLPFASamples => 56, kCGLPFAAuxDepthStencil => 57, kCGLPFAColorFloat => 58, kCGLPFAMultisample => 59, kCGLPFASupersample => 60, kCGLPFASampleAlpha => 61, kCGLPFARendererID => 70, kCGLPFASingleRenderer => 71, kCGLPFANoRecovery => 72, kCGLPFAAccelerated => 73, kCGLPFAClosestPolicy => 74, kCGLPFARobust => 75, kCGLPFABackingStore => 76, kCGLPFAMPSafe => 78, kCGLPFAWindow => 80, kCGLPFAMultiScreen => 81, kCGLPFACompliant => 83, kCGLPFADisplayMask => 84, kCGLPFAPBuffer => 90, kCGLPFARemotePBuffer => 91, kCGLPFAAllowOfflineRenderers => 96, kCGLPFAAcceleratedCompute => 97, kCGLPFAOpenGLProfile => 99, kCGLPFAVirtualScreenCount => 128 ); for CGLPixelFormatAttribute'Size use C_Enum_Size; pragma Convention (C, CGLPixelFormatAttribute); for CGLRendererProperty use (kCGLRPOffScreen => 53, kCGLRPFullScreen => 54, kCGLRPRendererID => 70, kCGLRPAccelerated => 73, kCGLRPRobust => 75, kCGLRPBackingStore => 76, kCGLRPMPSafe => 78, kCGLRPWindow => 80, kCGLRPMultiScreen => 81, kCGLRPCompliant => 83, kCGLRPDisplayMask => 84, kCGLRPBufferModes => 100, kCGLRPColorModes => 103, kCGLRPAccumModes => 104, kCGLRPDepthModes => 105, kCGLRPStencilModes => 106, kCGLRPMaxAuxBuffers => 107, kCGLRPMaxSampleBuffers => 108, kCGLRPMaxSamples => 109, kCGLRPSampleModes => 110, kCGLRPSampleAlpha => 111, kCGLRPVideoMemory => 120, kCGLRPTextureMemory => 121, kCGLRPGPUVertProcCapable => 122, kCGLRPGPUFragProcCapable => 123, kCGLRPRendererCount => 128, kCGLRPOnline => 129, kCGLRPAcceleratedCompute => 130, kCGLRPVideoMemoryMegabytes => 131, kCGLRPTextureMemoryMegabytes => 132 ); for CGLRendererProperty'Size use C_Enum_Size; pragma Convention (C, CGLRendererProperty); for CGLContextEnable use (kCGLCESwapRectangle => 201, kCGLCESwapLimit => 203, kCGLCERasterization => 221, kCGLCEStateValidation => 301, kCGLCESurfaceBackingSize => 305, kCGLCEDisplayListOptimization => 307, kCGLCEMPEngine => 313, kCGLCECrashOnRemovedFunctions => 316 ); for CGLContextEnable'Size use C_Enum_Size; pragma Convention (C, CGLContextEnable); for CGLContextParameter use (kCGLCPSwapRectangle => 200, kCGLCPSwapInterval => 222, kCGLCPDispatchTableSize => 224, kCGLCPClientStorage => 226, kCGLCPSurfaceTexture => 228, kCGLCPSurfaceOrder => 235, kCGLCPSurfaceOpacity => 236, kCGLCPSurfaceBackingSize => 304, kCGLCPSurfaceSurfaceVolatile => 306, kCGLCPReclaimResources => 308, kCGLCPCurrentRendererID => 309, kCGLCPGPUVertexProcessing => 310, kCGLCPGPUFragmentProcessing => 311, kCGLCPHasDrawable => 314, kCGLCPMPSwapsInFlight => 315 ); for CGLContextParameter'Size use C_Enum_Size; pragma Convention (C, CGLContextParameter); for CGLGlobalOption use (kCGLGOFormatCacheSize => 501, kCGLGOClearFormatCache => 502, kCGLGORetainRenderers => 503, kCGLGOResetLibrary => 504, kCGLGOUseErrorHandler => 505, kCGLGOUseBuildCache => 506 ); for CGLGlobalOption'Size use C_Enum_Size; pragma Convention (C, CGLGlobalOption); for CGLOpenGLProfile use (kCGLOGLPVersion_Legacy => 16#1000#, kCGLOGLPVersion_3_2_Core => 16#3200# ); for CGLOpenGLProfile'Size use C_Enum_Size; pragma Convention (C, CGLOpenGLProfile); for CGLError use (kCGLNoError => 0, kCGLBadAttribute => 10000, kCGLBadProperty => 10001, kCGLBadPixelFormat => 10002, kCGLBadRendererInfo => 10003, kCGLBadContext => 10004, kCGLBadDrawable => 10005, kCGLBadDisplay => 10006, kCGLBadState => 10007, kCGLBadValue => 10008, kCGLBadMatch => 10009, kCGLBadEnumeration => 10010, kCGLBadOffScreen => 10011, kCGLBadFullScreen => 10012, kCGLBadWindow => 10013, kCGLBadAddress => 10014, kCGLBadCodeModule => 10015, kCGLBadAlloc => 10016, kCGLBadConnection => 10017 ); for CGLError'Size use C_Enum_Size; pragma Convention (C, CGLError); pragma Import (C, CGLChoosePixelFormat, "CGLChoosePixelFormat"); pragma Import (C, CGLDestroyPixelFormat, "CGLDestroyPixelFormat"); pragma Import (C, CGLDescribePixelFormat, "CGLDescribePixelFormat"); pragma Import (C, CGLReleasePixelFormat, "CGLReleasePixelFormat"); pragma Import (C, CGLRetainPixelFormat, "CGLRetainPixelFormat"); pragma Import (C, CGLGetPixelFormatRetainCount, "CGLGetPixelFormatRetainCount"); pragma Import (C, CGLQueryRendererInfo, "CGLQueryRendererInfo"); pragma Import (C, CGLDestroyRendererInfo, "CGLDestroyRendererInfo"); pragma Import (C, CGLDescribeRenderer, "CGLDescribeRenderer"); pragma Import (C, CGLCreateContext, "CGLCreateContext"); pragma Import (C, CGLDestroyContext, "CGLDestroyContext"); pragma Import (C, CGLCopyContext, "CGLCopyContext"); pragma Import (C, CGLRetainContext, "CGLRetainContext"); pragma Import (C, CGLReleaseContext, "CGLReleaseContext"); pragma Import (C, CGLGetContextRetainCount, "CGLGetContextRetainCount"); pragma Import (C, CGLGetPixelFormat, "CGLGetPixelFormat"); pragma Import (C, CGLCreatePBuffer, "CGLCreatePBuffer"); pragma Import (C, CGLDestroyPBuffer, "CGLDestroyPBuffer"); pragma Import (C, CGLDescribePBuffer, "CGLDescribePBuffer"); pragma Import (C, CGLTexImagePBuffer, "CGLTexImagePBuffer"); pragma Import (C, CGLRetainPBuffer, "CGLRetainPBuffer"); pragma Import (C, CGLReleasePBuffer, "CGLReleasePBuffer"); pragma Import (C, CGLGetPBufferRetainCount, "CGLGetPBufferRetainCount"); pragma Import (C, CGLSetOffScreen, "CGLSetOffScreen"); pragma Import (C, CGLGetOffScreen, "CGLGetOffScreen"); pragma Import (C, CGLSetFullScreen, "CGLSetFullScreen"); pragma Import (C, CGLSetFullScreenOnDisplay, "CGLSetFullScreenOnDisplay"); pragma Import (C, CGLSetPBuffer, "CGLSetPBuffer"); pragma Import (C, CGLGetPBuffer, "CGLGetPBuffer"); pragma Import (C, CGLClearDrawable, "CGLClearDrawable"); pragma Import (C, CGLFlushDrawable, "CGLFlushDrawable"); pragma Import (C, CGLEnable, "CGLEnable"); pragma Import (C, CGLDisable, "CGLDisable"); pragma Import (C, CGLIsEnabled, "CGLIsEnabled"); pragma Import (C, CGLSetParameter, "CGLSetParameter"); pragma Import (C, CGLGetParameter, "CGLGetParameter"); pragma Import (C, CGLSetVirtualScreen, "CGLSetVirtualScreen"); pragma Import (C, CGLGetVirtualScreen, "CGLGetVirtualScreen"); pragma Import (C, CGLUpdateContext, "CGLUpdateContext"); pragma Import (C, CGLSetGlobalOption, "CGLSetGlobalOption"); pragma Import (C, CGLGetGlobalOption, "CGLGetGlobalOption"); pragma Import (C, CGLSetOption, "CGLSetOption"); pragma Import (C, CGLGetOption, "CGLGetOption"); pragma Import (C, CGLLockContext, "CGLLockContext"); pragma Import (C, CGLUnlockContext, "CGLUnlockContext"); pragma Import (C, CGLGetVersion, "CGLGetVersion"); pragma Import (C, CGLErrorString, "CGLErrorString"); pragma Import (C, CGLSetCurrentContext, "CGLSetCurrentContext"); pragma Import (C, CGLGetCurrentContext, "CGLGetCurrentContext"); pragma Import (C, CGLGetShareGroup, "CGLGetShareGroup"); end GL.CGL;
Library/Text/TextGraphic/tgNumber.asm
steakknife/pcgeos
504
25145
COMMENT @---------------------------------------------------------------------- Copyright (c) GeoWorks 1989 -- All Rights Reserved PROJECT: PC GEOS MODULE: Text/TextGraphic FILE: tgNumber.asm METHODS: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 9/89 Initial version DESCRIPTION: ... $Id: tgNumber.asm,v 1.1 97/04/07 11:19:38 newdeal Exp $ ------------------------------------------------------------------------------@ TextGraphic segment resource COMMENT @---------------------------------------------------------------------- FUNCTION: VisTextFormatNumber DESCRIPTION: Format a number into a buffer CALLED BY: INTERNAL PASS: (on stack, pushed in this order): fptr.char - buffer dword - number word - VisTextNumberType RETURN: none DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 9/30/92 Initial version ------------------------------------------------------------------------------@ VISTEXTFORMATNUMBER proc far numType:VisTextNumberType, num:dword, buf:fptr.char uses ax, bx, cx, dx, di, es .enter EC < cmp numType, VisTextNumberType > EC < ERROR_AE VIS_TEXT_BAD_NUMBER_TYPE > les di, buf movdw dxax, num mov bx, numType cmp bx, VTNT_NUMBER jnz notNumber number: mov cx, mask UHTAF_NULL_TERMINATE call UtilHex32ToAscii jmp done notNumber: ; display 0 as '0', even for letters or roman numerals tstdw dxax jz number cmp bx, VTNT_LETTER_LOWER_A ja roman ; letter style cmpdw dxax, (26*3) ;if too big then bail ja number dec ax ;zero based push di clr cx ;cx = repeat count getLetterRepeatCount: inc cx sub ax, 26 jge getLetterRepeatCount add ax, 26+'A' SBCS < rep stosb > DBCS < rep stosw > clr ax SBCS < stosb > DBCS < stosw > pop di cmp bx, VTNT_LETTER_UPPER_A LONG jz done ; convert to lower case convertToLower: SBCS < mov al, es:[di] > DBCS < mov ax, es:[di] > LocalIsNull ax LONG jz done SBCS < sub al, 'A' - 'a' > DBCS < sub ax, 'A' - 'a' > LocalPutChar esdi, ax jmp convertToLower ; roman numeral style roman: cmpdw dxax, 3000 ;bail if too big jae number push di mov_tr cx, ax ;cx = number ; if num >= 1000 then add M for each 1000 DBCS < clr ah > mov dx, 1000 mov al, 'M' call addLetters ; if num >= 900 then add CM cmp cx, 900 jb under900 mov al, 'C' LocalPutChar esdi, ax mov al, 'M' LocalPutChar esdi, ax sub cx, 900 under900: ; if num >= 500 then add D cmp cx, 500 jb under500 mov al, 'D' LocalPutChar esdi, ax sub cx, 500 under500: ; if num >= 400 then add CD cmp cx, 400 jb under400 mov al, 'C' LocalPutChar esdi, ax mov al, 'D' LocalPutChar esdi, ax sub cx, 400 under400: ; if num >= 100 then add C for each 100 mov dx, 100 mov al, 'C' call addLetters ; if num >= 90 then add XC cmp cx, 90 jb under90 mov al, 'X' LocalPutChar esdi, ax mov al, 'C' LocalPutChar esdi, ax sub cx, 90 under90: ; if num >= 50 then add L cmp cx, 50 jb under50 mov al, 'L' LocalPutChar esdi, ax sub cx, 50 under50: ; if num >= 40 then add XL cmp cx, 40 jb under40 mov al, 'X' LocalPutChar esdi, ax mov al, 'L' LocalPutChar esdi, ax sub cx, 40 under40: ; if num >= 10 then add X for each 10 mov dx, 10 mov al, 'X' call addLetters ; if num >= 9 then add IX cmp cx, 9 jb under9 mov al, 'I' LocalPutChar esdi, ax mov al, 'X' LocalPutChar esdi, ax sub cx, 9 under9: ; if num >= 5 then add V cmp cx, 5 jb under5 mov al, 'V' LocalPutChar esdi, ax sub cx, 5 under5: ; if num >= 4 then add IV cmp cx, 4 jb under4 mov al, 'I' LocalPutChar esdi, ax mov al, 'V' LocalPutChar esdi, ax sub cx, 4 under4: ; if num >= 1 then add I for each 1 mov dx, 1 mov al, 'I' call addLetters clr ax LocalPutChar esdi, ax pop di cmp bx, VTNT_ROMAN_NUMERAL_UPPER LONG jnz convertToLower done: .leave ret @ArgSize ;--- ; cx = num, dx = unit, al = letter addLetters: cmp cx, dx jb addLetterDone SBCS < stosb > DBCS < stosw > sub cx, dx jmp addLetters addLetterDone: retn VISTEXTFORMATNUMBER endp TextGraphic ends
HS_Resizer/Main.asm
rvaccarim/hs_resizer
0
85336
<filename>HS_Resizer/Main.asm ;*********************** INCLUDE **************************** include \masm32\include\masm32rt.inc ;*********************** PROTOTYPES **************************** Maximize proto :HANDLE ;************************ STRUCTS **************************** MYRECT STRUCT left SDWORD ? top SDWORD ? right SDWORD ? bottom SDWORD ? MYRECT ENDS ;*********************** CONSTANTS ************************** HS_ICON equ 1 ID_TIMER equ 2 IDM_EXIT equ 3 WM_SHELLNOTIFY equ WM_USER + 5 ;************************* DATA **************************** .data szClassName db "HS_Resizer_Class", 0 szDisplayName db "Hearthstone Resizer", 0 szExit db "Exit", 0 szMutex db "HS_resizer", 0 szHearthstoneTitle db "Hearthstone", 0 szBattlenetTitle db "Blizzard Battle.net", 0 ; Window handles hHearthstone HWND 0 hBattlenet HWND 0 ; cntResizeAttempts DWORD 0 maxResizeAttempts DWORD 10 cntAppsNotFound DWORD 0 maxAppsNotFound DWORD 30 timeout WORD 2000 ; milliseconds .data? hMutex HANDLE ? hInstance HMODULE ? hResizerIcon HANDLE ? hPopupMenu HMENU ? notifyData NOTIFYICONDATA <?> ;*************************** CODE *********************** .code Resizer: invoke CreateMutex, NULL, FALSE, addr szMutex mov hMutex, eax invoke GetLastError cmp eax, ERROR_ALREADY_EXISTS jne Continue ; if it's already running then fine, end this instance jmp Done Continue: call StartUp Done: invoke CloseHandle, hMutex invoke ExitProcess, eax StartUp proc LOCAL msg:MSG LOCAL wc:WNDCLASSEX invoke GetModuleHandle, NULL mov hInstance, eax ; we won't be using the other members of the structure so we init everything with zero invoke memfill, addr wc, sizeof WNDCLASSEX, 0 mov wc.cbSize, sizeof WNDCLASSEX mov wc.hInstance, eax mov wc.lpszClassName, offset szClassName mov wc.lpfnWndProc, offset WndProc ; Register the window and create it invoke RegisterClassEx, addr wc invoke CreateWindowEx, NULL, addr szClassName, addr szDisplayName, NULL, NULL, NULL, NULL, NULL, HWND_MESSAGE, \ NULL, hInstance, NULL .while TRUE invoke GetMessage, addr msg, NULL, 0, 0 .break .if !eax invoke TranslateMessage, addr msg invoke DispatchMessage, addr msg .endw mov eax, msg.message ret StartUp endp WndProc proc hWin:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM LOCAL pt:POINT .if uMsg == WM_CREATE ; create popup and add our only entry invoke CreatePopupMenu mov hPopupMenu, eax invoke AppendMenu, hPopupMenu, MF_STRING, IDM_EXIT, addr szExit ; load our icon invoke LoadImage, hInstance, HS_ICON, IMAGE_ICON, 0, 0, NULL mov hResizerIcon, eax ; setup the tray icon mov notifyData.cbSize, sizeof NOTIFYICONDATA push hWin pop notifyData.hwnd mov notifyData.uID, 0 mov notifyData.uFlags, NIF_ICON or NIF_MESSAGE or NIF_TIP mov notifyData.uCallbackMessage, WM_SHELLNOTIFY push hResizerIcon pop notifyData.hIcon invoke lstrcpy, addr notifyData.szTip, addr szDisplayName invoke Shell_NotifyIcon, NIM_ADD, addr notifyData ; start timer, value is in milliseconds invoke SetTimer, hWin, ID_TIMER, timeout, NULL .elseif uMsg == WM_COMMAND mov eax, wParam ; wParam's low-order word contains the control ID ; EAX is the full 32-bit value, AX is the low-order 16-bits .if ax == IDM_EXIT ; wParam's high word stores the event ; shift the high word to the low word position shr eax, 16 .if ax == BN_CLICKED invoke SendMessage, hWin, WM_CLOSE, 0, 0 .endif .endif .elseif uMsg == WM_SHELLNOTIFY .if wParam == 0 .if lParam == WM_RBUTTONDOWN or WM_RBUTTONUP invoke GetCursorPos, ADDR pt invoke SetForegroundWindow, hWin invoke TrackPopupMenuEx, hPopupMenu, TPM_LEFTALIGN or TPM_LEFTBUTTON, pt.x, pt.y, hWin, 0 invoke PostMessage, hWin, WM_NULL, 0, 0 .endif .endif .elseif uMsg == WM_TIMER invoke FindWindow, NULL, addr szBattlenetTitle mov hBattlenet, eax invoke Maximize, eax invoke FindWindow, NULL, addr szHearthstoneTitle mov hHearthstone, eax invoke Maximize, eax ; 10 iterations every 2000 milliseconds = 20 seconds ; it should be enough, we can quit. ; We start counting only after the Hearthstone window has ; been detected (not when BattleNet is opened) .if hHearthstone != NULL mov eax, maxResizeAttempts .if cntResizeAttempts == eax invoke SendMessage, hWin, WM_CLOSE, 0, 0 .endif inc cntResizeAttempts .endif ; if we don't detect Batlle.Net and Hearthstone after a while ; we also quit. This can happen if the user starts Battle.Net, then ; never starts Hearthstone for some reason, then quits Battle.Net ; and forgets to stop the utility manually .if hBattlenet == NULL && hHearthstone == NULL mov eax, maxAppsNotFound .if cntAppsNotFound == eax invoke SendMessage, hWin, WM_CLOSE, 0, 0 .endif inc cntAppsNotFound .endif .elseif uMsg == WM_CLOSE ; clean stuff invoke Shell_NotifyIcon, NIM_DELETE, addr notifyData invoke DestroyIcon, hResizerIcon invoke DestroyMenu, hPopupMenu invoke KillTimer, hWin, ID_TIMER invoke ReleaseMutex, hMutex invoke DestroyWindow, hWin .elseif uMsg == WM_DESTROY invoke PostQuitMessage, NULL .else invoke DefWindowProc, hWin, uMsg, wParam, lParam ret .endif xor eax, eax ret WndProc endp Maximize proc targetHwnd : HWND LOCAL dlgRect : MYRECT .if targetHwnd != NULL invoke ShowWindow, targetHwnd, SW_MAXIMIZE invoke GetWindowRect, targetHwnd, addr dlgRect .if eax != 0 .if dlgRect.top >= 0 invoke ShowWindow, targetHwnd, SW_RESTORE invoke ShowWindow, targetHwnd, SW_MAXIMIZE .endif .endif .endif ret Maximize endp end Resizer
alloy4fun_models/trashltl/models/5/hyL5Wfa3XyZdcHj3p.als
Kaixi26/org.alloytools.alloy
0
1289
<gh_stars>0 open main pred idhyL5Wfa3XyZdcHj3p_prop6 { all f : File | f not in Trash until f in Trash } pred __repair { idhyL5Wfa3XyZdcHj3p_prop6 } check __repair { idhyL5Wfa3XyZdcHj3p_prop6 <=> prop6o }
ADL/drivers/stm32g474/stm32-cordic-interrupts.adb
JCGobbi/Nucleo-STM32G474RE
0
27356
with STM32.Device; package body STM32.CORDIC.Interrupts is ------------------------------- -- Calculate_CORDIC_Function -- ------------------------------- procedure Calculate_CORDIC_Function (This : in out CORDIC_Coprocessor; Argument : UInt32_Array; Result : out UInt32_Array) is -- Test if data width is 32 bit pragma Assert (This.CSR.ARGSIZE = True, "Invalid data size"); Operation : constant CORDIC_Function := CORDIC_Function'Val (This.CSR.FUNC); begin case Operation is when Cosine | Sine | Phase | Modulus => -- Two 32 bit arguments This.WDATA := Argument (1); This.WDATA := Argument (2); when Hyperbolic_Cosine | Hyperbolic_Sine | Arctangent | Hyperbolic_Arctangent | Natural_Logarithm | Square_Root => -- One 32 bit argument This.WDATA := Argument (1); end case; -- Get the results from the Ring Buffer case Operation is when Cosine | Sine | Phase | Modulus | Hyperbolic_Cosine | Hyperbolic_Sine => -- Two 32 bit results Receiver.Get_Result (Result (1)); Receiver.Get_Result (Result (2)); when Arctangent | Hyperbolic_Arctangent | Natural_Logarithm | Square_Root => -- One 32 bit result Receiver.Get_Result (Result (1)); end case; end Calculate_CORDIC_Function; ------------------------------- -- Calculate_CORDIC_Function -- ------------------------------- procedure Calculate_CORDIC_Function (This : in out CORDIC_Coprocessor; Argument : UInt16_Array; Result : out UInt16_Array) is -- Test if data width is 16 bit pragma Assert (This.CSR.ARGSIZE = False, "Invalid data size"); Operation : constant CORDIC_Function := CORDIC_Function'Val (This.CSR.FUNC); Data : UInt32; begin case Operation is when Cosine | Sine | Phase | Modulus => -- Two 16 bit argument Data := UInt32 (Argument (2)); Data := Shift_Left (Data, 16) or UInt32 (Argument (1)); This.WDATA := Data; when Hyperbolic_Cosine | Hyperbolic_Sine | Arctangent | Hyperbolic_Arctangent | Natural_Logarithm | Square_Root => -- One 16 bit argument This.WDATA := UInt32 (Argument (1)); end case; -- Get the results from the Ring Buffer Receiver.Get_Result (Data); case Operation is when Cosine | Sine | Phase | Modulus | Hyperbolic_Cosine | Hyperbolic_Sine => -- Two 16 bit results Result (1) := UInt16 (Data); Result (2) := UInt16 (Shift_Right (Data, 16)); when Arctangent | Hyperbolic_Arctangent | Natural_Logarithm | Square_Root => -- One 32 bit result Result (1) := UInt16 (Data); end case; end Calculate_CORDIC_Function; -------------- -- Receiver -- -------------- protected body Receiver is ---------------- -- Get_Result -- ---------------- entry Get_Result (Value : out UInt32) when Data_Available is Next : constant Integer := (Buffer.Tail + 1) mod Buffer.Content'Length; begin -- Remove an item from our ring buffer. Value := Buffer.Content (Next); Buffer.Tail := Next; -- If the buffer is empty, make sure we block subsequent callers -- until the buffer has something in it. if Buffer.Tail = Buffer.Head then Data_Available := False; end if; end Get_Result; ----------------------- -- Interrupt_Handler -- ----------------------- procedure Interrupt_Handler is use STM32.Device; begin if Interrupt_Enabled (CORDIC_Unit) then if Status (CORDIC_Unit, Flag => Result_Ready) then if (Buffer.Head + 1) mod Buffer.Content'Length = Buffer.Tail then -- But our buffer is full. raise Ring_Buffer_Full; else -- Add this first 32 bit data to our buffer. Buffer.Head := (Buffer.Head + 1) mod Buffer.Content'Length; Buffer.Content (Buffer.Head) := Get_CORDIC_Data (CORDIC_Unit); -- Test if the function has two 32 bits results if Get_CORDIC_Results_Number (CORDIC_Unit) = Two_32_Bit then if (Buffer.Head + 1) mod Buffer.Content'Length = Buffer.Tail then -- But our buffer is full. raise Ring_Buffer_Full; else -- Add this second 32 bit data to our buffer. Buffer.Head := (Buffer.Head + 1) mod Buffer.Content'Length; Buffer.Content (Buffer.Head) := Get_CORDIC_Data (CORDIC_Unit); end if; end if; Data_Available := True; end if; end if; end if; end Interrupt_Handler; end Receiver; end STM32.CORDIC.Interrupts;
src/epl-brackets.ads
OneWingedShark/Risi
1
11512
<reponame>OneWingedShark/Risi Pragma Ada_2012; Pragma Wide_Character_Encoding( UTF8 ); With Ada.Strings.UTF_Encoding.Conversions, Ada.strings.UTF_Encoding.Wide_Wide_Strings, EPL.Types; Use EPL.Types; -- Edward Parse Library. -- -- ©2015 <NAME>; All Rights Reserved. Package EPL.Brackets is Function Bracket( Data : UTF_08; Style : Types.Bracket ) return UTF_08; Function Bracket( Data : UTF_16; Style : Types.Bracket ) return UTF_16; Function Bracket( Data : UTF_32; Style : Types.Bracket ) return UTF_32; Private Item : constant Array( Types.Bracket, Side ) of Wide_Wide_Character := ( Types.Parentheses => ('(',')'), Types.Brackets => ('[',']'), Types.Braces => ('{','}'), Types.Chevrons => ('⟨','⟩'), Types.Angle => ('<','>'), Types.Corner => ('「','」') ); Function Left return Side renames Ada.Strings.Left; Function Right return Side renames Ada.Strings.Right; Use Ada.Strings.UTF_Encoding.Conversions, Ada.Strings.UTF_Encoding; Function Bracket( Data : UTF_08; Style : Types.Bracket ) return UTF_08 is ( Convert( Input_Scheme => UTF_8, Item => Bracket(Data,Style)) ); Function Bracket( Data : UTF_16; Style : Types.Bracket ) return UTF_16 is (""); Function Bracket( Data : UTF_32; Style : Types.Bracket ) return UTF_32 is ( Item(Style, Left) & Data & Item(Style, Right) ); End EPL.Brackets;
automator/open-iterm.applescript
maxrothman/config
0
4375
-- Tested using OSX 10.9.5 and iTerm 2.9 nightly builds (though it'd probably work on 2.1) on run {input, parameters} tell application "Finder" set dir_path to quoted form of (POSIX path of (the target of the front window as alias)) end tell CD_to(dir_path) end run on CD_to(q) tell application "iTerm" create window with default profile tell current session of current window write text "cd " & q & "; clear" end tell end tell end CD_to
src/test/resources/data/generationtests/sjasm-macro.asm
cpcitor/mdlz80optimizer
36
25866
; Test case: macro mymacro n and n endmacro mymacro 1 loop: jp loop
Ada/problem_10/problem_10.adb
PyllrNL/Project_Euler_Solutions
0
11661
package body Problem_10 is function Solution_1 return Int128 is Primes : P.Vector; Inc : Integer := 3; Divisible : Boolean := false; Sum : Int128 := 0; begin Primes.append(2); while Inc < 2_000_000 loop Divisible := false; for Prime of Primes loop if Inc mod Prime = 0 then Divisible := true; end if; end loop; if Divisible = false then Primes.append(Inc); end if; Inc := Inc + 2; end loop; for Prime of Primes loop Sum := Sum + Int128(Prime); end loop; return Sum; end Solution_1; function Solution_2(Limit : Integer) return Int128 is Lim : constant Int128 := Int128(Limit); Is_Prime : array( Int128 range 1 .. Lim ) of Boolean := (others => false); N : Int128 := 0; W: Int128 := 0; Sum : Int128 := 0; X,Y : Int128; begin X := 1; Y := 3; outer_step_1: loop N := (4*X*X) + 1; exit when N > Lim; case N mod 60 is when 1 | 13 | 17 | 29 | 37 | 41 | 49 | 53 => Is_Prime(N) := Is_Prime(N) xor true; when others => null; end case; Y := 3; loop N := (4*X*X) + (Y*Y); exit when N > Lim; case N mod 60 is when 1 | 13 | 17 | 29 | 37 | 41 | 49 | 53 => Is_Prime(N) := Is_Prime(N) xor true; when others => null; end case; Y := Y + 2; end loop; X := X + 1; end loop outer_step_1; X := 1; Y := 4; outer_step_2: loop N := (3*X*X) + 4; exit when N > Lim; case N mod 60 is when 7 | 19 | 31 | 43 => Is_Prime(N) := Is_Prime(N) xor true; when others => null; end case; Y := 4; loop N := (3*X*X) + (Y*Y); exit when N > Lim; case N mod 60 is when 7 | 19 | 31 | 43 => Is_Prime(N) := Is_Prime(N) xor true; when others => null; end case; Y := Y + 2; end loop; X := X + 2; end loop outer_step_2; X := 2; Y := 3; outer_step_3: loop N := (3*X*X) - (X-1)*(X-1); exit when N > Lim; case N mod 60 is when 11 | 23 | 47 | 59 => Is_Prime(N) := Is_Prime(N) xor true; when others => null; end case; Y := 3; loop N := (3*X*X) - (X-Y)*(X-Y); exit when N > Lim or (X-Y) <= 0; case N mod 60 is when 11 | 23 | 47 | 59 => Is_Prime(N) := Is_Prime(N) xor true; when others => null; end case; Y := Y + 2; end loop; X := X + 1; end loop outer_step_3; N := 3; while N <= Lim loop if Is_Prime(N) then W := N*N; while W <= Lim loop Is_Prime(W) := false; W := W + (N*N); end loop; end if; N := N + 2; end loop; Is_Prime(2) := true; Is_Prime(3) := true; Is_Prime(5) := true; for I in Is_Prime'Range loop if Is_Prime(I) then Sum := Sum + I; end if; end loop; return Sum; end Solution_2; procedure Test_Solution_1 is Solution : constant Int128 := 142913828922; begin Assert( Solution_1 = Solution ); end Test_Solution_1; procedure Test_Solution_2 is Solution : constant Int128 := 142913828922; begin Assert( Solution_2( 2_000_000 ) = Solution ); end Test_Solution_2; function Get_Solutions return Solution_Case is Ret : Solution_Case; begin Set_Name( Ret, "Problem 10"); Add_Test( Ret, Test_Solution_1'Access ); Add_Test( Ret, Test_Solution_2'Access ); return Ret; end Get_Solutions; end Problem_10;
Transynther/x86/_processed/AVXALIGN/_ht_/i9-9900K_12_0xa0.log_21829_1662.asm
ljhsiun2/medusa
9
102509
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r8 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0x1e562, %r8 nop nop nop nop nop add %rcx, %rcx mov (%r8), %rbx nop cmp $15129, %r10 lea addresses_normal_ht+0x18f4d, %rax nop nop xor $14197, %r13 vmovups (%rax), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $1, %xmm4, %rdi nop nop nop nop and %rdi, %rdi lea addresses_A_ht+0x1ec5d, %rsi lea addresses_WC_ht+0x145d, %rdi nop nop nop nop cmp $29041, %r10 mov $14, %rcx rep movsb nop nop nop and $44183, %rdi lea addresses_D_ht+0x1a35d, %rax cmp %rbx, %rbx mov $0x6162636465666768, %r10 movq %r10, %xmm4 vmovups %ymm4, (%rax) nop nop nop nop cmp $16008, %r13 lea addresses_A_ht+0x1d5a5, %rsi lea addresses_D_ht+0xae5d, %rdi nop nop nop dec %r8 mov $17, %rcx rep movsq nop nop nop nop xor $11185, %r10 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r8 push %rax push %rbp push %rcx // Faulty Load lea addresses_A+0x885d, %r13 nop nop nop nop nop and %rax, %rax vmovaps (%r13), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $1, %xmm3, %r8 lea oracles, %rbp and $0xff, %r8 shlq $12, %r8 mov (%rbp,%r8,1), %r8 pop %rcx pop %rbp pop %rax pop %r8 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': True, 'size': 32}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32}} {'src': {'same': False, 'congruent': 3, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}} {'44': 10033, '45': 11796} 45 45 45 45 45 44 45 44 44 45 44 44 45 44 45 45 44 45 44 45 45 45 44 44 45 45 44 44 45 44 45 44 45 45 45 44 45 44 44 45 45 45 44 45 44 45 44 45 45 45 44 44 44 45 45 45 45 44 45 44 44 45 45 44 45 44 45 45 45 45 44 44 45 44 44 45 45 45 45 45 45 44 45 44 45 45 44 44 44 44 45 44 44 45 45 45 45 44 44 44 45 44 44 45 45 44 44 44 44 44 44 45 45 44 44 45 44 44 44 45 45 44 44 45 45 45 45 44 45 45 45 45 44 45 45 44 44 44 44 45 45 45 45 44 45 44 44 45 44 44 44 45 44 45 44 44 45 45 45 45 45 44 44 45 44 44 44 45 44 45 45 45 44 45 44 45 44 44 44 45 45 45 44 44 45 44 45 45 44 45 45 45 45 45 44 45 45 44 44 45 44 44 44 45 45 44 45 45 44 44 44 45 44 45 44 44 44 44 45 45 44 45 44 44 44 45 45 45 44 44 45 44 45 44 44 44 45 45 44 45 44 44 44 45 44 44 44 45 44 45 44 45 45 45 45 44 44 45 45 44 44 45 45 44 44 45 44 44 45 44 45 44 44 45 45 44 45 44 45 45 45 44 45 44 44 45 45 44 44 45 45 44 45 44 44 44 44 45 44 44 45 45 44 45 44 45 44 45 44 45 45 44 45 45 44 44 44 45 44 44 44 44 45 45 45 44 44 44 45 44 45 45 45 45 45 45 45 45 45 45 44 45 44 45 45 45 44 44 45 44 45 45 45 44 44 45 45 45 45 45 45 44 45 44 45 44 45 44 45 45 44 44 44 45 45 45 45 44 45 44 45 45 44 45 45 45 44 44 45 44 45 45 45 44 45 45 44 44 45 45 44 44 45 45 44 44 45 45 44 45 44 45 44 44 44 45 45 45 44 45 45 45 45 45 44 44 45 45 45 45 44 44 44 44 45 45 44 44 44 44 45 45 44 45 44 44 45 45 44 44 44 44 44 45 45 44 44 45 44 45 44 44 45 45 45 44 44 45 45 45 45 44 45 44 45 45 44 44 45 45 44 44 45 45 45 44 44 45 45 44 45 45 44 44 45 44 44 45 44 44 44 44 44 44 44 45 45 45 45 44 44 45 45 45 45 44 45 45 44 45 44 44 45 44 45 45 45 44 45 45 45 45 44 44 45 45 45 45 45 45 44 45 44 44 44 45 45 44 44 44 44 44 45 44 44 45 45 44 45 44 44 44 45 44 45 44 45 44 44 44 44 45 45 44 44 45 44 44 44 45 44 44 45 44 44 45 45 45 44 45 44 45 44 44 45 44 44 44 44 45 45 44 44 45 44 44 45 45 45 45 45 44 44 45 45 44 45 44 45 45 45 45 44 45 44 45 45 45 45 44 45 44 45 44 44 44 45 45 44 44 45 45 45 44 44 44 45 45 44 45 45 44 45 45 45 45 44 45 44 45 44 45 45 45 45 45 45 45 44 45 44 45 44 44 45 44 44 44 44 45 45 45 44 44 45 45 45 44 45 44 44 45 45 44 45 45 45 45 44 44 44 44 44 45 44 44 45 45 45 44 44 44 44 44 45 45 45 45 45 44 45 45 45 45 45 45 44 44 44 45 45 45 45 45 45 45 45 45 45 45 44 44 44 45 44 44 45 45 44 44 45 44 45 45 44 45 45 45 45 45 45 44 44 44 44 45 45 45 45 44 45 44 45 45 45 45 45 44 45 45 45 45 44 45 44 44 45 44 44 44 44 45 44 44 45 45 45 44 44 44 44 45 44 45 45 44 44 44 45 45 44 45 44 45 44 45 45 45 44 45 44 45 45 44 44 44 45 44 44 44 45 44 44 45 45 44 45 45 45 45 44 45 44 45 45 45 45 45 45 44 44 44 44 44 45 44 44 44 45 45 45 45 44 45 44 44 45 45 45 44 44 44 44 44 44 44 45 45 44 44 45 45 45 45 44 44 45 44 45 45 45 44 45 44 44 44 45 45 45 44 44 45 45 44 45 45 45 45 45 45 45 44 45 44 45 45 45 44 44 45 45 45 45 45 44 45 45 45 45 44 44 44 45 44 44 44 45 45 44 45 44 45 45 45 44 45 44 44 44 45 44 44 45 44 44 44 44 45 44 45 45 44 45 44 44 45 45 44 45 44 45 45 45 44 44 44 45 45 44 44 44 45 44 45 45 45 45 44 44 45 45 45 45 44 45 44 45 45 44 44 */
models/tests/test48a.als
transclosure/Amalgam
4
4187
<filename>models/tests/test48a.als<gh_stars>1-10 module tests/test48a[x] sig y extends x { g: set f } // This should give a "f cannot be found" error
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_783.asm
ljhsiun2/medusa
9
9824
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r8 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0xe174, %rsi lea addresses_A_ht+0x8df4, %rdi clflush (%rsi) nop nop nop nop nop and $47863, %r13 mov $124, %rcx rep movsw nop nop nop cmp $17263, %rbp lea addresses_UC_ht+0x12354, %rsi lea addresses_UC_ht+0x2f4, %rdi nop nop nop add %r8, %r8 mov $79, %rcx rep movsq and %rcx, %rcx lea addresses_UC_ht+0x7d6a, %r8 nop nop xor %rbp, %rbp movb (%r8), %r13b nop nop nop and $58303, %rsi lea addresses_normal_ht+0x164f4, %rcx nop nop nop nop add %rbx, %rbx movups (%rcx), %xmm3 vpextrq $0, %xmm3, %r13 nop nop nop add %r13, %r13 lea addresses_normal_ht+0xbdec, %rcx clflush (%rcx) dec %rbp mov (%rcx), %r8w nop nop nop nop nop cmp $56195, %rbp lea addresses_UC_ht+0x1c353, %rsi lea addresses_normal_ht+0x11c5a, %rdi nop nop nop nop nop and $54118, %r12 mov $34, %rcx rep movsw nop nop xor $13740, %rbp lea addresses_D_ht+0x50f4, %rsi and $60428, %r12 mov $0x6162636465666768, %r13 movq %r13, %xmm0 movups %xmm0, (%rsi) nop nop nop nop nop cmp %rbp, %rbp lea addresses_UC_ht+0x82f4, %rsi lea addresses_UC_ht+0x16334, %rdi nop nop nop nop nop sub $55099, %r12 mov $105, %rcx rep movsw nop nop nop sub %r13, %r13 lea addresses_UC_ht+0x1b3b4, %r13 nop sub %rsi, %rsi movups (%r13), %xmm4 vpextrq $1, %xmm4, %rcx nop nop nop nop nop and %rbp, %rbp pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r8 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r15 push %r9 push %rax push %rcx push %rdi push %rsi // Load lea addresses_D+0x5bb4, %rsi and %r15, %r15 mov (%rsi), %r11 nop nop nop and $61237, %r15 // REPMOV lea addresses_A+0x7440, %rsi lea addresses_normal+0xe4f4, %rdi clflush (%rdi) nop nop nop nop and %r10, %r10 mov $95, %rcx rep movsl nop nop nop add $59819, %rsi // Load lea addresses_WC+0xe2f4, %rcx nop nop nop sub %r10, %r10 vmovups (%rcx), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $1, %xmm7, %r9 nop lfence // Faulty Load lea addresses_WC+0xe2f4, %rsi nop nop nop nop nop cmp %r15, %r15 mov (%rsi), %rax lea oracles, %rdi and $0xff, %rax shlq $12, %rax mov (%rdi,%rax,1), %rax pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r15 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WC', 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': True, 'size': 8, 'type': 'addresses_D', 'congruent': 5}} {'dst': {'same': False, 'congruent': 8, 'type': 'addresses_normal'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_A'}} {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WC', 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}} {'dst': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_UC_ht', 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_normal_ht', 'congruent': 8}} {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 2, 'type': 'addresses_normal_ht', 'congruent': 3}} {'dst': {'same': False, 'congruent': 0, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_UC_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_D_ht', 'congruent': 6}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_UC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_UC_ht', 'congruent': 3}} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
prototyping/Properties/Contradiction.agda
TheGreatSageEqualToHeaven/luau
1
8764
module Properties.Contradiction where data ⊥ : Set where ¬ : Set → Set ¬ A = A → ⊥ CONTRADICTION : ∀ {A : Set} → ⊥ → A CONTRADICTION ()
software/hal/hpl/STM32/drivers/ltdc/stm32-ltdc.adb
TUM-EI-RCS/StratoX
12
5207
<filename>software/hal/hpl/STM32/drivers/ltdc/stm32-ltdc.adb ------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-2016, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of STMicroelectronics nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- -- -- -- This file is based on: -- -- -- -- @file stm32f429i_discovery_lcd.c -- -- @author MCD Application Team -- -- @version V1.1.0 -- -- @date 19-June-2014 -- -- @brief This file includes the LTDC driver to control LCD display. -- -- -- -- COPYRIGHT(c) 2014 STMicroelectronics -- ------------------------------------------------------------------------------ with Ada.Interrupts.Names; with Ada.Unchecked_Conversion; with System; use System; with STM32_SVD.LTDC; use STM32_SVD.LTDC; with STM32_SVD.RCC; use STM32_SVD.RCC; package body STM32.LTDC is pragma Warnings (Off, "* is not referenced"); type LCD_Polarity is (Polarity_Active_Low, Polarity_Active_High) with Size => 1; type LCD_PC_Polarity is (Input_Pixel_Clock, Inverted_Input_Pixel_Clock) with Size => 1; pragma Warnings (On, "* is not referenced"); function To_Bool is new Ada.Unchecked_Conversion (LCD_Polarity, Boolean); function To_Bool is new Ada.Unchecked_Conversion (LCD_PC_Polarity, Boolean); -- Extracted from STM32F429x.LTDC type Layer_Type is record LCR : L1CR_Register; -- Layerx Control Register LWHPCR : L1WHPCR_Register; -- Layerx Window Horizontal Position Configuration Register LWVPCR : L1WVPCR_Register; -- Layerx Window Vertical Position Configuration Register LCKCR : L1CKCR_Register; -- Layerx Color Keying Configuration Register LPFCR : L1PFCR_Register; -- Layerx Pixel Format Configuration Register LCACR : L1CACR_Register; -- Layerx Constant Alpha Configuration Register LDCCR : L1DCCR_Register; -- Layerx Default Color Configuration Register LBFCR : L1BFCR_Register; -- Layerx Blending Factors Configuration Register Reserved_0 : Word; Reserved_1 : Word; LCFBAR : Word; -- Layerx Color Frame Buffer Address Register LCFBLR : L1CFBLR_Register; -- Layerx Color Frame Buffer Length Register LCFBLNR : L1CFBLNR_Register; -- Layerx ColorFrame Buffer Line Number Register Reserved_2 : Word; Reserved_3 : Word; Reserved_4 : Word; LCLUTWR : L1CLUTWR_Register; -- Layerx CLUT Write Register end record with Volatile; for Layer_Type use record LCR at 0 range 0 .. 31; LWHPCR at 4 range 0 .. 31; LWVPCR at 8 range 0 .. 31; LCKCR at 12 range 0 .. 31; LPFCR at 16 range 0 .. 31; LCACR at 20 range 0 .. 31; LDCCR at 24 range 0 .. 31; LBFCR at 28 range 0 .. 31; Reserved_0 at 32 range 0 .. 31; Reserved_1 at 36 range 0 .. 31; LCFBAR at 40 range 0 .. 31; LCFBLR at 44 range 0 .. 31; LCFBLNR at 48 range 0 .. 31; Reserved_2 at 52 range 0 .. 31; Reserved_3 at 56 range 0 .. 31; Reserved_4 at 60 range 0 .. 31; LCLUTWR at 64 range 0 .. 31; end record; type Layer_Access is access all Layer_Type; BF1_Constant_Alpha : constant := 2#100#; BF2_Constant_Alpha : constant := 2#101#; BF1_Pixel_Alpha : constant := 2#110#; BF2_Pixel_Alpha : constant := 2#111#; G_Layer1_Reg : aliased Layer_Type with Import, Address => LTDC_Periph.L1CR'Address; G_Layer2_Reg : aliased Layer_Type with Import, Address => LTDC_Periph.L2CR'Address; function Get_Layer (Layer : LCD_Layer) return Layer_Access; -- Retrieve the layer's registers protected Sync is -- Apply pending buffers on Vertical Sync. Caller must call Wait -- afterwards. procedure Apply_On_VSync; -- Wait for an interrupt. entry Wait; procedure Interrupt; pragma Attach_Handler (Interrupt, Ada.Interrupts.Names.LCD_TFT_Interrupt); private Not_Pending : Boolean := True; end Sync; ---------- -- Sync -- ---------- protected body Sync is ---------- -- Wait -- ---------- entry Wait when Not_Pending is begin null; end Wait; -------------------- -- Apply_On_VSync -- -------------------- procedure Apply_On_VSync is begin Not_Pending := False; -- Enable the Register Refresh interrupt LTDC_Periph.IER.RRIE := True; -- And tell the LTDC to apply the layer registers on refresh LTDC_Periph.SRCR.VBR := True; end Apply_On_VSync; --------------- -- Interrupt -- --------------- procedure Interrupt is begin if LTDC_Periph.ISR.RRIF then LTDC_Periph.IER.RRIE := False; LTDC_Periph.ICR.CRRIF := True; Not_Pending := True; end if; end Interrupt; end Sync; --------------- -- Get_Layer -- --------------- function Get_Layer (Layer : LCD_Layer) return Layer_Access is begin if Layer = Layer1 then return G_Layer1_Reg'Access; else return G_Layer2_Reg'Access; end if; end Get_Layer; ------------------- -- Reload_Config -- ------------------- procedure Reload_Config (Immediate : Boolean := False) is begin if Immediate then LTDC_Periph.SRCR.IMR := True; loop exit when not LTDC_Periph.SRCR.IMR; end loop; else Sync.Apply_On_VSync; Sync.Wait; end if; end Reload_Config; --------------------- -- Set_Layer_State -- --------------------- procedure Set_Layer_State (Layer : LCD_Layer; Enabled : Boolean) is L : constant Layer_Access := Get_Layer (Layer); begin if L.LCR.LEN /= Enabled then L.LCR.LEN := Enabled; Reload_Config (Immediate => True); end if; end Set_Layer_State; ---------------- -- Initialize -- ---------------- procedure Initialize (Width : Positive; Height : Positive; H_Sync : Natural; H_Back_Porch : Natural; H_Front_Porch : Natural; V_Sync : Natural; V_Back_Porch : Natural; V_Front_Porch : Natural; PLLSAI_N : UInt9; PLLSAI_R : UInt3; DivR : Natural) is DivR_Val : PLLSAI_DivR; begin if Initialized then return; end if; if DivR = 2 then DivR_Val := PLLSAI_DIV2; elsif DivR = 4 then DivR_Val := PLLSAI_DIV4; elsif DivR = 8 then DivR_Val := PLLSAI_DIV8; elsif DivR = 16 then DivR_Val := PLLSAI_DIV16; else raise Constraint_Error with "Invalid DivR value: 2, 4, 8, 16 allowed"; end if; Disable_PLLSAI; RCC_Periph.APB2ENR.LTDCEN := True; LTDC_Periph.GCR.VSPOL := To_Bool (Polarity_Active_Low); LTDC_Periph.GCR.HSPOL := To_Bool (Polarity_Active_Low); LTDC_Periph.GCR.DEPOL := To_Bool (Polarity_Active_Low); LTDC_Periph.GCR.PCPOL := To_Bool (Inverted_Input_Pixel_Clock); Set_PLLSAI_Factors (LCD => PLLSAI_R, VCO => PLLSAI_N, DivR => DivR_Val); Enable_PLLSAI; -- Synchronization size LTDC_Periph.SSCR := (HSW => SSCR_HSW_Field (H_Sync - 1), VSH => SSCR_VSH_Field (V_Sync - 1), others => <>); -- Accumulated Back Porch LTDC_Periph.BPCR := (AHBP => BPCR_AHBP_Field (H_Sync + H_Back_Porch - 1), AVBP => BPCR_AVBP_Field (V_Sync + V_Back_Porch - 1), others => <>); -- Accumulated Active Width/Height LTDC_Periph.AWCR := (AAW => AWCR_AAW_Field (H_Sync + H_Back_Porch + Width - 1), AAH => AWCR_AAH_Field (V_Sync + V_Back_Porch + Height - 1), others => <>); -- VTotal Width/Height LTDC_Periph.TWCR := (TOTALW => TWCR_TOTALW_Field (H_Sync + H_Back_Porch + Width + H_Front_Porch - 1), TOTALH => TWCR_TOTALH_Field (V_Sync + V_Back_Porch + Height + V_Front_Porch - 1), others => <>); -- Background color to black LTDC_Periph.BCCR.BC := 0; LTDC_Periph.GCR.LTDCEN := True; end Initialize; ----------- -- Start -- ----------- procedure Start is begin LTDC_Periph.GCR.LTDCEN := True; end Start; ---------- -- Stop -- ---------- procedure Stop is begin LTDC_Periph.GCR.LTDCEN := False; end Stop; ----------------- -- Initialized -- ----------------- function Initialized return Boolean is begin return LTDC_Periph.GCR.LTDCEN; end Initialized; ---------------- -- Layer_Init -- ---------------- procedure Layer_Init (Layer : LCD_Layer; Config : Pixel_Format; Buffer : System.Address; X, Y : Natural; W, H : Positive; Constant_Alpha : Byte := 255; BF : Blending_Factor := BF_Pixel_Alpha_X_Constant_Alpha) is L : constant Layer_Access := Get_Layer (Layer); CFBL : L1CFBLR_Register := L.LCFBLR; begin -- Horizontal start and stop = sync + Back Porch L.LWHPCR := (WHSTPOS => L1WHPCR_WHSTPOS_Field (LTDC_Periph.BPCR.AHBP) + 1 + L1WHPCR_WHSTPOS_Field (X), WHSPPOS => L1WHPCR_WHSPPOS_Field (LTDC_Periph.BPCR.AHBP) + L1WHPCR_WHSPPOS_Field (X + W), others => <>); -- Vertical start and stop L.LWVPCR := (WVSTPOS => LTDC_Periph.BPCR.AVBP + 1 + UInt11 (Y), WVSPPOS => LTDC_Periph.BPCR.AVBP + UInt11 (Y + H), others => <>); L.LPFCR.PF := Pixel_Format'Enum_Rep (Config); L.LCACR.CONSTA := Constant_Alpha; L.LDCCR := (others => 0); case BF is when BF_Constant_Alpha => L.LBFCR.BF1 := BF1_Constant_Alpha; L.LBFCR.BF2 := BF2_Constant_Alpha; when BF_Pixel_Alpha_X_Constant_Alpha => L.LBFCR.BF1 := BF1_Pixel_Alpha; L.LBFCR.BF2 := BF2_Pixel_Alpha; end case; CFBL.CFBLL := UInt13 (W * Bytes_Per_Pixel (Config)) + 3; CFBL.CFBP := UInt13 (W * Bytes_Per_Pixel (Config)); L.LCFBLR := CFBL; L.LCFBLNR.CFBLNBR := UInt11 (H); Set_Frame_Buffer (Layer, Buffer); L.LCR.LEN := True; Reload_Config (True); end Layer_Init; ---------------------- -- Set_Frame_Buffer -- ---------------------- procedure Set_Frame_Buffer (Layer : LCD_Layer; Addr : Frame_Buffer_Access) is function To_Word is new Ada.Unchecked_Conversion (Frame_Buffer_Access, Word); begin if Layer = Layer1 then LTDC_Periph.L1CFBAR := To_Word (Addr); else LTDC_Periph.L2CFBAR := To_Word (Addr); end if; end Set_Frame_Buffer; ---------------------- -- Get_Frame_Buffer -- ---------------------- function Get_Frame_Buffer (Layer : LCD_Layer) return Frame_Buffer_Access is L : constant Layer_Access := Get_Layer (Layer); function To_FBA is new Ada.Unchecked_Conversion (Word, Frame_Buffer_Access); begin return To_FBA (L.LCFBAR); end Get_Frame_Buffer; -------------------- -- Set_Background -- -------------------- procedure Set_Background (R, G, B : Byte) is RShift : constant Word := Shift_Left (Word (R), 16); GShift : constant Word := Shift_Left (Word (G), 8); begin LTDC_Periph.BCCR.BC := UInt24 (RShift) or UInt24 (GShift) or UInt24 (B); end Set_Background; end STM32.LTDC;
libsrc/_DEVELOPMENT/math/float/math48/c/sccz80/cm48_sccz80_ilogb.asm
meesokim/z88dk
0
103862
<gh_stars>0 ; int __FASTCALL__ ilogb(double x) SECTION code_fp_math48 PUBLIC cm48_sccz80_ilogb EXTERN am48_ilogb defc cm48_sccz80_ilogb = am48_ilogb
PIM/Projet/src/google_naive.adb
Hathoute/ENSEEIHT
1
27968
<reponame>Hathoute/ENSEEIHT with Ada.Unchecked_Deallocation; package body Google_Naive is procedure Initialiser(Google: out T_Google) is begin for I in 0..Taille-1 loop for J in 0..Taille-1 loop Google.G(I,J) := 0.0; end loop; end loop; end Initialiser; procedure Creer(Google: in out T_Google; Liens: in LC_Integer_Integer.T_LC) is L: array(0..Taille-1) of Integer; procedure Incrementer(Gauche: Integer; Droit: Integer) is begin if Google.G(Gauche, Droit) = 0.0 then -- Verifier si il n'existe pas plusieurs liaisons identiques. L(Gauche) := L(Gauche) + 1; Google.G(Gauche, Droit) := 1.0; end if; end Incrementer; procedure Calculer_Sortants is new LC_Integer_Integer.Pour_Chaque(Incrementer); procedure Populer(Gauche: Integer; Droit: Integer) is begin Google.G(Gauche, Droit) := 1.0/T_Precision(L(Gauche)); end Populer; procedure Populer_Liste is new LC_Integer_Integer.Pour_Chaque(Populer); begin for J in 0..Taille-1 loop L(J) := 0; end loop; Calculer_Sortants(Liens); Populer_Liste(Liens); for I in 0..Taille-1 loop for J in 0..Taille-1 loop if L(I) = 0 then Google.G(I,J) := 1.0/T_Precision(Taille); end if; Google.G(I,J) := Google.G(I,J)*Alpha + (1.0-Alpha)/T_Precision(Taille); end loop; end loop; end Creer; procedure Calculer_Rangs(Google: in T_Google; Rangs: out Vecteur_Poids.T_Vecteur) is Poids: Vecteur_Precision.T_Vecteur; Poids_Original: Vecteur_Precision.T_Vecteur; Temp: T_Precision; begin Vecteur_Precision.Initialiser(Poids, Taille); for I in 0..Taille-1 loop Vecteur_Precision.Ajouter(Poids, 1.0/T_Precision(Taille)); end loop; for tmp in 1..MaxIterations loop Vecteur_Precision.Copier(Poids_Original, Poids); for I in 0..Taille-1 loop Temp := 0.0; for J in 0..Taille-1 loop Temp := Temp + Vecteur_Precision.Valeur(Poids_Original, J)*Google.G(J,I); end loop; Vecteur_Precision.Modifier(Poids, I, Temp); end loop; Vecteur_Precision.Vider(Poids_Original); end loop; Vecteur_Poids.Initialiser(Rangs, Taille); for I in 0..Taille-1 loop Vecteur_Poids.Ajouter(Rangs, (Rang => I, Poid => T_Digits(Vecteur_Precision.Valeur(Poids, I)))); end loop; Vecteur_Precision.Vider(Poids); end Calculer_Rangs; end Google_Naive;
programs/oeis/047/A047613.asm
jmorken/loda
1
96004
<filename>programs/oeis/047/A047613.asm ; A047613: Numbers that are congruent to {1, 2, 4, 5} mod 8. ; 1,2,4,5,9,10,12,13,17,18,20,21,25,26,28,29,33,34,36,37,41,42,44,45,49,50,52,53,57,58,60,61,65,66,68,69,73,74,76,77,81,82,84,85,89,90,92,93,97,98,100,101,105,106,108,109,113,114,116,117,121,122,124,125,129,130,132,133,137,138,140,141,145,146,148,149,153,154,156,157,161,162,164,165,169,170,172,173,177,178,180,181,185,186,188,189,193,194,196,197,201,202,204,205,209,210,212,213,217,218,220,221,225,226,228,229,233,234,236,237,241,242,244,245,249,250,252,253,257,258,260,261,265,266,268,269,273,274,276,277,281,282,284,285,289,290,292,293,297,298,300,301,305,306,308,309,313,314,316,317,321,322,324,325,329,330,332,333,337,338,340,341,345,346,348,349,353,354,356,357,361,362,364,365,369,370,372,373,377,378,380,381,385,386,388,389,393,394,396,397,401,402,404,405,409,410,412,413,417,418,420,421,425,426,428,429,433,434,436,437,441,442,444,445,449,450,452,453,457,458,460,461,465,466,468,469,473,474,476,477,481,482,484,485,489,490,492,493,497,498 mov $1,$0 div $0,2 mov $2,$0 mul $0,2 gcd $2,2 add $0,$2 add $1,$0 sub $1,1
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_21829_181.asm
ljhsiun2/medusa
9
92493
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r14 push %r15 push %r8 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_D_ht+0xb86c, %r15 nop and $38206, %r8 mov (%r15), %ax nop sub $31458, %r14 lea addresses_normal_ht+0x1d668, %rdi nop nop nop nop and %r14, %r14 movups (%rdi), %xmm0 vpextrq $0, %xmm0, %r9 nop nop nop add %rdi, %rdi lea addresses_UC_ht+0x1426c, %rdi nop nop and $30970, %rax movb (%rdi), %r8b add %r9, %r9 lea addresses_D_ht+0x16414, %rsi lea addresses_WC_ht+0xbc6c, %rdi nop inc %r9 mov $10, %rcx rep movsl nop nop nop nop nop sub %r9, %r9 lea addresses_normal_ht+0x1b36c, %r9 nop sub %rsi, %rsi mov $0x6162636465666768, %r15 movq %r15, %xmm6 movups %xmm6, (%r9) nop nop nop and $43993, %r8 lea addresses_UC_ht+0xc07d, %rdi sub %r15, %r15 movl $0x61626364, (%rdi) nop and $32736, %rcx lea addresses_UC_ht+0x24bc, %rdi dec %r14 vmovups (%rdi), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $0, %xmm3, %r9 nop nop nop nop sub $23105, %rax lea addresses_WT_ht+0x4814, %rdi nop nop nop nop nop add $14195, %r9 mov $0x6162636465666768, %rax movq %rax, %xmm1 vmovups %ymm1, (%rdi) nop nop nop nop inc %r15 lea addresses_WC_ht+0x1ef6c, %rax cmp %r14, %r14 movb (%rax), %r15b nop nop nop nop cmp $24232, %rsi pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r8 pop %r15 pop %r14 ret .global s_faulty_load s_faulty_load: push %r11 push %r8 push %r9 push %rax push %rbp push %rdi push %rdx // Store lea addresses_A+0x18bac, %r11 nop nop nop nop and $30982, %rbp movw $0x5152, (%r11) nop nop nop nop nop xor %r11, %r11 // Faulty Load lea addresses_D+0x17c6c, %rax nop nop nop nop nop add %rdx, %rdx mov (%rax), %r11w lea oracles, %rdx and $0xff, %r11 shlq $12, %r11 mov (%rdx,%r11,1), %r11 pop %rdx pop %rdi pop %rbp pop %rax pop %r9 pop %r8 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_D'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_A'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_D'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 4, 'NT': True, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 5, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
Ada/client/src/corbacbsg-cbsg-helper.ads
FredPraca/distributed_cbsg
4
1232
<gh_stars>1-10 pragma Style_Checks ("NM32766"); pragma Wide_Character_Encoding (Brackets); --------------------------------------------------- -- This file has been generated automatically from -- cbsg.idl -- by IAC (IDL to Ada Compiler) 20.0w (rev. 90136cd4). --------------------------------------------------- -- NOTE: If you modify this file by hand, your -- changes will be lost when you re-run the -- IDL to Ada compiler. --------------------------------------------------- with CORBA; pragma Elaborate_All (CORBA); with CORBA.Object; package CorbaCBSG.CBSG.Helper is TC_CBSG : CORBA.TypeCode.Object; function From_Any (Item : CORBA.Any) return CorbaCBSG.CBSG.Ref; function To_Any (Item : CorbaCBSG.CBSG.Ref) return CORBA.Any; function Unchecked_To_Ref (The_Ref : CORBA.Object.Ref'Class) return CorbaCBSG.CBSG.Ref; function To_Ref (The_Ref : CORBA.Object.Ref'Class) return CorbaCBSG.CBSG.Ref; package Internals is procedure Initialize_CBSG; end Internals; end CorbaCBSG.CBSG.Helper;
Working Disassembly/General/Sprites/Mantis/Map - Mantis.asm
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
5
84604
Map_361D26: dc.w Frame_361D32-Map_361D26 dc.w Frame_361D46-Map_361D26 dc.w Frame_361D5A-Map_361D26 dc.w Frame_361D86-Map_361D26 dc.w Frame_361D9A-Map_361D26 dc.w Frame_361DA2-Map_361D26 Frame_361D32: dc.w 3 dc.b $FA, $A, 0, 9, 0, 0 dc.b $F4, $A, 0, 0,$FF,$F4 dc.b $FA, $A, 0, 9,$FF,$F8 Frame_361D46: dc.w 3 dc.b 0, $A, 0,$12, 0, 2 dc.b $F4, $A, 0, 0,$FF,$F4 dc.b 0, $A, 0,$12,$FF,$FA Frame_361D5A: dc.w 7 dc.b 2, 5, 0,$1B, 0, 7 dc.b $12, 1, 0,$1F, 0, $F dc.b $22, 4, 0,$21, 0, 7 dc.b $F4, $A, 0, 0,$FF,$F4 dc.b 2, 5, 0,$1B,$FF,$FF dc.b $12, 1, 0,$1F, 0, 7 dc.b $22, 4, 0,$21,$FF,$FF Frame_361D86: dc.w 3 dc.b $F9, $A, 0, 9, 0, 0 dc.b $F4, $A, 0, 0,$FF,$F4 dc.b $F9, $A, 0, 9,$FF,$F8 Frame_361D9A: dc.w 1 dc.b $FC, 0, 0,$23,$FF,$FC Frame_361DA2: dc.w 1 dc.b $FC, 0, 0,$24,$FF,$FC
alloy4fun_models/trashltl/models/10/kNEM75tJZxyJSo3ZY.als
Kaixi26/org.alloytools.alloy
0
4121
<reponame>Kaixi26/org.alloytools.alloy open main pred idkNEM75tJZxyJSo3ZY_prop11 { all f : File | (f not in Protected) implies (after f in Protected) } pred __repair { idkNEM75tJZxyJSo3ZY_prop11 } check __repair { idkNEM75tJZxyJSo3ZY_prop11 <=> prop11o }
aunit/aunit-test_caller.ads
btmalone/alog
0
22767
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- A U N I T . T E S T _ C A L L E R -- -- -- -- S p e c -- -- -- -- -- -- Copyright (C) 2008-2011, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT is maintained by AdaCore (http://www.adacore.com) -- -- -- ------------------------------------------------------------------------------ -- <description> -- A Test caller provides access to a test case type based on a test fixture. -- Test callers are useful when you want to run individual test or add it to -- a suite. -- Test callers invoke only one Test (i.e. test method) on one Fixture of a -- AUnit.Test_Fixtures.Test_Fixture. -- -- Here is an example: -- -- <code> -- package Math_Test is -- Type Test is new AUnit.Test_Fixtures.Test_Fixture with record -- M_Value1 : Integer; -- M_Value2 : Integer; -- end record; -- -- procedure Set_Up (T : in out Test); -- -- procedure Test_Addition (T : in out Test); -- procedure Test_Subtraction (T : in out Test); -- -- end Math_Test; -- -- function Suite return AUnit.Test_Suites.Test_Suite_Access is -- package Caller is new AUnit.Test_Caller (Math_Test.Test); -- The_Suite : AUnit.Test_Suites.Test_Suite_Access := -- new AUnit.Test_Suites.Test_Suite; -- begin -- The_Suite.Add_Test -- (Caller.Create ("Test Addition on integers", -- Math_Test.Test_Addition'Access)); -- The_Suite.Add_Test -- (Caller.Create ("Test Subtraction on integers", -- Math_Test.Test_Subtraction'Access)); -- return The_Suite; -- end Suite; -- </code> -- </description> with AUnit.Simple_Test_Cases; with AUnit.Test_Fixtures; generic type Test_Fixture is new AUnit.Test_Fixtures.Test_Fixture with private; package AUnit.Test_Caller is type Test_Case is new AUnit.Simple_Test_Cases.Test_Case with private; type Test_Case_Access is access all Test_Case'Class; type Test_Method is access procedure (Test : in out Test_Fixture); function Create (Name : String; Test : Test_Method) return Test_Case_Access; -- Return a test case from a test fixture method, reporting the result -- of the test using the Name parameter. procedure Create (TC : out Test_Case'Class; Name : String; Test : Test_Method); -- Initialize a test case from a test fixture method, reporting the result -- of the test using the Name parameter. function Name (Test : Test_Case) return Message_String; -- Test case name procedure Run_Test (Test : in out Test_Case); -- Perform the test. procedure Set_Up (Test : in out Test_Case); -- Set up performed before each test case procedure Tear_Down (Test : in out Test_Case); -- Tear down performed after each test case private type Fixture_Access is access all Test_Fixture; pragma No_Strict_Aliasing (Fixture_Access); type Test_Case is new AUnit.Simple_Test_Cases.Test_Case with record Fixture : Fixture_Access; Name : Message_String; Method : Test_Method; end record; end AUnit.Test_Caller;
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1440.asm
ljhsiun2/medusa
9
163169
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r14 push %r8 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_normal_ht+0xa61a, %r11 nop nop nop nop sub %rcx, %rcx vmovups (%r11), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $0, %xmm3, %rax nop nop nop nop nop sub $50358, %r10 lea addresses_normal_ht+0x122fa, %rbp clflush (%rbp) sub %r8, %r8 mov (%rbp), %r14 nop nop nop nop xor $13317, %r10 lea addresses_WT_ht+0x1bc12, %r8 nop and %r11, %r11 mov (%r8), %ax nop nop nop cmp $38462, %rcx lea addresses_WT_ht+0x1a4da, %rsi lea addresses_WT_ht+0x2cda, %rdi nop cmp %r10, %r10 mov $33, %rcx rep movsq nop nop nop nop nop xor %r14, %r14 lea addresses_UC_ht+0x134da, %r14 nop cmp $43182, %rbp movups (%r14), %xmm2 vpextrq $0, %xmm2, %r10 nop nop xor $28292, %rsi lea addresses_UC_ht+0xd4da, %rbp cmp $59889, %r8 movw $0x6162, (%rbp) and %rbp, %rbp lea addresses_D_ht+0x74da, %rsi lea addresses_WC_ht+0x17f9a, %rdi nop nop nop nop nop xor %r14, %r14 mov $116, %rcx rep movsw nop nop dec %rdi lea addresses_normal_ht+0xe4da, %rbp add $52101, %r14 and $0xffffffffffffffc0, %rbp movaps (%rbp), %xmm6 vpextrq $1, %xmm6, %rdi nop nop nop xor $58441, %rax lea addresses_A_ht+0x283a, %rax clflush (%rax) cmp $1185, %rsi movb (%rax), %r8b nop mfence lea addresses_normal_ht+0x1593e, %rsi lea addresses_UC_ht+0x1be80, %rdi nop nop nop cmp $45347, %r11 mov $18, %rcx rep movsq nop nop nop and $31350, %r11 lea addresses_normal_ht+0x70da, %r8 nop inc %r10 movups (%r8), %xmm6 vpextrq $0, %xmm6, %rsi nop nop nop nop nop add $17730, %r14 lea addresses_WC_ht+0x16e89, %rsi nop nop nop sub $48960, %r8 mov (%rsi), %ecx nop nop nop nop nop inc %rcx lea addresses_UC_ht+0xf80e, %rbp nop nop nop nop sub %r14, %r14 movw $0x6162, (%rbp) cmp $64943, %rax lea addresses_D_ht+0x18e2a, %r14 clflush (%r14) xor $3294, %r10 mov (%r14), %rdi nop nop dec %r14 pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r8 pop %r14 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r15 push %r8 push %r9 push %rbp push %rcx push %rsi // Load lea addresses_WT+0x1e8da, %rcx nop nop and %r9, %r9 movb (%rcx), %r12b nop cmp %r12, %r12 // Store lea addresses_normal+0x164da, %r15 nop xor %rcx, %rcx movw $0x5152, (%r15) nop nop nop nop add $5984, %r9 // Faulty Load lea addresses_UC+0x12cda, %rsi nop nop nop nop nop and $60248, %rcx movups (%rsi), %xmm6 vpextrq $0, %xmm6, %r9 lea oracles, %r12 and $0xff, %r9 shlq $12, %r9 mov (%r12,%r9,1), %r9 pop %rsi pop %rcx pop %rbp pop %r9 pop %r8 pop %r15 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'} {'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 1, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 11, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 11, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': True, 'type': 'addresses_WC_ht'}} {'src': {'congruent': 10, 'AVXalign': True, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 3, 'AVXalign': True, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
_tests/trconvert/antlr2/XQuery.g4
SKalt/Domemtech.Trash
16
6299
<filename>_tests/trconvert/antlr2/XQuery.g4<gh_stars>10-100 grammar XQuery; xpath : ( module )? EOF ; module : ( versionDecl )? ( libraryModule | mainModule ) ; versionDecl : 'xquery' 'version' STRING_LITERAL ('encoding' STRING_LITERAL)? separator ; mainModule : (xqdocComment)? prolog queryBody ; libraryModule : (xqdocComment)? moduleDecl prolog ; moduleDecl : 'module' 'namespace'ncnameOrKeyword EQstrippedStringLiteral separator ; /* * Note, the prolog production does not enforce the ordering requirements of the October * 2004 spec. This was the easiest way to handle some non-determinism problems, since we * are assuming for xqDoc that we are getting valid XQuery. */ prolog : ( ( boundarySpaceDecl | defaultCollationDecl | baseUriDecl | constructionDecl | orderingModeDecl | emptyOrderingDecl | copyNamespacesDecl | schemaImport | moduleImport | moduleImport | namespaceDecl | setterOld | varDecl | varDecl | functionDecl | functionDecl | optionDecl ) separator )* ; setter : ( ( boundarySpaceDecl | defaultCollationDecl | baseUriDecl | constructionDecl | orderingModeDecl | emptyOrderingDecl | copyNamespacesDecl ) separator ) ; setterOld : ( 'declare' 'default' ( ( 'element' 'namespace' STRING_LITERAL ) | ( 'function' 'namespace'strippedStringLiteral ) ) ) ; separator : SEMICOLON ; namespaceDecl : 'declare' 'namespace'ncnameOrKeyword EQstrippedStringLiteral ; boundarySpaceDecl : 'declare' 'boundary-space' ('preserve' | 'strip') ; optionDecl : 'declare' 'option' qName STRING_LITERAL ; orderingModeDecl : 'declare' 'ordering' ('ordered' | 'unordered') ; emptyOrderingDecl : 'declare' 'default' 'order' 'empty' ( 'greatest' | 'least' ) ; copyNamespacesDecl : 'declare' 'copy-namespaces' ('preserve' | 'no-preserve') COMMA ('inherit' | 'no-inherit' ) ; defaultCollationDecl : 'declare' 'default' 'collation' STRING_LITERAL ; baseUriDecl : 'declare' 'base-uri' STRING_LITERAL ; schemaImport : 'import' 'schema' ( schemaPrefix )? STRING_LITERAL ( 'at' STRING_LITERAL (COMMA STRING_LITERAL)*)? ; schemaPrefix : ('namespace'ncnameOrKeyword EQ) | ('default' 'element' 'namespace') ; moduleImport : (xqdocComment)? 'import' 'module' ( 'namespace'ncnameOrKeyword EQ )?strippedStringLiteral ('at'STRING_LITERAL (COMMA STRING_LITERAL)* )? ; varDecl : (xqdocComment)? 'declare' 'variable' DOLLARqName( typeDeclaration )? ( (COLON EQ exprSingle ) | 'external' ) ; constructionDecl : 'declare' 'construction' ('preserve' | 'strip') ; annotations : (annotation)* ; annotation : MODqName (LPAREN annotList RPAREN)? ; annotList : annotationParam ( COMMA annotationParam )* ; annotationParam :STRING_LITERAL ; functionDecl : (xqdocComment)? 'declare' (annotations)? 'function'qName LPAREN ( paramList )? RPAREN ( returnType )? ( functionBody | 'external' ) ; returnType : 'as' sequenceType ; functionBody : LCURLY expr RCURLY ; paramList : param ( COMMA param )* ; param : DOLLARqName ( typeDeclaration )? ; enclosedExpr : LCURLY expr RCURLY ; queryBody : expr ; expr : exprSingle ( ARROW exprSingle )* ( BANG exprSingle )* ( COMMA exprSingle ( ARROW exprSingle )* ( BANG exprSingle )* )* ; exprSingle : flworExpr | quantifiedExpr | switchExpr | typeswitchExpr | existUpdateExpr | ifExpr | tryCatchExpr | inlineFunctionExpr | orExpr ; inlineFunctionExpr : 'function' LPAREN ( paramList )? RPAREN ( returnType )? functionBody ; tryCatchExpr : 'try' LCURLY expr RCURLY 'catch' LPAREN DOLLARqName RPAREN LCURLY expr RCURLY ; existUpdateExpr : 'update' ( existReplaceExpr | existValueExpr | existInsertExpr | existDeleteExpr | existRenameExpr ) ; existReplaceExpr : 'replace' expr 'with' exprSingle ; existValueExpr : 'value' expr 'with' exprSingle ; existInsertExpr : 'insert' exprSingle ( 'into' | 'preceding' | 'following' ) exprSingle ; existDeleteExpr : 'delete' exprSingle ; existRenameExpr : 'rename' exprSingle 'as' exprSingle ; flworExpr : ( forClause | letClause )+ ( whereClause )? ( orderByClause )? 'return' exprSingle ; forClause : 'for' inVarBinding ( COMMA inVarBinding )* ; inVarBinding : DOLLARqName ( typeDeclaration )? ( positionalVar )? 'in' exprSingle ; positionalVar : 'at' DOLLARqName ; letClause : 'let' letVarBinding ( COMMA letVarBinding )* ; letVarBinding : DOLLARqName ( typeDeclaration )? COLON EQ exprSingle ( ARROW exprSingle )* ( BANG exprSingle )* ; whereClause : 'where' exprSingle ; orderByClause : ('stable')? 'order' 'by' orderSpecList ; orderSpecList : orderSpec ( COMMA orderSpec )* ; orderSpec : exprSingle orderModifier ; orderModifier : ( 'ascending' | 'descending' )? ( 'empty' ( 'greatest' | 'least' ) )? ( 'collation' STRING_LITERAL )? ; quantifiedExpr : ( 'some' | 'every' ) quantifiedInVarBinding ( COMMA quantifiedInVarBinding )* 'satisfies' exprSingle ; quantifiedInVarBinding : DOLLARqName ( typeDeclaration )? 'in' exprSingle ; switchExpr : 'switch' LPAREN expr RPAREN (switchCaseClause)+ 'default' 'return' exprSingle ; switchCaseClause : ( 'case' switchCaseOperand )+ 'return' exprSingle ; switchCaseOperand : exprSingle ; typeswitchExpr : 'typeswitch' LPAREN expr RPAREN (caseClause)+ 'default' (DOLLARqName)? 'return' exprSingle ; caseClause : 'case' (DOLLARqName 'as')? sequenceType 'return' exprSingle ; ifExpr : 'if' LPAREN expr RPAREN 'then' exprSingle ( ARROW exprSingle )* ( BANG exprSingle )* 'else' exprSingle ( ARROW exprSingle )* ( BANG exprSingle )* ; orExpr : andExpr ( 'or' andExpr )* ; andExpr : comparisonExpr ( 'and' comparisonExpr )* ; comparisonExpr : stringConcatExpr ( LT LT rangeExpr | GT GT rangeExpr | ( ( 'eq' | 'ne' | 'lt' | 'le' | 'gt' | 'ge' ) rangeExpr ) | ( ( EQ | NEQ | GT | GTEQ | LT | LTEQ ) rangeExpr ) | ( ( 'is' ) rangeExpr ) )? ; stringConcatExpr : rangeExpr ( CONCAT rangeExpr )* ; rangeExpr : additiveExpr ( 'to' additiveExpr )? ; additiveExpr : multiplicativeExpr ( ( PLUS | MINUS ) multiplicativeExpr )* ; multiplicativeExpr : unionExpr ( ( STAR | 'div' | 'idiv' | 'mod' ) unionExpr )* ; unionExpr : intersectExceptExpr ( ( 'union' | UNION ) intersectExceptExpr )* ; intersectExceptExpr : instanceofExpr ( ( 'intersect' | 'except' ) instanceofExpr )* ; instanceofExpr : treatExpr ( 'instance' 'of' sequenceType )? ; treatExpr : castableExpr ('treat' 'as' sequenceType)? ; castableExpr : castExpr ( 'castable' 'as' singleType )? ; castExpr : unaryExpr ( 'cast' 'as' singleType )? ; unaryExpr : (MINUS | PLUS)* valueExpr ; valueExpr : validateExpr | pathExpr | extensionExpr ; validateExpr : 'validate' (validationMode)? LCURLY expr RCURLY ; extensionExpr : (PRAGMA)+ LCURLY (expr)? RCURLY ; pathExpr : relativePathExpr | SLASH relativePathExpr | SLASH | DSLASH relativePathExpr ; relativePathExpr : stepExpr ( ( SLASH | DSLASH | BANG | ARROW ) stepExpr )* ; stepExpr : axisStep | filterExpr | filterExpr | filterExpr | axisStep ; axisStep : ( forwardOrReverseStep ) predicateList ; forwardOrReverseStep : forwardAxis nodeTest | reverseAxis nodeTest | abbrevStep ; abbrevStep : ( AT )? nodeTest | PARENT ; forwardAxis : forwardAxisSpecifier COLON COLON ; forwardAxisSpecifier : 'child' | 'self' | 'attribute' | 'descendant' | 'descendant-or-self' | 'following' | 'following-sibling' ; reverseAxis : reverseAxisSpecifier COLON COLON ; reverseAxisSpecifier : 'parent' | 'ancestor' | 'ancestor-or-self' | 'preceding' | 'preceding-sibling' ; nodeTest : kindTest | kindTest | kindTest | kindTest | kindTest | kindTest | kindTest | kindTest | kindTest | kindTest | kindTest | kindTest | nameTest ; nameTest : wildcard |qName ; wildcard : STAR COLONncnameOrKeyword |ncnameOrKeyword COLON STAR | // * STAR ; filterExpr : primaryExpr predicateList ; predicateList : ( predicate )* ; predicate : LPPAREN expr RPPAREN ; primaryExpr : orderedExpr | unorderedExpr | computedConstructor | computedConstructor | constructor | functionCall | contextItemExpr | parenthesizedExpr | DOLLARqName | literal ; literal : STRING_LITERAL | numericLiteral ; numericLiteral : DOUBLE_LITERAL | DECIMAL_LITERAL | INTEGER_LITERAL ; parenthesizedExpr : LPAREN ( expr )? RPAREN ; contextItemExpr : SELF ; orderedExpr : 'ordered' LCURLY expr RCURLY ; unorderedExpr : 'unordered' LCURLY expr RCURLY ; functionCall :qName LPAREN ( functionParameters )? RPAREN ; functionParameters : exprSingle ( COMMA exprSingle )* ; constructor : directConstructor | computedConstructor ; directConstructor : dirElemConstructor | dirCommentConstructor | dirPIConstructor ; dirElemConstructor : elementWithAttributes | elementWithoutAttributes ; elementWithoutAttributes : LTqName ( ( SLASH GT ) | ( GT mixedElementContent END_TAG_STARTqName GT ) ) ; elementWithAttributes : LTqName attributeList ( ( SLASH GT ) | ( GT mixedElementContent END_TAG_STARTqName GT ) ) ; mixedElementContent : ( dirElemContent )* ; dirElemContent : directConstructor | ELEMENT_CONTENT | enclosedExpr | cdataSection ; attributeList : ( attributeDef )+ ; attributeDef :qName EQ attributeValue ; attributeValue : QUOT ( quotAttrValueContent )* QUOT | APOS ( aposAttrValueContent )* APOS ; quotAttrValueContent : QUOT_ATTRIBUTE_CONTENT | attrCommonContent ; aposAttrValueContent : APOS_ATTRIBUTE_CONTENT | attrCommonContent ; attrCommonContent : LCURLY LCURLY | RCURLY RCURLY | attributeEnclosedExpr ; attributeEnclosedExpr : LCURLY expr RCURLY ; xqdocComment :XQDOC_COMMENT ; dirCommentConstructor : XML_COMMENT XML_COMMENT_END ; dirPIConstructor : XML_PI XML_PI_END ; cdataSection : XML_CDATA XML_CDATA_END ; computedConstructor : compDocConstructor | compElemConstructor | compAttrConstructor | compTextConstructor | compCommentConstructor | compPIConstructor | compArrayNodeConstructor | compObjectNodeConstructor | compNumberNodeConstructor | compBooleanNodeConstructor | compNullNodeConstructor ; compObjectNodeConstructor : 'object-node' LCURLY compObjectDecl ( COMMA compObjectDecl )* RCURLY ; compObjectDecl : exprSingle COLON exprSingle ; compArrayNodeConstructor : 'array-node' LCURLY expr RCURLY ; compNumberNodeConstructor : 'number-node' LCURLY exprSingle RCURLY ; compBooleanNodeConstructor : 'boolean-node' LCURLY exprSingle RCURLY ; compNullNodeConstructor : 'null-node' LCURLY RCURLY ; compDocConstructor : 'document' LCURLY expr RCURLY ; compElemConstructor : 'element' LCURLY expr RCURLY LCURLY (contentExpr)? RCURLY | 'element'qName LCURLY (contentExpr)? RCURLY ; contentExpr : expr ; compAttrConstructor : 'attribute' LCURLY expr RCURLY LCURLY (expr)? RCURLY | 'attribute'qName LCURLY (expr)? RCURLY ; compTextConstructor : 'text' LCURLY expr RCURLY ; compCommentConstructor : 'comment' LCURLY expr RCURLY ; compPIConstructor : 'processing-instruction' LCURLY expr RCURLY LCURLY (expr)? RCURLY | 'processing-instruction'ncnameOrKeyword LCURLY (expr)? RCURLY ; singleType : atomicType ( QUESTION )? ; typeDeclaration : 'as' sequenceType ; sequenceType : 'empty-sequence' LPAREN RPAREN | itemType ( occurrenceIndicator )? ; occurrenceIndicator : QUESTION | STAR | PLUS ; itemType : 'item' LPAREN RPAREN | kindTest | kindTest | kindTest | kindTest | kindTest | kindTest | kindTest | kindTest | kindTest | kindTest | kindTest | atomicType ; atomicType :qName ; kindTest : documentTest | elementTest | attributeTest | schemaElementTest | schemaAttributeTest | piTest | commentTest | textTest | objectTest | arrayTest | anyKindTest ; anyKindTest : 'node' LPAREN RPAREN ; documentTest : 'document-node' LPAREN (elementTest | schemaElementTest)? RPAREN ; textTest : 'text' LPAREN RPAREN ; objectTest : 'object-node' LPAREN RPAREN ; arrayTest : 'array-node' LPAREN RPAREN ; commentTest : 'comment' LPAREN RPAREN ; piTest : 'processing-instruction' LPAREN (NCNAME | STRING_LITERAL)? RPAREN ; attributeTest : 'attribute' LPAREN ( attributeNameOrWildcard (COMMAqName)? ) ? RPAREN ; attributeNameOrWildcard : STAR |qName ; schemaAttributeTest : 'schema-attribute' LPARENqName RPAREN ; elementTest : 'element' LPAREN ( elementNameOrWildcard (COMMAqName (QUESTION)?)? )? RPAREN ; elementNameOrWildcard : STAR |qName ; schemaElementTest : 'schema-element' LPARENqName RPAREN ; validationMode : 'lax' | 'strict' ; qName :ncnameOrKeyword COLONncnameOrKeyword |ncnameOrKeyword ; /* All of the literals used in this grammar can also be * part of a valid QName. We thus have to test for each * of them below. */ ncnameOrKeyword :NCNAME |reservedKeywords ; strippedStringLiteral :STRING_LITERAL ; reservedKeywords : 'ancestor' | 'ancestor-or-self' | 'and' | 'as' | 'ascending' | 'at' | 'attribute' | 'base-uri' | 'boundary-space' | 'by' | 'case' | 'cast' | 'castable' | 'catch' | 'child' | 'collation' | 'comment' | 'construction' | 'copy-namespaces' | 'declare' | 'default' | 'delete' | 'descendant' | 'descendant-or-self' | 'descending' | 'div' | 'document' | 'document-node' | 'element' | 'else' | 'empty' | 'empty-sequence' | 'encoding' | 'eq' | 'every' | 'except' | 'external' | 'following' | 'following-sibling' | 'for' | 'function' | 'ge' | 'greatest' | 'gt' | 'idiv' | 'if' | 'import' | 'in' | 'inherit' | 'insert' | 'instance' | 'intersect' | 'into' | 'is' | 'item' | 'lax' | 'le' | 'least' | 'let' | 'lt' | 'mod' | 'module' | 'namespace' | 'ne' | 'node' | 'no-inherit' | 'no-preserve' | 'of' | 'option' | 'or' | 'order' | 'ordered' | 'ordering' | 'parent' | 'preceding' | 'preceding-sibling' | 'preserve' | 'processing-instruction' | 'rename' | 'replace' | 'return' | 'satisfies' | 'schema' | 'schema-attribute' | 'schema-element' | 'self' | 'some' | 'stable' | 'strict' | 'strip' | 'text' | 'then' | 'to' | 'treat' | 'try' | 'typeswitch' | 'xquery' | 'union' | 'unordered' | 'update' | 'validate' | 'value' | 'variable' | 'version' | 'where' | 'with' ; SLASH : '/' ; DSLASH : '/' '/' ; COLON : ':' ; COMMA : ',' ; SEMICOLON : ';' ; STAR : '*' ; QUESTION : '?' ; PLUS : '+' ; MINUS : '-' ; LPPAREN : '[' ; RPPAREN : ']' ; LPAREN : '(' ; RPAREN : ')' ; SELF : '.' ; PARENT : '..' ; UNION : '|' ; AT : '@' ; DOLLAR : '$' ; ANDEQ : '&=' ; OREQ : '|=' ; EQ : '=' ; NEQ : '!=' ; GT : '>' ; GTEQ : '>=' ; QUOT : '"' ; APOS : '\''; LTEQ : '<=' ; BANG : '!'; ARROW : '=>'; MOD : '%' ; CONCAT : '||'; LT : '<' ; END_TAG_START : '</' ; LCURLY : '{' ; RCURLY : '}' ; XML_COMMENT_END : '-->' ; XML_CDATA_END : ']]>' ; XML_PI_START : '<?' ; XML_PI_END : '?>' ; LETTER : ( BASECHAR | IDEOGRAPHIC ) ; DIGITS : ( DIGIT )+ ; HEX_DIGITS : ( '0'..'9' | 'a'..'f' | 'A'..'F' )+ ; NMSTART : ( LETTER | '_' ) ; NMCHAR : ( LETTER | DIGIT | '.' | '-' | '_' | COMBINING_CHAR | EXTENDER ) ; NCNAME : NMSTART ( NMCHAR )* ; WS : ( ' ' | '\t' | '\n' | '\r' )+ ; EXPR_COMMENT : '(:' ( CHAR | ':' | EXPR_COMMENT )* ':)' ; XQDOC_COMMENT : '(:~' ( CHAR | ':' )* ':)' ; PRAGMA: '(#' WS PRAGMA_QNAME WS ( PRAGMA_CONTENT )? '#' ')' ; PRAGMA_CONTENT : ( ~( ' ' | '\t' | '\n' | '\r' ) ) ( CHAR | '#' )+ ; PRAGMA_QNAME : NCNAME ( ':' NCNAME )? ; INTEGER_LITERAL : { !(inElementContent || inAttributeContent) }? DIGITS ; DOUBLE_LITERAL : { !(inElementContent || inAttributeContent) }? ( ( '.' DIGITS ) | ( DIGITS ( '.' ( DIGIT )* )? ) ) ( 'e' | 'E' ) ( '+' | '-' )? DIGITS ; DECIMAL_LITERAL : { !(inElementContent || inAttributeContent) }? ( '.' DIGITS ) | ( DIGITS ( '.' ( DIGIT )* )? ) ; PREDEFINED_ENTITY_REF : '&' ( 'lt' | 'gt' | 'amp' | 'quot' | 'apos' ) ';' ; CHAR_REF : '&' '#' ( DIGITS | ( 'x' HEX_DIGITS ) ) ';' ; STRING_LITERAL : '"' ( PREDEFINED_ENTITY_REF | CHAR_REF | ( '"' '"' ) | ~ ( '"' | '&' ) )* '"' | '\'' ( PREDEFINED_ENTITY_REF | CHAR_REF | ( '\'' '\'' ) | ~ ( '\'' | '&' ) )* '\'' ; QUOT_ATTRIBUTE_CONTENT : ( ~( '"' | '{' | '}' | '<' ) )+ ; APOS_ATTRIBUTE_CONTENT : ( ~( '\'' | '{' | '}' | '<' ) )+ ; ELEMENT_CONTENT : ( '\t' | '\r' | '\n' | '\u0020'..'\u003b' | '\u003d'..'\u007a' | '\u007c' | '\u007e'..'\uFFFD' )+ ; XML_COMMENT : '<!--' ( ~ ( '-' ) | '-' )+ ; XML_CDATA : '<![CDATA[' ( ~ ( ']' ) | ']' )+ ; XML_PI : XML_PI_START NCNAME ' ' ( ~ ( '?' ) | '?' )+ ; /** * Main method that decides which token to return next. * We need this as many things depend on the current * context. */ NEXT_TOKEN : XML_COMMENT | XML_CDATA | XML_PI | END_TAG_START | LT | LTEQ | LCURLY | RCURLY | { inAttributeContent && attrDelimChar == '"' }? QUOT_ATTRIBUTE_CONTENT | { inAttributeContent && attrDelimChar == '\'' }? APOS_ATTRIBUTE_CONTENT | { !(parseStringLiterals || inElementContent) }? QUOT | { !(parseStringLiterals || inElementContent) }? APOS | { inElementContent }? ELEMENT_CONTENT | WS | PRAGMA | XQDOC_COMMENT | EXPR_COMMENT |NCNAME | { parseStringLiterals }? STRING_LITERAL | { !(inAttributeContent || inElementContent) }? PARENT | DECIMAL_LITERAL | DECIMAL_LITERAL | SELF | DOUBLE_LITERAL | DECIMAL_LITERAL | INTEGER_LITERAL | SLASH | { !(inAttributeContent || inElementContent) }? DSLASH | COLON | COMMA | BANG | ARROW | CONCAT | MOD | SEMICOLON | STAR | QUESTION | PLUS | MINUS | LPPAREN | RPPAREN | LPAREN | RPAREN | UNION | AT | DOLLAR | { !(inAttributeContent || inElementContent) }? OREQ | { !(inAttributeContent || inElementContent) }? ANDEQ | EQ | { !(inAttributeContent || inElementContent) }? NEQ | XML_COMMENT_END | XML_CDATA_END | GT | { !(inAttributeContent || inElementContent) }? GTEQ | XML_PI_END ; CHAR : ( '\t' | '\n' | '\r' | '\u0020'..'\u0039' | '\u003B'..'\uD7FF' | '\uE000'..'\uFFFD' ) ; BASECHAR : ( '\u0041'..'\u005a' | '\u0061'..'\u007a' | '\u00c0'..'\u00d6' | '\u00d8'..'\u00f6' | '\u00f8'..'\u00ff' | '\u0100'..'\u0131' | '\u0134'..'\u013e' | '\u0141'..'\u0148' | '\u014a'..'\u017e' | '\u0180'..'\u01c3' | '\u01cd'..'\u01f0' | '\u01f4'..'\u01f5' | '\u01fa'..'\u0217' | '\u0250'..'\u02a8' | '\u02bb'..'\u02c1' | '\u0386' | '\u0388'..'\u038a' | '\u038c' | '\u038e'..'\u03a1' | '\u03a3'..'\u03ce' | '\u03d0'..'\u03d6' | '\u03da' | '\u03dc' | '\u03de' | '\u03e0' | '\u03e2'..'\u03f3' | '\u0401'..'\u040c' | '\u040e'..'\u044f' | '\u0451'..'\u045c' | '\u045e'..'\u0481' | '\u0490'..'\u04c4' | '\u04c7'..'\u04c8' | '\u04cb'..'\u04cc' | '\u04d0'..'\u04eb' | '\u04ee'..'\u04f5' | '\u04f8'..'\u04f9' | '\u0531'..'\u0556' | '\u0559' | '\u0561'..'\u0586' | '\u05d0'..'\u05ea' | '\u05f0'..'\u05f2' | '\u0621'..'\u063a' | '\u0641'..'\u064a' | '\u0671'..'\u06b7' | '\u06ba'..'\u06be' | '\u06c0'..'\u06ce' | '\u06d0'..'\u06d3' | '\u06d5' | '\u06e5'..'\u06e6' | '\u0905'..'\u0939' | '\u093d' | '\u0958'..'\u0961' | '\u0985'..'\u098c' | '\u098f'..'\u0990' | '\u0993'..'\u09a8' | '\u09aa'..'\u09b0' | '\u09b2' | '\u09b6'..'\u09b9' | '\u09dc'..'\u09dd' | '\u09df'..'\u09e1' | '\u09f0'..'\u09f1' | '\u0a05'..'\u0a0a' | '\u0a0f'..'\u0a10' | '\u0a13'..'\u0a28' | '\u0a2a'..'\u0a30' | '\u0a32'..'\u0a33' | '\u0a35'..'\u0a36' | '\u0a38'..'\u0a39' | '\u0a59'..'\u0a5c' | '\u0a5e' | '\u0a72'..'\u0a74' | '\u0a85'..'\u0a8b' | '\u0a8d' | '\u0a8f'..'\u0a91' | '\u0a93'..'\u0aa8' | '\u0aaa'..'\u0ab0' | '\u0ab2'..'\u0ab3' | '\u0ab5'..'\u0ab9' | '\u0abd' | '\u0ae0' | '\u0b05'..'\u0b0c' | '\u0b0f'..'\u0b10' | '\u0b13'..'\u0b28' | '\u0b2a'..'\u0b30' | '\u0b32'..'\u0b33' | '\u0b36'..'\u0b39' | '\u0b3d' | '\u0b5c'..'\u0b5d' | '\u0b5f'..'\u0b61' | '\u0b85'..'\u0b8a' | '\u0b8e'..'\u0b90' | '\u0b92'..'\u0b95' | '\u0b99'..'\u0b9a' | '\u0b9c' | '\u0b9e'..'\u0b9f' | '\u0ba3'..'\u0ba4' | '\u0ba8'..'\u0baa' | '\u0bae'..'\u0bb5' | '\u0bb7'..'\u0bb9' | '\u0c05'..'\u0c0c' | '\u0c0e'..'\u0c10' | '\u0c12'..'\u0c28' | '\u0c2a'..'\u0c33' | '\u0c35'..'\u0c39' | '\u0c60'..'\u0c61' | '\u0c85'..'\u0c8c' | '\u0c8e'..'\u0c90' | '\u0c92'..'\u0ca8' | '\u0caa'..'\u0cb3' | '\u0cb5'..'\u0cb9' | '\u0cde' | '\u0ce0'..'\u0ce1' | '\u0d05'..'\u0d0c' | '\u0d0e'..'\u0d10' | '\u0d12'..'\u0d28' | '\u0d2a'..'\u0d39' | '\u0d60'..'\u0d61' | '\u0e01'..'\u0e2e' | '\u0e30' | '\u0e32'..'\u0e33' | '\u0e40'..'\u0e45' | '\u0e81'..'\u0e82' | '\u0e84' | '\u0e87'..'\u0e88' | '\u0e8a' | '\u0e8d' | '\u0e94'..'\u0e97' | '\u0e99'..'\u0e9f' | '\u0ea1'..'\u0ea3' | '\u0ea5' | '\u0ea7' | '\u0eaa'..'\u0eab' | '\u0ead'..'\u0eae' | '\u0eb0' | '\u0eb2'..'\u0eb3' | '\u0ebd' | '\u0ec0'..'\u0ec4' | '\u0f40'..'\u0f47' | '\u0f49'..'\u0f69' | '\u10a0'..'\u10c5' | '\u10d0'..'\u10f6' | '\u1100' | '\u1102'..'\u1103' | '\u1105'..'\u1107' | '\u1109' | '\u110b'..'\u110c' | '\u110e'..'\u1112' | '\u113c' | '\u113e' | '\u1140' | '\u114c' | '\u114e' | '\u1150' | '\u1154'..'\u1155' | '\u1159' | '\u115f'..'\u1161' | '\u1163' | '\u1165' | '\u1167' | '\u1169' | '\u116d'..'\u116e' | '\u1172'..'\u1173' | '\u1175' | '\u119e' | '\u11a8' | '\u11ab' | '\u11ae'..'\u11af' | '\u11b7'..'\u11b8' | '\u11ba' | '\u11bc'..'\u11c2' | '\u11eb' | '\u11f0' | '\u11f9' | '\u1e00'..'\u1e9b' | '\u1ea0'..'\u1ef9' | '\u1f00'..'\u1f15' | '\u1f18'..'\u1f1d' | '\u1f20'..'\u1f45' | '\u1f48'..'\u1f4d' | '\u1f50'..'\u1f57' | '\u1f59' | '\u1f5b' | '\u1f5d' | '\u1f5f'..'\u1f7d' | '\u1f80'..'\u1fb4' | '\u1fb6'..'\u1fbc' | '\u1fbe' | '\u1fc2'..'\u1fc4' | '\u1fc6'..'\u1fcc' | '\u1fd0'..'\u1fd3' | '\u1fd6'..'\u1fdb' | '\u1fe0'..'\u1fec' | '\u1ff2'..'\u1ff4' | '\u1ff6'..'\u1ffc' | '\u2126' | '\u212a'..'\u212b' | '\u212e' | '\u2180'..'\u2182' | '\u3041'..'\u3094' | '\u30a1'..'\u30fa' | '\u3105'..'\u312c' | '\uac00'..'\ud7a3' ) ; IDEOGRAPHIC : ( '\u4e00'..'\u9fa5' | '\u3007' | '\u3021'..'\u3029' ) ; COMBINING_CHAR : ( '\u0300'..'\u0345' | '\u0360'..'\u0361' | '\u0483'..'\u0486' | '\u0591'..'\u05a1' | '\u05a3'..'\u05b9' | '\u05bb'..'\u05bd' | '\u05bf' | '\u05c1'..'\u05c2' | '\u05c4' | '\u064b'..'\u0652' | '\u0670' | '\u06d6'..'\u06dc' | '\u06dd'..'\u06df' | '\u06e0'..'\u06e4' | '\u06e7'..'\u06e8' | '\u06ea'..'\u06ed' | '\u0901'..'\u0903' | '\u093c' | '\u093e'..'\u094c' | '\u094d' | '\u0951'..'\u0954' | '\u0962'..'\u0963' | '\u0981'..'\u0983' | '\u09bc' | '\u09be' | '\u09bf' | '\u09c0'..'\u09c4' | '\u09c7'..'\u09c8' | '\u09cb'..'\u09cd' | '\u09d7' | '\u09e2'..'\u09e3' | '\u0a02' | '\u0a3c' | '\u0a3e' | '\u0a3f' | '\u0a40'..'\u0a42' | '\u0a47'..'\u0a48' | '\u0a4b'..'\u0a4d' | '\u0a70'..'\u0a71' | '\u0a81'..'\u0a83' | '\u0abc' | '\u0abe'..'\u0ac5' | '\u0ac7'..'\u0ac9' | '\u0acb'..'\u0acd' | '\u0b01'..'\u0b03' | '\u0b3c' | '\u0b3e'..'\u0b43' | '\u0b47'..'\u0b48' | '\u0b4b'..'\u0b4d' | '\u0b56'..'\u0b57' | '\u0b82'..'\u0b83' | '\u0bbe'..'\u0bc2' | '\u0bc6'..'\u0bc8' | '\u0bca'..'\u0bcd' | '\u0bd7' | '\u0c01'..'\u0c03' | '\u0c3e'..'\u0c44' | '\u0c46'..'\u0c48' | '\u0c4a'..'\u0c4d' | '\u0c55'..'\u0c56' | '\u0c82'..'\u0c83' | '\u0cbe'..'\u0cc4' | '\u0cc6'..'\u0cc8' | '\u0cca'..'\u0ccd' | '\u0cd5'..'\u0cd6' | '\u0d02'..'\u0d03' | '\u0d3e'..'\u0d43' | '\u0d46'..'\u0d48' | '\u0d4a'..'\u0d4d' | '\u0d57' | '\u0e31' | '\u0e34'..'\u0e3a' | '\u0e47'..'\u0e4e' | '\u0eb1' | '\u0eb4'..'\u0eb9' | '\u0ebb'..'\u0ebc' | '\u0ec8'..'\u0ecd' | '\u0f18'..'\u0f19' | '\u0f35' | '\u0f37' | '\u0f39' | '\u0f3e' | '\u0f3f' | '\u0f71'..'\u0f84' | '\u0f86'..'\u0f8b' | '\u0f90'..'\u0f95' | '\u0f97' | '\u0f99'..'\u0fad' | '\u0fb1'..'\u0fb7' | '\u0fb9' | '\u20d0'..'\u20dc' | '\u20e1' | '\u302a'..'\u302f' | '\u3099' | '\u309a' ) ; DIGIT : ( '\u0030'..'\u0039' | '\u0660'..'\u0669' | '\u06f0'..'\u06f9' | '\u0966'..'\u096f' | '\u09e6'..'\u09ef' | '\u0a66'..'\u0a6f' | '\u0ae6'..'\u0aef' | '\u0b66'..'\u0b6f' | '\u0be7'..'\u0bef' | '\u0c66'..'\u0c6f' | '\u0ce6'..'\u0cef' | '\u0d66'..'\u0d6f' | '\u0e50'..'\u0e59' | '\u0ed0'..'\u0ed9' | '\u0f20'..'\u0f29' ) ; EXTENDER : ( '\u00b7' | '\u02d0' | '\u02d1' | '\u0387' | '\u0640' | '\u0e46' | '\u0ec6' | '\u3005' | '\u3031'..'\u3035' | '\u309d'..'\u309e' | '\u30fc'..'\u30fe' ) ;
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/protected_self_ref2.adb
best08618/asylo
7
17968
-- { dg-do compile } procedure Protected_Self_Ref2 is protected type P is procedure Foo; end P; protected body P is procedure Foo is D : Integer; begin D := P'Digits; -- { dg-error "denotes current instance" } end; end P; begin null; end Protected_Self_Ref2;
src/ada/src/services/atbb/assignment_tree_branch_bound.adb
VVCAS-Sean/OpenUxAS
88
11959
<reponame>VVCAS-Sean/OpenUxAS<gh_stars>10-100 with Ada.Containers; use Ada.Containers; with Ada.Containers.Formal_Ordered_Maps; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings; use Ada.Strings; with Ada.Text_IO; use Ada.Text_IO; with Algebra; use Algebra; with Bounded_Stack; with Int64_Parsing; use Int64_Parsing; package body Assignment_Tree_Branch_Bound with SPARK_Mode is --------------------------------------------------- -- Types used in the computation of the solution -- --------------------------------------------------- type VehicleAssignmentCost is record TotalTime : Int64; Last_TaskOption : TaskOption; end record with Predicate => TotalTime >= 0; package Int64_VehicleAssignmentCost_Maps is new Ada.Containers.Formal_Hashed_Maps (Key_Type => Int64, Element_Type => VehicleAssignmentCost, Hash => Int64_Hash); use Int64_VehicleAssignmentCost_Maps; subtype Int64_VAC_Map is Int64_VehicleAssignmentCost_Maps.Map (10, Int64_VehicleAssignmentCost_Maps.Default_Modulus (10)); package Int64_VehicleAssignmentCost_Maps_P renames Int64_VehicleAssignmentCost_Maps.Formal_Model.P; package Int64_VehicleAssignmentCost_Maps_K renames Int64_VehicleAssignmentCost_Maps.Formal_Model.K; use Int64_VehicleAssignmentCost_Maps.Formal_Model; type Assignment_Info is record Assignment_Sequence : TaskAssignment_Sequence; Vehicle_Assignments : Int64_VAC_Map; end record; package Assignment_Stack is new Bounded_Stack (Assignment_Info); type Stack is new Assignment_Stack.Stack; type Children_Arr is array (Positive range <>) of Assignment_Info; package Int64_Unbounded_String_Maps is new Ada.Containers.Functional_Maps (Key_Type => Int64, Element_Type => Unbounded_String); type Int64_Unbounded_String_Map is new Int64_Unbounded_String_Maps.Map; ----------------------- -- Local subprograms -- ----------------------- function Children (Assignment : Assignment_Info; Algebra : not null access constant Algebra_Tree_Cell; Automation_Request : UniqueAutomationRequest; TaskPlanOptions_Map : Int64_TPO_Map; Assignment_Cost_Matrix : AssignmentCostMatrix) return Children_Arr with Pre => Valid_AssignmentCostMatrix (Assignment_Cost_Matrix) and then Valid_TaskPlanOptions (TaskPlanOptions_Map) and then Valid_Assignment (Assignment, TaskPlanOptions_Map, Automation_Request) and then All_Actions_In_Map (Algebra, TaskPlanOptions_Map) and then All_EligibleEntities_In_EntityList (Automation_Request, TaskPlanOptions_Map) and then All_Travels_In_CostMatrix (Automation_Request, TaskPlanOptions_Map, Assignment_Cost_Matrix), Post => (for all Child of Children'Result => Valid_Assignment (Child, TaskPlanOptions_Map, Automation_Request)); -- Returns a sequence of Elements corresponding to all the possible -- assignments considering Assignment. function Corresponding_TaskOption (TaskPlanOptions_Map : Int64_TPO_Map; TaskOptionId : Int64) return TaskOption with Pre => Valid_TaskPlanOptions (TaskPlanOptions_Map) and then TaskOptionId in 0 .. 9_999_999_999 and then TaskOptionId_In_Map (TaskOptionId, TaskPlanOptions_Map), Post => (for some TaskId of TaskPlanOptions_Map => (for some Option of Get (TaskPlanOptions_Map, TaskId).Options => Corresponding_TaskOption'Result = Option)) and then Corresponding_TaskOption'Result.TaskID = Get_TaskID (TaskOptionId) and then Corresponding_TaskOption'Result.OptionID = Get_OptionID (TaskOptionId) and then Get_TaskOptionID (Corresponding_TaskOption'Result.TaskID, Corresponding_TaskOption'Result.OptionID) = TaskOptionId and then Corresponding_TaskOption'Result.Cost >= 0; -- Returns the TaskOption corresponding to TaskOptionId in TaskPlanOptions_Map function Corresponding_TaskOptionCost (Assignment_Cost_Matrix : AssignmentCostMatrix; VehicleId : Int64; DestTaskOption : TaskOption) return TaskOptionCost with Pre => Valid_AssignmentCostMatrix (Assignment_Cost_Matrix) and then Travel_In_CostMatrix (VehicleId, DestTaskOption, Assignment_Cost_Matrix), Post => VehicleId = Corresponding_TaskOptionCost'Result.VehicleID and then 0 = Corresponding_TaskOptionCost'Result.InitialTaskID and then 0 = Corresponding_TaskOptionCost'Result.InitialTaskOption and then DestTaskOption.TaskID = Corresponding_TaskOptionCost'Result.DestinationTaskID and then DestTaskOption.OptionID = Corresponding_TaskOptionCost'Result.DestinationTaskOption and then Corresponding_TaskOptionCost'Result.TimeToGo >= 0; function Corresponding_TaskOptionCost (Assignment_Cost_Matrix : AssignmentCostMatrix; VehicleId : Int64; InitTaskOption, DestTaskOption : TaskOption) return TaskOptionCost with Pre => Valid_AssignmentCostMatrix (Assignment_Cost_Matrix) and then Travel_In_CostMatrix (VehicleId, InitTaskOption, DestTaskOption, Assignment_Cost_Matrix), Post => VehicleId = Corresponding_TaskOptionCost'Result.VehicleID and then InitTaskOption.TaskID = Corresponding_TaskOptionCost'Result.InitialTaskID and then InitTaskOption.OptionID = Corresponding_TaskOptionCost'Result.InitialTaskOption and then DestTaskOption.TaskID = Corresponding_TaskOptionCost'Result.DestinationTaskID and then DestTaskOption.OptionID = Corresponding_TaskOptionCost'Result.DestinationTaskOption and then Corresponding_TaskOptionCost'Result.TimeToGo >= 0; -- Returns the TaskOptionCost corresponding to VehicleId going from -- InitTaskOptionId to DestTaskOptionId. function Cost (Assignment : Assignment_Info; Cost_Function : Cost_Function_Kind) return Int64; -- Returns the cost of an assignment. This function can be expanded to -- support other cost functions. procedure Initialize_Algebra (Automation_Request : UniqueAutomationRequest; TaskPlanOptions_Map : Int64_TPO_Map; Algebra : out Algebra_Tree; Error : out Boolean; Message : out Unbounded_String) with Post => (if not Error then Algebra /= null and then All_Actions_In_Map (Algebra, TaskPlanOptions_Map)); -- Returns the algebra tree corresponding to the formulas stored in -- Automation_Request and the several TaskPlanOptions. function New_Assignment (Assignment : Assignment_Info; VehicleId : Int64; TaskOpt : TaskOption; Assignment_Cost_Matrix : AssignmentCostMatrix; TaskPlanOptions_Map : Int64_TPO_Map; Automation_Request : UniqueAutomationRequest) return Assignment_Info with Pre => Valid_AssignmentCostMatrix (Assignment_Cost_Matrix) and then Valid_TaskPlanOptions (TaskPlanOptions_Map) and then Valid_Assignment (Assignment, TaskPlanOptions_Map, Automation_Request) and then TaskOpt.TaskID in 0 .. 99_999 and then TaskOpt.OptionID in 0 .. 99_999 and then (for some TOC of Assignment_Cost_Matrix.CostMatrix => TOC.VehicleID = VehicleId) and then (for some TaskId of TaskPlanOptions_Map => (for some Option of Get (TaskPlanOptions_Map, TaskId).Options => (TaskOpt = Option and then Is_Eligible (Automation_Request, TaskOpt, VehicleId)))) and then (if Contains (Assignment.Vehicle_Assignments, VehicleId) then Travel_In_CostMatrix (VehicleId, Element (Assignment.Vehicle_Assignments, VehicleId).Last_TaskOption, TaskOpt, Assignment_Cost_Matrix) else Travel_In_CostMatrix (VehicleId, TaskOpt, Assignment_Cost_Matrix)), Post => Valid_Assignment (New_Assignment'Result, TaskPlanOptions_Map, Automation_Request); -- This function returns a new Element. It assigns the TaskOptionId to -- VehicleId in the enclosing assignment, and computes the new totalTime -- of VehicleId. ----------------------- -- Ghost subprograms -- ----------------------- function All_Actions_In_Map (Algebra : not null access constant Algebra_Tree_Cell; TaskPlanOptions_Map : Int64_TPO_Map) return Boolean with Ghost; pragma Annotate (GNATprove, Terminating, All_Actions_In_Map); function TaskOptionId_In_Map (TaskOptionId : Int64; TaskPlanOptions_Map : Int64_TPO_Map) return Boolean with Ghost, Pre => TaskOptionId in 0 .. 9_999_999_999; function Valid_Assignment (Assignment : Assignment_Info; TaskPlanOptions_Map : Int64_TPO_Map; Automation_Request : UniqueAutomationRequest) return Boolean with Ghost, Pre => Valid_TaskPlanOptions (TaskPlanOptions_Map); ------------------------ -- Useful subprograms -- ------------------------ function Contains_Corresponding_TaskOption (Assignment_Sequence : TaskAssignment_Sequence; TaskOpt : TaskOption) return Boolean is (for some TaskAssignment of Assignment_Sequence => (TaskAssignment.TaskID = TaskOpt.TaskID and then TaskAssignment.OptionID = TaskOpt.OptionID)); function Has_Corresponding_Option (Automation_Request : UniqueAutomationRequest; Options : TaskOption_Seq; TaskOpt : TaskOption; EntityId : Int64) return Boolean is (for some Option of Options => (Option = TaskOpt and then Is_Eligible (Automation_Request, TaskOpt, EntityId))); function Contains_Corresponding_TaskOption (Automation_Request : UniqueAutomationRequest; TaskPlanOptions_Map : Int64_TPO_Map; TaskOpt : TaskOption; EntityId : Int64) return Boolean is (for some TaskID of TaskPlanOptions_Map => (Has_Corresponding_Option (Automation_Request, Get (TaskPlanOptions_Map, TaskID).Options, TaskOpt, EntityId))); procedure Equal_TaskOpt_Lemma (Automation_Request : UniqueAutomationRequest; TaskPlanOptions_Map : Int64_TPO_Map; TaskOpt_1, TaskOpt_2 : TaskOption; EntityId : Int64) with Ghost, Pre => Contains_Corresponding_TaskOption (Automation_Request, TaskPlanOptions_Map, TaskOpt_1, EntityId) and then TaskOpt_1 = TaskOpt_2, Post => Contains_Corresponding_TaskOption (Automation_Request, TaskPlanOptions_Map, TaskOpt_2, EntityId); procedure Equal_TaskOpt_Lemma (Automation_Request : UniqueAutomationRequest; TaskPlanOptions_Map : Int64_TPO_Map; TaskOpt_1, TaskOpt_2 : TaskOption; EntityId : Int64) is null; ------------------------ -- All_Actions_In_Map -- ------------------------ function All_Actions_In_Map (Algebra : not null access constant Algebra_Tree_Cell; TaskPlanOptions_Map : Int64_TPO_Map) return Boolean is (case Algebra.all.Node_Kind is when Action => Algebra.all.TaskOptionId in 0 .. 9_999_999_999 and then TaskOptionId_In_Map (Algebra.all.TaskOptionId, TaskPlanOptions_Map), when Operator => (for all J in 1 .. Algebra.all.Collection.Num_Children => (All_Actions_In_Map (Algebra.all.Collection.Children (J), TaskPlanOptions_Map))), when Undefined => False); ---------------------------- -- Check_Assignment_Ready -- ---------------------------- procedure Check_Assignment_Ready (Mailbox : in out Assignment_Tree_Branch_Bound_Mailbox; Data : Assignment_Tree_Branch_Bound_Configuration_Data; State : in out Assignment_Tree_Branch_Bound_State; ReqId : Int64) is begin if not Contains (State.m_uniqueAutomationRequests, ReqId) or else not Contains (State.m_assignmentCostMatrixes, ReqId) or else not Contains (State.m_taskPlanOptions, ReqId) or else (for some TaskId of Element (State.m_uniqueAutomationRequests, ReqId).TaskList => not Has_Key (Element (State.m_taskPlanOptions, ReqId), TaskId)) then return; end if; Send_TaskAssignmentSummary (Mailbox, Data, State, ReqId); end Check_Assignment_Ready; -------------- -- Children -- -------------- function Children (Assignment : Assignment_Info; Algebra : not null access constant Algebra_Tree_Cell; Automation_Request : UniqueAutomationRequest; TaskPlanOptions_Map : Int64_TPO_Map; Assignment_Cost_Matrix : AssignmentCostMatrix) return Children_Arr is procedure Prove_TaskOpt_Different_From_Last_TaskOption (EntityId : Int64; TaskOpt : TaskOption) with Ghost, Pre => Valid_TaskPlanOptions (TaskPlanOptions_Map) and then Valid_Assignment (Assignment, TaskPlanOptions_Map, Automation_Request) and then TaskOpt.TaskID in 0 .. 99_999 and then TaskOpt.OptionID in 0 .. 99_999 and then not Contains (To_Sequence_Of_TaskOptionId (Assignment), TO_Sequences.First, Last (To_Sequence_Of_TaskOptionId (Assignment)), Get_TaskOptionID (TaskOpt.TaskID, TaskOpt.OptionID)), Post => (if Contains (Assignment.Vehicle_Assignments, EntityId) then (TaskOpt /= Element (Assignment.Vehicle_Assignments, EntityId).Last_TaskOption and then (for some TaskId of TaskPlanOptions_Map => (for some Option of Get (TaskPlanOptions_Map, TaskId).Options => (Option = Element (Assignment.Vehicle_Assignments, EntityId).Last_TaskOption and then Is_Eligible (Automation_Request, Element (Assignment.Vehicle_Assignments, EntityId).Last_TaskOption, EntityId)))))); procedure Prove_TaskOptionId_In_Map (ID : Int64; Alg : not null access constant Algebra_Tree_Cell) with Ghost, Pre => Is_Present (Alg, ID) and then All_Actions_In_Map (Alg, TaskPlanOptions_Map), Post => ID in 0 .. 9_999_999_999 and then TaskOptionId_In_Map (ID, TaskPlanOptions_Map); pragma Annotate (GNATprove, Terminating, Prove_TaskOptionId_In_Map); procedure Prove_Travel_In_CostMatrix (EntityId : Int64; TaskOpt : TaskOption) with Ghost, Pre => All_Travels_In_CostMatrix (Automation_Request, TaskPlanOptions_Map, Assignment_Cost_Matrix) and then (for some TaskId of TaskPlanOptions_Map => (for some Option of Get (TaskPlanOptions_Map, TaskId).Options => (TaskOpt = Option and then Is_Eligible (Automation_Request, TaskOpt, EntityId)))) and then Contains (Automation_Request.EntityList, TO_Sequences.First, Last (Automation_Request.EntityList), EntityId) and then Valid_TaskPlanOptions (TaskPlanOptions_Map) and then (if Contains (Assignment.Vehicle_Assignments, EntityId) then (TaskOpt /= Element (Assignment.Vehicle_Assignments, EntityId).Last_TaskOption and then (for some TaskId of TaskPlanOptions_Map => (for some Option of Get (TaskPlanOptions_Map, TaskId).Options => (Option = Element (Assignment.Vehicle_Assignments, EntityId).Last_TaskOption and then Is_Eligible (Automation_Request, Element (Assignment.Vehicle_Assignments, EntityId).Last_TaskOption, EntityId)))))), Post => (if not Contains (Assignment.Vehicle_Assignments, EntityId) then Travel_In_CostMatrix (EntityId, TaskOpt, Assignment_Cost_Matrix) else Travel_In_CostMatrix (EntityId, Element (Assignment.Vehicle_Assignments, EntityId).Last_TaskOption, TaskOpt, Assignment_Cost_Matrix)); function To_Sequence_Of_TaskOptionId (Assignment : Assignment_Info) return Int64_Seq with Pre => (for all TaskAssignment of Assignment.Assignment_Sequence => (TaskAssignment.TaskID in 0 .. 99_999 and then TaskAssignment.OptionID in 0 .. 99_999)), Post => (for all TaskAssignment of Assignment.Assignment_Sequence => (for some TaskOptionId of To_Sequence_Of_TaskOptionId'Result => (Get_TaskOptionID (TaskAssignment.TaskID, TaskAssignment.OptionID) = TaskOptionId))); -------------------------------------------------- -- Prove_TaskOpt_Different_From_Last_TaskOption -- -------------------------------------------------- procedure Prove_TaskOpt_Different_From_Last_TaskOption (EntityId : Int64; TaskOpt : TaskOption) is begin if Contains (Assignment.Vehicle_Assignments, EntityId) then declare Last_TaskOption : constant TaskOption := Element (Assignment.Vehicle_Assignments, EntityId).Last_TaskOption; begin pragma Assert (for some TaskId of TaskPlanOptions_Map => (for some Option of Get (TaskPlanOptions_Map, TaskId).Options => (Option = Element (Assignment.Vehicle_Assignments, EntityId).Last_TaskOption and then Is_Eligible (Automation_Request, Element (Assignment.Vehicle_Assignments, EntityId).Last_TaskOption, EntityId)))); pragma Assert (not Contains (To_Sequence_Of_TaskOptionId (Assignment), TO_Sequences.First, Last (To_Sequence_Of_TaskOptionId (Assignment)), Get_TaskOptionID (TaskOpt.TaskID, TaskOpt.OptionID))); pragma Assert (for some TaskAssignment of Assignment.Assignment_Sequence => (TaskAssignment.TaskID = Last_TaskOption.TaskID and then TaskAssignment.OptionID = Last_TaskOption.OptionID and then Get_TaskOptionID (TaskAssignment.TaskID, TaskAssignment.OptionID) = Get_TaskOptionID (Last_TaskOption.TaskID, Last_TaskOption.OptionID))); pragma Assert (Contains (To_Sequence_Of_TaskOptionId (Assignment), TO_Sequences.First, Last (To_Sequence_Of_TaskOptionId (Assignment)), Get_TaskOptionID (Last_TaskOption.TaskID, Last_TaskOption.OptionID))); end; end if; end Prove_TaskOpt_Different_From_Last_TaskOption; ------------------------------- -- Prove_TaskOptionId_In_Map -- ------------------------------- procedure Prove_TaskOptionId_In_Map (ID : Int64; Alg : not null access constant Algebra_Tree_Cell) is begin case Alg.Node_Kind is when Action => pragma Assert (ID = Alg.TaskOptionId); pragma Assert (TaskOptionId_In_Map (Alg.all.TaskOptionId, TaskPlanOptions_Map)); pragma Assert (TaskOptionId_In_Map (ID, TaskPlanOptions_Map)); when Operator => for J in 1 .. Alg.Collection.Num_Children loop pragma Loop_Invariant (for all K in 1 .. J - 1 => not Is_Present (Alg.Collection.Children (K), ID)); pragma Loop_Invariant (for some K in J .. Alg.Collection.Num_Children => Is_Present (Alg.Collection.Children (K), ID)); if Is_Present (Alg.Collection.Children (J), ID) then Prove_TaskOptionId_In_Map (ID, Alg.Collection.Children (J)); exit; end if; end loop; when Undefined => raise Program_Error; end case; end Prove_TaskOptionId_In_Map; -------------------------------- -- Prove_Travel_In_CostMatrix -- -------------------------------- procedure Prove_Travel_In_CostMatrix (EntityId : Int64; TaskOpt : TaskOption) is begin if not Contains (Assignment.Vehicle_Assignments, EntityId) then pragma Assert (for all TaskId of TaskPlanOptions_Map => (for all Option of Get (TaskPlanOptions_Map, TaskId).Options => (if Is_Eligible (Automation_Request, Option, EntityId) then Travel_In_CostMatrix (EntityId, Option, Assignment_Cost_Matrix)))); else declare Last_Option : constant TaskOption := Element (Assignment.Vehicle_Assignments, EntityId).Last_TaskOption; begin pragma Assert (for all TaskId of TaskPlanOptions_Map => (for all Option of Get (TaskPlanOptions_Map, TaskId).Options => (if Is_Eligible (Automation_Request, Option, EntityId) then (for all TaskId_2 of TaskPlanOptions_Map => (for all Option_2 of Get (TaskPlanOptions_Map, TaskId_2).Options => (if Option /= Option_2 and then Is_Eligible (Automation_Request, Option_2, EntityId) then Travel_In_CostMatrix (EntityId, Option, Option_2, Assignment_Cost_Matrix))))))); pragma Assert (for some TaskId of TaskPlanOptions_Map => (for some Option of Get (TaskPlanOptions_Map, TaskId).Options => (Option = Last_Option and then Is_Eligible (Automation_Request, Last_Option, EntityId) and then (for all TaskId_2 of TaskPlanOptions_Map => (for all Option_2 of Get (TaskPlanOptions_Map, TaskId_2).Options => (if Option /= Option_2 and then Is_Eligible (Automation_Request, Option_2, EntityId) then Travel_In_CostMatrix (EntityId, Option, Option_2, Assignment_Cost_Matrix))))))); pragma Assert (for all TaskId of TaskPlanOptions_Map => (for all Option of Get (TaskPlanOptions_Map, TaskId).Options => (if Option /= Last_Option and then Is_Eligible (Automation_Request, Option, EntityId) then Travel_In_CostMatrix (EntityId, Last_Option, Option, Assignment_Cost_Matrix)))); pragma Assert (Travel_In_CostMatrix (EntityId, Element (Assignment.Vehicle_Assignments, EntityId).Last_TaskOption, TaskOpt, Assignment_Cost_Matrix)); end; end if; end Prove_Travel_In_CostMatrix; --------------------------------- -- To_Sequence_Of_TaskOptionId -- --------------------------------- function To_Sequence_Of_TaskOptionId (Assignment : Assignment_Info) return Int64_Seq is use all type TaskAssignment_Sequence; Result : Int64_Seq; begin for J in TO_Sequences.First .. Last (Assignment.Assignment_Sequence) loop pragma Assume (Length (Result) < Count_Type'Last); Result := Add (Result, Get_TaskOptionID (Get (Assignment.Assignment_Sequence, J).TaskID, Get (Assignment.Assignment_Sequence, J).OptionID)); pragma Loop_Invariant (for all K in TO_Sequences.First .. J => (for some TaskOptionID of Result => (TaskOptionID = Get_TaskOptionID (Get (Assignment.Assignment_Sequence, K).TaskID, Get (Assignment.Assignment_Sequence, K).OptionID)))); end loop; return Result; end To_Sequence_Of_TaskOptionId; Result : Children_Arr (1 .. 500); Children_Nb : Natural := 0; Objectives_IDs : constant Int64_Seq := Get_Next_Objectives_Ids (To_Sequence_Of_TaskOptionId (Assignment), Algebra); TaskOpt : TaskOption; -- List of TaskOptionIds to be assigned for the next iteration begin for Objective_ID of Objectives_IDs loop Prove_TaskOptionId_In_Map (Objective_ID, Algebra); pragma Assert (TaskOptionId_In_Map (Objective_ID, TaskPlanOptions_Map)); TaskOpt := Corresponding_TaskOption (TaskPlanOptions_Map, Objective_ID); -- We add a new Assignment to Result for each eligible entity -- for Objective_Id. for EntityId of TaskOpt.EligibleEntities loop pragma Assume (Children_Nb < 500); Children_Nb := Children_Nb + 1; Prove_TaskOpt_Different_From_Last_TaskOption (EntityId, TaskOpt); Prove_Travel_In_CostMatrix (EntityId, TaskOpt); Result (Children_Nb) := New_Assignment (Assignment, EntityId, TaskOpt, Assignment_Cost_Matrix, TaskPlanOptions_Map, Automation_Request); pragma Loop_Invariant (Children_Nb <= 500); pragma Loop_Invariant (for all J in 1 .. Children_Nb => Valid_Assignment (Result (J), TaskPlanOptions_Map, Automation_Request)); end loop; pragma Loop_Invariant (Children_Nb <= 500); pragma Loop_Invariant (for all J in 1 .. Children_Nb => Valid_Assignment (Result (J), TaskPlanOptions_Map, Automation_Request)); end loop; return Result (1 .. Children_Nb); end Children; ------------------------------ -- Corresponding_TaskOption -- ------------------------------ function Corresponding_TaskOption (TaskPlanOptions_Map : Int64_TPO_Map; TaskOptionId : Int64) return TaskOption is TaskId : constant Int64 := Get_TaskID (TaskOptionId); OptionId : constant Int64 := Get_OptionID (TaskOptionId); Associated_TPO : constant TaskPlanOptions := Get (TaskPlanOptions_Map, TaskId); begin for Pos in TO_Sequences.First .. Last (Associated_TPO.Options) loop if Get (Associated_TPO.Options, Pos).OptionID = OptionId then return Get (Associated_TPO.Options, Pos); end if; pragma Loop_Invariant (for all J in TO_Sequences.First .. Pos => Get (Associated_TPO.Options, J).OptionID /= OptionId); end loop; raise Program_Error; end Corresponding_TaskOption; ---------------------------------- -- Corresponding_TaskOptionCost -- ---------------------------------- function Corresponding_TaskOptionCost (Assignment_Cost_Matrix : AssignmentCostMatrix; VehicleId : Int64; DestTaskOption : TaskOption) return TaskOptionCost is begin for Pos in TOC_Sequences.First .. Last (Assignment_Cost_Matrix.CostMatrix) loop pragma Loop_Invariant (for all J in TOC_Sequences.First .. Pos - 1 => (VehicleId /= Get (Assignment_Cost_Matrix.CostMatrix, J).VehicleID or else 0 /= Get (Assignment_Cost_Matrix.CostMatrix, J).InitialTaskID or else 0 /= Get (Assignment_Cost_Matrix.CostMatrix, J).InitialTaskOption or else DestTaskOption.TaskID /= Get (Assignment_Cost_Matrix.CostMatrix, J).DestinationTaskID or else DestTaskOption.OptionID /= Get (Assignment_Cost_Matrix.CostMatrix, J).DestinationTaskOption)); declare TOC : constant TaskOptionCost := Get (Assignment_Cost_Matrix.CostMatrix, Pos); begin if VehicleId = TOC.VehicleID and then 0 = TOC.InitialTaskID and then 0 = TOC.InitialTaskOption and then DestTaskOption.TaskID = TOC.DestinationTaskID and then DestTaskOption.OptionID = TOC.DestinationTaskOption then return TOC; end if; end; end loop; raise Program_Error; end Corresponding_TaskOptionCost; ---------------------------------- -- Corresponding_TaskOptionCost -- ---------------------------------- function Corresponding_TaskOptionCost (Assignment_Cost_Matrix : AssignmentCostMatrix; VehicleId : Int64; InitTaskOption, DestTaskOption : TaskOption) return TaskOptionCost is begin for Pos in TOC_Sequences.First .. Last (Assignment_Cost_Matrix.CostMatrix) loop pragma Loop_Invariant (for all J in TOC_Sequences.First .. Pos - 1 => (VehicleId /= Get (Assignment_Cost_Matrix.CostMatrix, J).VehicleID or else InitTaskOption.TaskID /= Get (Assignment_Cost_Matrix.CostMatrix, J).InitialTaskID or else InitTaskOption.OptionID /= Get (Assignment_Cost_Matrix.CostMatrix, J).InitialTaskOption or else DestTaskOption.TaskID /= Get (Assignment_Cost_Matrix.CostMatrix, J).DestinationTaskID or else DestTaskOption.OptionID /= Get (Assignment_Cost_Matrix.CostMatrix, J).DestinationTaskOption)); declare TOC : constant TaskOptionCost := Get (Assignment_Cost_Matrix.CostMatrix, Pos); begin if VehicleId = TOC.VehicleID and then InitTaskOption.TaskID = TOC.InitialTaskID and then InitTaskOption.OptionID = TOC.InitialTaskOption and then DestTaskOption.TaskID = TOC.DestinationTaskID and then DestTaskOption.OptionID = TOC.DestinationTaskOption then return TOC; end if; end; end loop; raise Program_Error; end Corresponding_TaskOptionCost; ---------- -- Cost -- ---------- function Cost (Assignment : Assignment_Info; Cost_Function : Cost_Function_Kind) return Int64 is Result : Int64 := 0; begin case Cost_Function is when Minmax => for VehicleID of Assignment.Vehicle_Assignments loop declare TotalTime : constant Int64 := Element (Assignment.Vehicle_Assignments, VehicleID).TotalTime; begin if TotalTime > Result then Result := TotalTime; end if; end; end loop; when Cumulative => for VehicleId of Assignment.Vehicle_Assignments loop pragma Assume (Result < Int64'Last - Element (Assignment.Vehicle_Assignments, VehicleId).TotalTime); Result := Result + Element (Assignment.Vehicle_Assignments, VehicleId).TotalTime; end loop; end case; return Result; end Cost; ----------------------------------- -- Handle_Assignment_Cost_Matrix -- ----------------------------------- procedure Handle_Assignment_Cost_Matrix (Mailbox : in out Assignment_Tree_Branch_Bound_Mailbox; Data : Assignment_Tree_Branch_Bound_Configuration_Data; State : in out Assignment_Tree_Branch_Bound_State; Matrix : AssignmentCostMatrix) is Old_AssignmentCostMatrixes : constant Int64_AssignmentCostMatrix_Map := State.m_assignmentCostMatrixes with Ghost; procedure Insert (assignmentCostMatrixes : in out Int64_AssignmentCostMatrix_Map; taskPlanOptions : Int64_TaskPlanOptions_Map_Map; uniqueAutomationRequests : Int64_UniqueAutomationRequest_Map) with Pre => (for all ReqId of assignmentCostMatrixes => (Valid_AssignmentCostMatrix (Element (assignmentCostMatrixes, ReqId)) and then Contains (uniqueAutomationRequests, ReqId) and then Contains (taskPlanOptions, ReqId) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, ReqId), Element (taskPlanOptions, ReqId), Element (assignmentCostMatrixes, ReqId)))) and then not Contains (assignmentCostMatrixes, Matrix.CorrespondingAutomationRequestID) and then Valid_AssignmentCostMatrix (Matrix) and then Contains (uniqueAutomationRequests, Matrix.CorrespondingAutomationRequestID) and then Contains (taskPlanOptions, Matrix.CorrespondingAutomationRequestID) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, Matrix.CorrespondingAutomationRequestID), Element (taskPlanOptions, Matrix.CorrespondingAutomationRequestID), Matrix), Post => (for all ReqId of assignmentCostMatrixes => (Valid_AssignmentCostMatrix (Element (assignmentCostMatrixes, ReqId)) and then Contains (uniqueAutomationRequests, ReqId) and then Contains (taskPlanOptions, ReqId) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, ReqId), Element (taskPlanOptions, ReqId), Element (assignmentCostMatrixes, ReqId)))); ------------ -- Insert -- ------------ procedure Insert (assignmentCostMatrixes : in out Int64_AssignmentCostMatrix_Map; taskPlanOptions : Int64_TaskPlanOptions_Map_Map; uniqueAutomationRequests : Int64_UniqueAutomationRequest_Map) is pragma SPARK_Mode (Off); begin Insert (assignmentCostMatrixes, Matrix.CorrespondingAutomationRequestID, Matrix); end Insert; begin Insert (State.m_assignmentCostMatrixes, State.m_taskPlanOptions, State.m_uniqueAutomationRequests); Check_Assignment_Ready (Mailbox, Data, State, Matrix.CorrespondingAutomationRequestID); end Handle_Assignment_Cost_Matrix; ------------------------------ -- Handle_Task_Plan_Options -- ------------------------------ procedure Handle_Task_Plan_Options (Mailbox : in out Assignment_Tree_Branch_Bound_Mailbox; Data : Assignment_Tree_Branch_Bound_Configuration_Data; State : in out Assignment_Tree_Branch_Bound_State; Options : TaskPlanOptions) is ReqId : constant Int64 := Options.CorrespondingAutomationRequestID; procedure Add_TaskPlanOption (assignmentCostMatrixes : Int64_AssignmentCostMatrix_Map; taskPlanOptions : in out Int64_TaskPlanOptions_Map_Map; uniqueAutomationRequests : Int64_UniqueAutomationRequest_Map) with Pre => (for all Req of taskPlanOptions => (Valid_TaskPlanOptions (Element (taskPlanOptions, Req)) and then Contains (uniqueAutomationRequests, Req) and then All_EligibleEntities_In_EntityList (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req)))) and then (for all Req of assignmentCostMatrixes => Valid_AssignmentCostMatrix (Element (assignmentCostMatrixes, Req)) and then Contains (uniqueAutomationRequests, Req) and then Contains (taskPlanOptions, Req) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req), Element (assignmentCostMatrixes, Req))) and then Contains (taskPlanOptions, ReqId) and then not Has_Key (Element (taskPlanOptions, ReqId), Options.TaskID) and then (for all TaskOption of Options.Options => (TaskOption.Cost >= 0 and then Options.TaskID = TaskOption.TaskID)), Post => (for all Req of taskPlanOptions => (Valid_TaskPlanOptions (Element (taskPlanOptions, Req)) and then Contains (uniqueAutomationRequests, Req) and then All_EligibleEntities_In_EntityList (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req)))) and then (for all Req of assignmentCostMatrixes => Valid_AssignmentCostMatrix (Element (assignmentCostMatrixes, Req)) and then Contains (uniqueAutomationRequests, Req) and then Contains (taskPlanOptions, Req) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req), Element (assignmentCostMatrixes, Req))); procedure Insert_Empty_TPO_Map (assignmentCostMatrixes : Int64_AssignmentCostMatrix_Map; taskPlanOptions : in out Int64_TaskPlanOptions_Map_Map; uniqueAutomationRequests : Int64_UniqueAutomationRequest_Map) with Pre => (for all Req of taskPlanOptions => (Valid_TaskPlanOptions (Element (taskPlanOptions, Req)) and then Contains (uniqueAutomationRequests, Req) and then All_EligibleEntities_In_EntityList (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req)))) and then (for all Req of assignmentCostMatrixes => Valid_AssignmentCostMatrix (Element (assignmentCostMatrixes, Req)) and then Contains (uniqueAutomationRequests, Req) and then Contains (taskPlanOptions, Req) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req), Element (assignmentCostMatrixes, Req))) and then not Contains (taskPlanOptions, ReqId) and then Contains (uniqueAutomationRequests, ReqId) and then (for all Option of Options.Options => (for all EntityId of Option.EligibleEntities => Contains (Element (uniqueAutomationRequests, ReqId).EntityList, TO_Sequences.First, Last (Element (uniqueAutomationRequests, ReqId).EntityList), EntityId))), Post => (for all Req of taskPlanOptions => (Valid_TaskPlanOptions (Element (taskPlanOptions, Req)) and then Contains (uniqueAutomationRequests, Req) and then All_EligibleEntities_In_EntityList (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req)))) and then (for all Req of assignmentCostMatrixes => Valid_AssignmentCostMatrix (Element (assignmentCostMatrixes, Req)) and then Contains (uniqueAutomationRequests, Req) and then Contains (taskPlanOptions, Req) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req), Element (assignmentCostMatrixes, Req))) and then Contains (taskPlanOptions, ReqId) and then not Has_Key (Element (taskPlanOptions, ReqId), Options.TaskID); ------------------------ -- Add_TaskPlanOption -- ------------------------ procedure Add_TaskPlanOption (assignmentCostMatrixes : Int64_AssignmentCostMatrix_Map; taskPlanOptions : in out Int64_TaskPlanOptions_Map_Map; uniqueAutomationRequests : Int64_UniqueAutomationRequest_Map) is pragma SPARK_Mode (Off); New_Int64_TPO_Map : Int64_TPO_Map; begin New_Int64_TPO_Map := Add (Element (taskPlanOptions, ReqId), Options.TaskID, Options); Replace (taskPlanOptions, ReqId, New_Int64_TPO_Map); end Add_TaskPlanOption; -------------------------- -- Insert_Empty_TPO_Map -- -------------------------- procedure Insert_Empty_TPO_Map (assignmentCostMatrixes : Int64_AssignmentCostMatrix_Map; taskPlanOptions : in out Int64_TaskPlanOptions_Map_Map; uniqueAutomationRequests : Int64_UniqueAutomationRequest_Map) is pragma SPARK_Mode (Off); Empty_Int64_TPO_Map : Int64_TPO_Map; begin Insert (taskPlanOptions, ReqId, Empty_Int64_TPO_Map); end Insert_Empty_TPO_Map; begin if not Contains (State.m_taskPlanOptions, ReqId) then Insert_Empty_TPO_Map (State.m_assignmentCostMatrixes, State.m_taskPlanOptions, State.m_uniqueAutomationRequests); end if; Add_TaskPlanOption (State.m_assignmentCostMatrixes, State.m_taskPlanOptions, State.m_uniqueAutomationRequests); Check_Assignment_Ready (Mailbox, Data, State, Options.CorrespondingAutomationRequestID); end Handle_Task_Plan_Options; -------------------------------------- -- Handle_Unique_Automation_Request -- -------------------------------------- procedure Handle_Unique_Automation_Request (Mailbox : in out Assignment_Tree_Branch_Bound_Mailbox; Data : Assignment_Tree_Branch_Bound_Configuration_Data; State : in out Assignment_Tree_Branch_Bound_State; Areq : UniqueAutomationRequest) is procedure Insert (assignmentCostMatrixes : Int64_AssignmentCostMatrix_Map; taskPlanOptions : Int64_TaskPlanOptions_Map_Map; uniqueAutomationRequests : in out Int64_UniqueAutomationRequest_Map) with Pre => (for all ReqId of taskPlanOptions => (Valid_TaskPlanOptions (Element (taskPlanOptions, ReqId)) and then Contains (uniqueAutomationRequests, ReqId) and then All_EligibleEntities_In_EntityList (Element (uniqueAutomationRequests, ReqId), Element (taskPlanOptions, ReqId)))) and then (for all ReqId of assignmentCostMatrixes => Valid_AssignmentCostMatrix (Element (assignmentCostMatrixes, ReqId)) and then Contains (uniqueAutomationRequests, ReqId) and then Contains (taskPlanOptions, ReqId) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, ReqId), Element (taskPlanOptions, ReqId), Element (assignmentCostMatrixes, ReqId))) and then not Contains (uniqueAutomationRequests, Areq.RequestID) and then not Contains (assignmentCostMatrixes, Areq.RequestID), Post => (for all ReqId of taskPlanOptions => (Valid_TaskPlanOptions (Element (taskPlanOptions, ReqId)) and then Contains (uniqueAutomationRequests, ReqId) and then All_EligibleEntities_In_EntityList (Element (uniqueAutomationRequests, ReqId), Element (taskPlanOptions, ReqId)))) and then (for all ReqId of assignmentCostMatrixes => Valid_AssignmentCostMatrix (Element (assignmentCostMatrixes, ReqId)) and then Contains (uniqueAutomationRequests, ReqId) and then Contains (taskPlanOptions, ReqId) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, ReqId), Element (taskPlanOptions, ReqId), Element (assignmentCostMatrixes, ReqId))); ------------ -- Insert -- ------------ procedure Insert (assignmentCostMatrixes : Int64_AssignmentCostMatrix_Map; taskPlanOptions : Int64_TaskPlanOptions_Map_Map; uniqueAutomationRequests : in out Int64_UniqueAutomationRequest_Map) is pragma SPARK_Mode (Off); begin Insert (uniqueAutomationRequests, Areq.RequestID, Areq); end Insert; begin Insert (State.m_assignmentCostMatrixes, State.m_taskPlanOptions, State.m_uniqueAutomationRequests); Check_Assignment_Ready (Mailbox, Data, State, Areq.RequestID); end Handle_Unique_Automation_Request; ------------------------ -- Initialize_Algebra -- ------------------------ procedure Initialize_Algebra (Automation_Request : UniqueAutomationRequest; TaskPlanOptions_Map : Int64_TPO_Map; Algebra : out Algebra_Tree; Error : out Boolean; Message : out Unbounded_String) is package Unb renames Common.Unbounded_Strings_Subprograms; taskIdVsAlgebraString : Int64_Unbounded_String_Map; algebraString : Unbounded_String := To_Unbounded_String (""); begin Algebra := null; Message := Null_Unbounded_String; Error := False; for taskId of TaskPlanOptions_Map loop if taskId not in 0 .. 99_999 then Append_To_Msg (Message, "TaskID "); Append_To_Msg (Message, Print_Int64 (taskId)); Append_To_Msg (Message, " should be in range 0 .. 99_999."); Error := True; return; end if; declare compositionString : Unbounded_String := Get (TaskPlanOptions_Map, taskId).Composition; algebraCompositionTaskOptionId : Unbounded_String := Unb.To_Unbounded_String (""); isFinished : Boolean := False; begin if Length (compositionString) = Natural'Last then Append_To_Msg (Message, "Composition string of TaskID "); Append_To_Msg (Message, Print_Int64 (taskId)); Append_To_Msg (Message, " is too long."); Error := True; return; end if; while not isFinished loop pragma Loop_Invariant (Length (compositionString) < Natural'Last); if Length (compositionString) > 0 then declare position : Natural := Unb.Index (compositionString, "p"); begin if position > 0 then if Length (algebraCompositionTaskOptionId) >= Natural'Last - position then Append_To_Msg (Message, "Composition string of TaskID "); Append_To_Msg (Message, Print_Int64 (taskId)); Append_To_Msg (Message, " is too long."); Error := True; return; end if; algebraCompositionTaskOptionId := algebraCompositionTaskOptionId & Unb.Slice (compositionString, 1, position); declare positionAfterId : Natural; positionSpace : constant Natural := Unb.Index (compositionString, " ", position); positionParen : constant Natural := Unb.Index (compositionString, ")", position); begin if positionSpace = 0 and then positionParen = 0 then Append_To_Msg (Message, "Substring " & '"'); Append_To_Msg (Message, Unb.Slice (compositionString, position, Length (compositionString))); Append_To_Msg (Message, '"' & ": optionID after character 'p' should be followed by character ' ' or ')'."); Error := True; return; elsif positionSpace /= 0 and then positionParen /= 0 then positionAfterId := Natural'Min (positionSpace, positionParen); else positionAfterId := Natural'Max (positionSpace, positionParen); end if; if positionAfterId - 1 < position + 1 then Append_To_Msg (Message, "Substring " & '"'); Append_To_Msg (Message, Unb.Slice (compositionString, position, Length (compositionString))); Append_To_Msg (Message, '"' & ": character 'p' should be followed by an optionID."); Error := True; return; end if; declare optionId, taskOptionId : Int64; Parsing_Error : Boolean; begin Parse_Int64 (Unb.Slice (compositionString, position + 1, positionAfterId - 1), optionId, Parsing_Error); if Parsing_Error then Append_To_Msg (Message, "Substring " & '"'); Append_To_Msg (Message, Unb.Slice (compositionString, position + 1, positionAfterId - 1)); Append_To_Msg (Message, '"' & ": does not correspond to an Int64."); Error := True; return; end if; if optionId not in 0 .. 99_999 then Append_To_Msg (Message, "OptionID "); Append_To_Msg (Message, Print_Int64 (optionId)); Append_To_Msg (Message, " should be in range 0 .. 99_999."); Error := True; return; end if; taskOptionId := Get_TaskOptionID (taskId, optionId); declare Image : String := Print_Int64 (taskOptionId); begin if Length (algebraCompositionTaskOptionId) >= Natural'Last - Image'Length then Append_To_Msg (Message, "Composition string of TaskID "); Append_To_Msg (Message, Print_Int64 (taskId)); Append_To_Msg (Message, " is too long."); Error := True; return; end if; algebraCompositionTaskOptionId := algebraCompositionTaskOptionId & Image; end; Delete (compositionString, 1, positionAfterId - 1); end; end; else algebraCompositionTaskOptionId := algebraCompositionTaskOptionId & compositionString; taskIdVsAlgebraString := Add (taskIdVsAlgebraString, taskId, algebraCompositionTaskOptionId); isFinished := True; end if; end; else isFinished := True; end if; end loop; end; end loop; if Length (Automation_Request.TaskRelationships) > 0 then declare isFinished : Boolean := False; TaskRelationships : Unbounded_String := Automation_Request.TaskRelationships; begin if Length (TaskRelationships) = Natural'Last then Append_To_Msg (Message, "TaskRelationships string is too long."); Error := True; return; end if; while not isFinished loop pragma Loop_Invariant (Length (TaskRelationships) < Natural'Last); if Length (TaskRelationships) > 0 then declare position : Natural := Unb.Index (TaskRelationships, "p"); begin if position > 0 then if Length (algebraString) >= Natural'Last - position + 1 then Append_To_Msg (Message, "Algebra string is too long."); Error := True; return; end if; algebraString := algebraString & Unb.Slice (TaskRelationships, 1, position - 1); declare positionAfterId : Natural; positionSpace : constant Natural := Unb.Index (TaskRelationships, " ", position); positionParen : constant Natural := Unb.Index (TaskRelationships, ")", position); begin if positionSpace = 0 and then positionParen = 0 then Append_To_Msg (Message, "Substring " & '"'); Append_To_Msg (Message, Slice (TaskRelationships, position, Length (TaskRelationships))); Append_To_Msg (Message, '"' & ": taskID after character 'p' should be followed by character ' ' or ')'."); Error := True; return; elsif positionSpace /= 0 and then positionParen /= 0 then positionAfterId := Natural'Min (positionSpace, positionParen); else positionAfterId := Natural'Max (positionSpace, positionParen); end if; if positionAfterId - 1 < position + 1 then Append_To_Msg (Message, "Substring " & '"'); Append_To_Msg (Message, Unb.Slice (TaskRelationships, position, Length (TaskRelationships))); Append_To_Msg (Message, '"' & ": character 'p' should be followed by an optionID."); Error := True; return; end if; declare taskId : Int64; Parsing_Error : Boolean; begin Parse_Int64 (Unb.Slice (TaskRelationships, position + 1, positionAfterId - 1), taskId, Parsing_Error); if Parsing_Error then Append_To_Msg (Message, "Substring " & '"'); Append_To_Msg (Message, Unb.Slice (TaskRelationships, position + 1, positionAfterId - 1)); Append_To_Msg (Message, '"' & ": does not correspond to an Int64."); Error := True; return; end if; if taskId not in 0 .. 99_999 then Append_To_Msg (Message, "TaskID "); Append_To_Msg (Message, Print_Int64 (taskId)); Append_To_Msg (Message, " should be in range 0 .. 99_999."); Error := True; return; end if; if Has_Key (taskIdVsAlgebraString, taskId) then if Length (algebraString) > Natural'Last - Length (Get (taskIdVsAlgebraString, taskId)) then Append_To_Msg (Message, "Algebra string is too long."); Error := True; return; end if; algebraString := algebraString & Get (taskIdVsAlgebraString, taskId); else Append_To_Msg (Message, "TaskID "); Append_To_Msg (Message, Print_Int64 (taskId)); Append_To_Msg (Message, " does not exist."); Error := True; return; end if; Delete (TaskRelationships, 1, positionAfterId - 1); end; end; else algebraString := algebraString & TaskRelationships; isFinished := True; end if; end; else isFinished := True; end if; end loop; end; else algebraString := algebraString & "|("; for taskID of taskIdVsAlgebraString loop if Length (algebraString) >= Natural'Last - 1 - Length (Get (taskIdVsAlgebraString, taskID)) then Append_To_Msg (Message, "Algebra string is too long."); Error := True; return; end if; algebraString := algebraString & Get (taskIdVsAlgebraString, taskID) & " "; end loop; algebraString := algebraString & ")"; pragma Assert (Length (algebraString) > 0); end if; Put ("AlgebraString: "); Put_Line (To_String (algebraString)); if Length (algebraString) <= 1 then Append_To_Msg (Message, "Algebra string is too short."); Error := True; return; end if; if not Error then Parse_Formula (algebraString, Algebra, Error, Message); if not Error then declare procedure Check_Actions_In_Map_Rec (Tree : not null Algebra_Tree) with Post => (if not Error then All_Actions_In_Map (Tree, TaskPlanOptions_Map)); pragma Annotate (GNATprove, Terminating, Check_Actions_In_Map_Rec); procedure Check_Actions_In_Map_Rec (Tree : not null Algebra_Tree) is begin case Tree.all.Node_Kind is when Action => if Tree.TaskOptionId not in 0 .. 9_999_999_999 then Append_To_Msg (Message, "TaskOptionId "); Append_To_Msg (Message, Print_Int64 (Tree.TaskOptionId)); Append_To_Msg (Message, " should be in range 0 .. 9_999_999_999."); Error := True; return; end if; if (for all TaskId of TaskPlanOptions_Map => (for all TaskOption of Get (TaskPlanOptions_Map, TaskId).Options => (TaskId /= TaskOption.TaskID or else TaskOption.TaskID /= Get_TaskID (Tree.TaskOptionId) or else TaskOption.OptionID /= Get_OptionID (Tree.TaskOptionId)))) then Append_To_Msg (Message, "OptionId "); Append_To_Msg (Message, Print_Int64 (Get_OptionID (Tree.TaskOptionId))); Append_To_Msg (Message, " does not exist for TaskId "); Append_To_Msg (Message, Print_Int64 (Get_TaskID (Tree.TaskOptionId))); Append_To_Msg (Message, '.'); Error := True; return; end if; when Operator => for J in 1 .. Tree.Collection.Num_Children loop Check_Actions_In_Map_Rec (Tree.Collection.Children (J)); if Error then return; end if; pragma Loop_Invariant (for all K in 1 .. J => All_Actions_In_Map (Tree.Collection.Children (K), TaskPlanOptions_Map)); end loop; when Undefined => Append_To_Msg (Message, "Algebra tree is not well formed."); Error := True; return; end case; end Check_Actions_In_Map_Rec; begin Check_Actions_In_Map_Rec (Algebra); end; end if; end if; end Initialize_Algebra; -------------------- -- New_Assignment -- -------------------- function New_Assignment (Assignment : Assignment_Info; VehicleId : Int64; TaskOpt : TaskOption; Assignment_Cost_Matrix : AssignmentCostMatrix; TaskPlanOptions_Map : Int64_TPO_Map; Automation_Request : UniqueAutomationRequest) return Assignment_Info is Result : Assignment_Info; Vehicle_Assignment : constant VehicleAssignmentCost := (if Contains (Assignment.Vehicle_Assignments, VehicleId) then Element (Assignment.Vehicle_Assignments, VehicleId) else VehicleAssignmentCost'(0, TaskOpt)); pragma Assume (Vehicle_Assignment.TotalTime <= Int64'Last - (if Contains (Assignment.Vehicle_Assignments, VehicleId) then Corresponding_TaskOptionCost (Assignment_Cost_Matrix, VehicleId, Vehicle_Assignment.Last_TaskOption, TaskOpt).TimeToGo else Corresponding_TaskOptionCost (Assignment_Cost_Matrix, VehicleId, TaskOpt).TimeToGo)); TimeThreshold : constant Int64 := Vehicle_Assignment.TotalTime + (if Contains (Assignment.Vehicle_Assignments, VehicleId) then Corresponding_TaskOptionCost (Assignment_Cost_Matrix, VehicleId, Vehicle_Assignment.Last_TaskOption, TaskOpt).TimeToGo else Corresponding_TaskOptionCost (Assignment_Cost_Matrix, VehicleId, TaskOpt).TimeToGo); pragma Assume (TimeThreshold <= Int64'Last - TaskOpt.Cost); TimeTaskCompleted : constant Int64 := TimeThreshold + TaskOpt.Cost; procedure Prove_Final_Value_Is_Valid with Ghost, Pre => Valid_TaskPlanOptions (TaskPlanOptions_Map) and then Valid_Assignment (Assignment, TaskPlanOptions_Map, Automation_Request) and then Length (Assignment.Assignment_Sequence) < Count_Type'Last and then TaskOpt.TaskID in 0 .. 99_999 and then TaskOpt.OptionID in 0 .. 99_999 and then Result.Assignment_Sequence = Add (Assignment.Assignment_Sequence, (TaskOpt.TaskID, TaskOpt.OptionID, VehicleId, TimeThreshold, TimeTaskCompleted)) and then (for some TaskAssignment of Result.Assignment_Sequence => (TaskAssignment.TaskID = TaskOpt.TaskID and then TaskAssignment.OptionID = TaskOpt.OptionID)) and then Contains_Corresponding_TaskOption (Automation_Request, TaskPlanOptions_Map, TaskOpt, VehicleId) and then (for all EntityId of Result.Vehicle_Assignments => (if EntityId /= VehicleId then Contains (Assignment.Vehicle_Assignments, EntityId) and then Element (Result.Vehicle_Assignments, EntityId) = Element (Assignment.Vehicle_Assignments, EntityId) else Element (Result.Vehicle_Assignments, EntityId).Last_TaskOption = TaskOpt)), Post => Valid_Assignment (Result, TaskPlanOptions_Map, Automation_Request); procedure Prove_Initial_Value_Is_Valid with Ghost, Pre => Length (Assignment.Assignment_Sequence) < Count_Type'Last and then TaskOpt.TaskID in 0 .. 99_999 and then TaskOpt.OptionID in 0 .. 99_999 and then Result.Assignment_Sequence = Add (Assignment.Assignment_Sequence, (TaskOpt.TaskID, TaskOpt.OptionID, VehicleId, TimeThreshold, TimeTaskCompleted)) and then Assignment.Vehicle_Assignments = Result.Vehicle_Assignments and then Valid_TaskPlanOptions (TaskPlanOptions_Map) and then Valid_Assignment (Assignment, TaskPlanOptions_Map, Automation_Request), Post => Valid_Assignment (Result, TaskPlanOptions_Map, Automation_Request); -------------------------------- -- Prove_Final_Value_Is_Valid -- -------------------------------- procedure Prove_Final_Value_Is_Valid is I : Int64_VehicleAssignmentCost_Maps.Cursor := First (Result.Vehicle_Assignments); begin while Has_Element (Result.Vehicle_Assignments, I) loop if Key (Result.Vehicle_Assignments, I) = VehicleId then pragma Assert (Contains_Corresponding_TaskOption (Automation_Request, TaskPlanOptions_Map, TaskOpt, Key (Result.Vehicle_Assignments, I))); Equal_TaskOpt_Lemma (Automation_Request, TaskPlanOptions_Map, TaskOpt, Element (Result.Vehicle_Assignments, I).Last_TaskOption, Key (Result.Vehicle_Assignments, I)); else pragma Assert (Contains (Assignment.Vehicle_Assignments, Key (Result.Vehicle_Assignments, I)) and then Element (Assignment.Vehicle_Assignments, Key (Result.Vehicle_Assignments, I)) = Element (Result.Vehicle_Assignments, I)); pragma Assert (Contains_Corresponding_TaskOption (Assignment.Assignment_Sequence, Element (Assignment.Vehicle_Assignments, Key (Result.Vehicle_Assignments, I)).Last_TaskOption)); pragma Assert (Contains_Corresponding_TaskOption (Automation_Request, TaskPlanOptions_Map, Element (Assignment.Vehicle_Assignments, Key (Result.Vehicle_Assignments, I)).Last_TaskOption, Key (Result.Vehicle_Assignments, I))); Equal_TaskOpt_Lemma (Automation_Request, TaskPlanOptions_Map, Element (Assignment.Vehicle_Assignments, Key (Result.Vehicle_Assignments, I)).Last_TaskOption, Element (Result.Vehicle_Assignments, I).Last_TaskOption, Key (Result.Vehicle_Assignments, I)); end if; pragma Loop_Invariant (Has_Element (Result.Vehicle_Assignments, I)); pragma Loop_Invariant (for all K in 1 .. Int64_VehicleAssignmentCost_Maps_P.Get (Positions (Result.Vehicle_Assignments), I) => (Contains_Corresponding_TaskOption (Result.Assignment_Sequence, Element (Result.Vehicle_Assignments, Int64_VehicleAssignmentCost_Maps_K.Get (Keys (Result.Vehicle_Assignments), K)).Last_TaskOption) and then (Contains_Corresponding_TaskOption (Automation_Request, TaskPlanOptions_Map, Element (Result.Vehicle_Assignments, Int64_VehicleAssignmentCost_Maps_K.Get (Keys (Result.Vehicle_Assignments), K)).Last_TaskOption, Int64_VehicleAssignmentCost_Maps_K.Get (Keys (Result.Vehicle_Assignments), K))))); Next (Result.Vehicle_Assignments, I); end loop; for J in TO_Sequences.First .. Last (Result.Assignment_Sequence) loop if J /= Last (Result.Assignment_Sequence) then pragma Assert (Get (Result.Assignment_Sequence, J) = Get (Assignment.Assignment_Sequence, J)); pragma Assert (Get (Result.Assignment_Sequence, J).TaskID in 0 .. 99_999 and then Get (Result.Assignment_Sequence, J).OptionID in 0 .. 99_999); else pragma Assert (Get (Result.Assignment_Sequence, J).TaskID = TaskOpt.TaskID and then Get (Result.Assignment_Sequence, J).OptionID = TaskOpt.OptionID); pragma Assert (Get (Result.Assignment_Sequence, J).TaskID in 0 .. 99_999 and then Get (Result.Assignment_Sequence, J).OptionID in 0 .. 99_999); end if; pragma Loop_Invariant (for all K in TO_Sequences.First .. J => (Get (Result.Assignment_Sequence, K).TaskID in 0 .. 99_999 and then Get (Result.Assignment_Sequence, K).OptionID in 0 .. 99_999)); end loop; end Prove_Final_Value_Is_Valid; ---------------------------------- -- Prove_Initial_Value_Is_Valid -- ---------------------------------- procedure Prove_Initial_Value_Is_Valid is I : Int64_VehicleAssignmentCost_Maps.Cursor := First (Result.Vehicle_Assignments); begin while Has_Element (Result.Vehicle_Assignments, I) loop pragma Assert (Contains (Assignment.Vehicle_Assignments, Key (Result.Vehicle_Assignments, I)) and then Element (Assignment.Vehicle_Assignments, Key (Result.Vehicle_Assignments, I)) = Element (Result.Vehicle_Assignments, I)); pragma Assert (Contains_Corresponding_TaskOption (Automation_Request, TaskPlanOptions_Map, Element (Assignment.Vehicle_Assignments, Key (Result.Vehicle_Assignments, I)).Last_TaskOption, Key (Result.Vehicle_Assignments, I))); Equal_TaskOpt_Lemma (Automation_Request, TaskPlanOptions_Map, Element (Assignment.Vehicle_Assignments, Key (Result.Vehicle_Assignments, I)).Last_TaskOption, Element (Result.Vehicle_Assignments, I).Last_TaskOption, Key (Result.Vehicle_Assignments, I)); pragma Loop_Invariant (Has_Element (Result.Vehicle_Assignments, I)); pragma Loop_Invariant (for all K in 1 .. Int64_VehicleAssignmentCost_Maps_P.Get (Positions (Result.Vehicle_Assignments), I) => (Contains_Corresponding_TaskOption (Result.Assignment_Sequence, Element (Result.Vehicle_Assignments, Int64_VehicleAssignmentCost_Maps_K.Get (Keys (Result.Vehicle_Assignments), K)).Last_TaskOption) and then (Contains_Corresponding_TaskOption (Automation_Request, TaskPlanOptions_Map, Element (Result.Vehicle_Assignments, Int64_VehicleAssignmentCost_Maps_K.Get (Keys (Result.Vehicle_Assignments), K)).Last_TaskOption, Int64_VehicleAssignmentCost_Maps_K.Get (Keys (Result.Vehicle_Assignments), K))))); Next (Result.Vehicle_Assignments, I); end loop; for J in TO_Sequences.First .. Last (Result.Assignment_Sequence) loop if J /= Last (Result.Assignment_Sequence) then pragma Assert (Get (Result.Assignment_Sequence, J) = Get (Assignment.Assignment_Sequence, J)); pragma Assert (Get (Result.Assignment_Sequence, J).TaskID in 0 .. 99_999 and then Get (Result.Assignment_Sequence, J).OptionID in 0 .. 99_999); else pragma Assert (Get (Result.Assignment_Sequence, J).TaskID = TaskOpt.TaskID and then Get (Result.Assignment_Sequence, J).OptionID = TaskOpt.OptionID); pragma Assert (Get (Result.Assignment_Sequence, J).TaskID in 0 .. 99_999 and then Get (Result.Assignment_Sequence, J).OptionID in 0 .. 99_999); end if; pragma Loop_Invariant (for all K in TO_Sequences.First .. J => (Get (Result.Assignment_Sequence, K).TaskID in 0 .. 99_999 and then Get (Result.Assignment_Sequence, K).OptionID in 0 .. 99_999)); end loop; end Prove_Initial_Value_Is_Valid; begin -- The assignment sequence is the enclosing assignment sequence with -- the new TaskAssignment added at the end. pragma Assume (Length (Assignment.Assignment_Sequence) < Count_Type'Last); Result.Assignment_Sequence := Add (Assignment.Assignment_Sequence, (TaskOpt.TaskID, TaskOpt.OptionID, VehicleId, TimeThreshold, TimeTaskCompleted)); Result.Vehicle_Assignments := Assignment.Vehicle_Assignments; Prove_Initial_Value_Is_Valid; pragma Assert (Valid_Assignment (Result, TaskPlanOptions_Map, Automation_Request)); declare VAC : VehicleAssignmentCost := (TimeTaskCompleted, TaskOpt); begin pragma Assert (for some TaskId of TaskPlanOptions_Map => (for some Option of Get (TaskPlanOptions_Map, TaskId).Options => (Option = VAC.Last_TaskOption and then Is_Eligible (Automation_Request, VAC.Last_TaskOption, VehicleId)))); if Contains (Result.Vehicle_Assignments, VehicleId) then Replace (Result.Vehicle_Assignments, VehicleId, VAC); Prove_Final_Value_Is_Valid; pragma Assert (Valid_Assignment (Result, TaskPlanOptions_Map, Automation_Request)); else pragma Assume (Length (Result.Vehicle_Assignments) < Result.Vehicle_Assignments.Capacity, "we have enough space for another vehicle"); Insert (Result.Vehicle_Assignments, VehicleId, VAC); Prove_Final_Value_Is_Valid; pragma Assert (Valid_Assignment (Result, TaskPlanOptions_Map, Automation_Request)); end if; end; return Result; end New_Assignment; ------------------------------ -- Run_Calculate_Assignment -- ------------------------------ procedure Run_Calculate_Assignment (Data : Assignment_Tree_Branch_Bound_Configuration_Data; Automation_Request : UniqueAutomationRequest; Assignment_Cost_Matrix : AssignmentCostMatrix; TaskPlanOptions_Map : Int64_TPO_Map; Summary : out TaskAssignmentSummary; Error : out Boolean; Message : out Unbounded_String) is procedure Bubble_Sort (Arr : in out Children_Arr) with Pre => Arr'Length > 0 and then Valid_TaskPlanOptions (TaskPlanOptions_Map) and then (for all Child of Arr => (Valid_Assignment (Child, TaskPlanOptions_Map, Automation_Request))), Post => (for all Child of Arr => (Valid_Assignment (Child, TaskPlanOptions_Map, Automation_Request))); -- Sorts the array of assignments in the ascending order of cost. procedure Equal_Implies_Valid_Assignment (A, B : Assignment_Info) with Ghost, Pre => A = B and then Valid_TaskPlanOptions (TaskPlanOptions_Map) and then Valid_Assignment (A, TaskPlanOptions_Map, Automation_Request), Post => Valid_Assignment (B, TaskPlanOptions_Map, Automation_Request); procedure Pop_Wrapper (Search_Stack : in out Stack; Current_Element : out Assignment_Info) with Pre => Size (Search_Stack) > Assignment_Stack.Empty and then Valid_TaskPlanOptions (TaskPlanOptions_Map) and then (for all K in 1 .. Size (Search_Stack) => Valid_Assignment (Element (Search_Stack, K), TaskPlanOptions_Map, Automation_Request)), Post => Size (Search_Stack) = Size (Search_Stack'Old) - 1 and then Valid_Assignment (Current_Element, TaskPlanOptions_Map, Automation_Request) and then (for all K in 1 .. Size (Search_Stack) => Valid_Assignment (Element (Search_Stack, K), TaskPlanOptions_Map, Automation_Request)); procedure Push_Wrapper (Search_Stack : in out Stack; Current_Element : Assignment_Info) with Pre => Size (Search_Stack) < Assignment_Stack.Capacity and then Valid_TaskPlanOptions (TaskPlanOptions_Map) and then (for all K in 1 .. Size (Search_Stack) => Valid_Assignment (Element (Search_Stack, K), TaskPlanOptions_Map, Automation_Request)) and then Valid_Assignment (Current_Element, TaskPlanOptions_Map, Automation_Request), Post => Size (Search_Stack) = Size (Search_Stack'Old) + 1 and then (for all K in 1 .. Size (Search_Stack) => Valid_Assignment (Element (Search_Stack, K), TaskPlanOptions_Map, Automation_Request)); ----------------- -- Bubble_Sort -- ----------------- procedure Bubble_Sort (Arr : in out Children_Arr) is Switched : Boolean; begin loop Switched := False; pragma Loop_Invariant (for all Child of Arr => Valid_Assignment (Child, TaskPlanOptions_Map, Automation_Request)); for J in Arr'First .. Arr'Last - 1 loop pragma Loop_Invariant (for all Child of Arr => Valid_Assignment (Child, TaskPlanOptions_Map, Automation_Request)); if Cost (Arr (J + 1), Data.Cost_Function) < Cost (Arr (J), Data.Cost_Function) then declare Tmp : Assignment_Info := Arr (J + 1); begin Equal_Implies_Valid_Assignment (Arr (J + 1), Tmp); Arr (J + 1) := Arr (J); Equal_Implies_Valid_Assignment (Arr (J), Arr (J + 1)); Arr (J) := Tmp; Equal_Implies_Valid_Assignment (Tmp, Arr (J)); Switched := True; end; end if; end loop; exit when not Switched; end loop; end Bubble_Sort; ------------------------------------ -- Equal_Implies_Valid_Assignment -- ------------------------------------ procedure Equal_Implies_Valid_Assignment (A, B : Assignment_Info) is I : Int64_VehicleAssignmentCost_Maps.Cursor := First (B.Vehicle_Assignments); begin while Has_Element (B.Vehicle_Assignments, I) loop pragma Assert (Contains (A.Vehicle_Assignments, Key (B.Vehicle_Assignments, I)) and then Element (A.Vehicle_Assignments, Key (B.Vehicle_Assignments, I)) = Element (B.Vehicle_Assignments, I)); pragma Assert (Contains_Corresponding_TaskOption (A.Assignment_Sequence, Element (A.Vehicle_Assignments, Key (B.Vehicle_Assignments, I)).Last_TaskOption)); pragma Assert (Contains_Corresponding_TaskOption (Automation_Request, TaskPlanOptions_Map, Element (A.Vehicle_Assignments, Key (B.Vehicle_Assignments, I)).Last_TaskOption, Key (B.Vehicle_Assignments, I))); Equal_TaskOpt_Lemma (Automation_Request, TaskPlanOptions_Map, Element (A.Vehicle_Assignments, Key (B.Vehicle_Assignments, I)).Last_TaskOption, Element (B.Vehicle_Assignments, I).Last_TaskOption, Key (B.Vehicle_Assignments, I)); pragma Loop_Invariant (Has_Element (B.Vehicle_Assignments, I)); pragma Loop_Invariant (for all K in 1 .. Int64_VehicleAssignmentCost_Maps_P.Get (Positions (B.Vehicle_Assignments), I) => (Contains_Corresponding_TaskOption (B.Assignment_Sequence, Element (B.Vehicle_Assignments, Int64_VehicleAssignmentCost_Maps_K.Get (Keys (B.Vehicle_Assignments), K)).Last_TaskOption) and then (Contains_Corresponding_TaskOption (Automation_Request, TaskPlanOptions_Map, Element (B.Vehicle_Assignments, Int64_VehicleAssignmentCost_Maps_K.Get (Keys (B.Vehicle_Assignments), K)).Last_TaskOption, Int64_VehicleAssignmentCost_Maps_K.Get (Keys (B.Vehicle_Assignments), K))))); Next (B.Vehicle_Assignments, I); end loop; end Equal_Implies_Valid_Assignment; ----------------- -- Pop_Wrapper -- ----------------- procedure Pop_Wrapper (Search_Stack : in out Stack; Current_Element : out Assignment_Info) is Old_Stack : constant Stack := Search_Stack with Ghost; begin Pop (Search_Stack, Current_Element); Equal_Implies_Valid_Assignment (Element (Old_Stack, Size (Old_Stack)), Current_Element); for K in 1 .. Size (Search_Stack) loop Equal_Implies_Valid_Assignment (Element (Old_Stack, K), Element (Search_Stack, K)); pragma Loop_Invariant (for all J in 1 .. K => Valid_Assignment (Element (Search_Stack, J), TaskPlanOptions_Map, Automation_Request)); end loop; end Pop_Wrapper; ------------------ -- Push_Wrapper -- ------------------ procedure Push_Wrapper (Search_Stack : in out Stack; Current_Element : Assignment_Info) is Old_Stack : constant Stack := Search_Stack with Ghost; begin Push (Search_Stack, Current_Element); for K in 1 .. Size (Search_Stack) loop if K < Size (Search_Stack) then Equal_Implies_Valid_Assignment (Element (Old_Stack, K), Element (Search_Stack, K)); else Equal_Implies_Valid_Assignment (Current_Element, Element (Search_Stack, K)); end if; pragma Loop_Invariant (for all J in 1 .. K => Valid_Assignment (Element (Search_Stack, J), TaskPlanOptions_Map, Automation_Request)); end loop; end Push_Wrapper; type Min_Option (Found : Boolean := False) is record case Found is when True => Info : Assignment_Info; Cost : Int64; when False => null; end case; end record; Algebra : Algebra_Tree; Min : Min_Option := (Found => False); Search_Stack : Stack; Current_Element : Assignment_Info; Empty_TA_Seq : TaskAssignment_Sequence; Empty_VA_Map : Int64_VAC_Map; Nodes_Visited : Int64 := 0; begin Initialize_Algebra (Automation_Request, TaskPlanOptions_Map, Algebra, Error, Message); Put_Line (To_String (Message)); if not Error then Put_Line ("Algebra Tree:"); Print_Tree (Algebra); -- The first element is a null assignment Push_Wrapper (Search_Stack, (Empty_TA_Seq, Empty_VA_Map)); pragma Assert (for all K in 1 .. Size (Search_Stack) => Valid_Assignment (Element (Search_Stack, K), TaskPlanOptions_Map, Automation_Request)); -- If the stack is empty, all solutions have been explored while Size (Search_Stack) /= 0 -- We continue at least until we find a solution and then (if Min.Found then (Nodes_Visited in 1 .. Data.Number_Nodes_Maximum - 1)) loop pragma Loop_Invariant (for all K in 1 .. Size (Search_Stack) => Valid_Assignment (Element (Search_Stack, K), TaskPlanOptions_Map, Automation_Request)); -- The element at the top of the stack is popped Pop_Wrapper (Search_Stack, Current_Element); if not Min.Found or else Cost (Current_Element, Data.Cost_Function) < Min.Cost then declare Children_A : Children_Arr := Children (Current_Element, Algebra, Automation_Request, TaskPlanOptions_Map, Assignment_Cost_Matrix); Current_Cost : constant Int64 := Cost (Current_Element, Data.Cost_Function); begin -- If this element has no children, it means that this node -- has assigned every task, so we compare it to the current -- assignment that minimizes the cost. if Children_A'Length = 0 then if not Min.Found or else Current_Cost < Min.Cost then Min := (Found => True, Info => Current_Element, Cost => Current_Cost); end if; -- Else, we compute the cost for every child and push them into the -- stack if their cost is lower than the current minimal cost. else Bubble_Sort (Children_A); for J in reverse Children_A'Range loop pragma Loop_Invariant (for all K in 1 .. Size (Search_Stack) => Valid_Assignment (Element (Search_Stack, K), TaskPlanOptions_Map, Automation_Request)); declare Child : Assignment_Info := Children_A (J); begin if not Min.Found or else Cost (Child, Data.Cost_Function) < Min.Cost then pragma Assume (Size (Search_Stack) < Assignment_Stack.Capacity, "we have space for another child"); Push_Wrapper (Search_Stack, Child); end if; end; end loop; pragma Assert (for all K in 1 .. Size (Search_Stack) => Valid_Assignment (Element (Search_Stack, K), TaskPlanOptions_Map, Automation_Request)); end if; end; pragma Assume (Nodes_Visited < Int64'Last, "a solution is found in less than Int64'Last steps"); Nodes_Visited := Nodes_Visited + 1; end if; end loop; Summary.CorrespondingAutomationRequestID := Automation_Request.RequestID; Summary.OperatingRegion := Automation_Request.OperatingRegion; Summary.TaskList := Min.Info.Assignment_Sequence; else declare Null_TAS : TaskAssignmentSummary; begin Summary := Null_TAS; end; end if; Free_Tree (Algebra); end Run_Calculate_Assignment; --------------------------------- -- Send_TaskAssignmentSummary -- --------------------------------- procedure Send_TaskAssignmentSummary (Mailbox : in out Assignment_Tree_Branch_Bound_Mailbox; Data : Assignment_Tree_Branch_Bound_Configuration_Data; State : in out Assignment_Tree_Branch_Bound_State; ReqId : Int64) is Summary : TaskAssignmentSummary; procedure Delete_AssignmentCostMatrix (assignmentCostMatrixes : in out Int64_AssignmentCostMatrix_Map; taskPlanOptions : Int64_TaskPlanOptions_Map_Map; uniqueAutomationRequests : Int64_UniqueAutomationRequest_Map) with Pre => (for all Req of taskPlanOptions => (Valid_TaskPlanOptions (Element (taskPlanOptions, Req)) and then Contains (uniqueAutomationRequests, Req) and then All_EligibleEntities_In_EntityList (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req)))) and then (for all Req of assignmentCostMatrixes => Valid_AssignmentCostMatrix (Element (assignmentCostMatrixes, Req)) and then Contains (uniqueAutomationRequests, Req) and then Contains (taskPlanOptions, Req) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req), Element (assignmentCostMatrixes, Req))) and then Contains (assignmentCostMatrixes, ReqId), Post => (for all Req of taskPlanOptions => (Valid_TaskPlanOptions (Element (taskPlanOptions, Req)) and then Contains (uniqueAutomationRequests, Req) and then All_EligibleEntities_In_EntityList (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req)))) and then (for all Req of assignmentCostMatrixes => Valid_AssignmentCostMatrix (Element (assignmentCostMatrixes, Req)) and then Contains (uniqueAutomationRequests, Req) and then Contains (taskPlanOptions, Req) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req), Element (assignmentCostMatrixes, Req))) and then not Contains (assignmentCostMatrixes, ReqId); procedure Delete_TaskPlanOption (assignmentCostMatrixes : Int64_AssignmentCostMatrix_Map; taskPlanOptions : in out Int64_TaskPlanOptions_Map_Map; uniqueAutomationRequests : Int64_UniqueAutomationRequest_Map) with Pre => (for all Req of taskPlanOptions => (Valid_TaskPlanOptions (Element (taskPlanOptions, Req)) and then Contains (uniqueAutomationRequests, Req) and then All_EligibleEntities_In_EntityList (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req)))) and then (for all Req of assignmentCostMatrixes => Valid_AssignmentCostMatrix (Element (assignmentCostMatrixes, Req)) and then Contains (uniqueAutomationRequests, Req) and then Contains (taskPlanOptions, Req) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req), Element (assignmentCostMatrixes, Req))) and then not Contains (assignmentCostMatrixes, ReqId) and then Contains (taskPlanOptions, ReqId), Post => (for all Req of taskPlanOptions => (Valid_TaskPlanOptions (Element (taskPlanOptions, Req)) and then Contains (uniqueAutomationRequests, Req) and then All_EligibleEntities_In_EntityList (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req)))) and then (for all Req of assignmentCostMatrixes => Valid_AssignmentCostMatrix (Element (assignmentCostMatrixes, Req)) and then Contains (uniqueAutomationRequests, Req) and then Contains (taskPlanOptions, Req) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req), Element (assignmentCostMatrixes, Req))) and then not Contains (assignmentCostMatrixes, ReqId) and then not Contains (taskPlanOptions, ReqId); procedure Delete_UniqueAutomationRequest (assignmentCostMatrixes : Int64_AssignmentCostMatrix_Map; taskPlanOptions : Int64_TaskPlanOptions_Map_Map; uniqueAutomationRequests : in out Int64_UniqueAutomationRequest_Map) with Pre => (for all Req of taskPlanOptions => (Valid_TaskPlanOptions (Element (taskPlanOptions, Req)) and then Contains (uniqueAutomationRequests, Req) and then All_EligibleEntities_In_EntityList (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req)))) and then (for all Req of assignmentCostMatrixes => Valid_AssignmentCostMatrix (Element (assignmentCostMatrixes, Req)) and then Contains (uniqueAutomationRequests, Req) and then Contains (taskPlanOptions, Req) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req), Element (assignmentCostMatrixes, Req))) and then not Contains (assignmentCostMatrixes, ReqId) and then not Contains (taskPlanOptions, ReqId) and then Contains (uniqueAutomationRequests, ReqId), Post => (for all Req of taskPlanOptions => (Valid_TaskPlanOptions (Element (taskPlanOptions, Req)) and then Contains (uniqueAutomationRequests, Req) and then All_EligibleEntities_In_EntityList (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req)))) and then (for all Req of assignmentCostMatrixes => Valid_AssignmentCostMatrix (Element (assignmentCostMatrixes, Req)) and then Contains (uniqueAutomationRequests, Req) and then Contains (taskPlanOptions, Req) and then All_Travels_In_CostMatrix (Element (uniqueAutomationRequests, Req), Element (taskPlanOptions, Req), Element (assignmentCostMatrixes, Req))); --------------------------------- -- Delete_AssignmentCostMatrix -- --------------------------------- procedure Delete_AssignmentCostMatrix (assignmentCostMatrixes : in out Int64_AssignmentCostMatrix_Map; taskPlanOptions : Int64_TaskPlanOptions_Map_Map; uniqueAutomationRequests : Int64_UniqueAutomationRequest_Map) is pragma SPARK_Mode (Off); begin Delete (assignmentCostMatrixes, ReqId); end Delete_AssignmentCostMatrix; --------------------------- -- Delete_TaskPlanOption -- --------------------------- procedure Delete_TaskPlanOption (assignmentCostMatrixes : Int64_AssignmentCostMatrix_Map; taskPlanOptions : in out Int64_TaskPlanOptions_Map_Map; uniqueAutomationRequests : Int64_UniqueAutomationRequest_Map) is pragma SPARK_Mode (Off); begin Delete (taskPlanOptions, ReqId); end Delete_TaskPlanOption; ------------------------------------ -- Delete_UniqueAutomationRequest -- ------------------------------------ procedure Delete_UniqueAutomationRequest (assignmentCostMatrixes : Int64_AssignmentCostMatrix_Map; taskPlanOptions : Int64_TaskPlanOptions_Map_Map; uniqueAutomationRequests : in out Int64_UniqueAutomationRequest_Map) is pragma SPARK_Mode (Off); begin Delete (uniqueAutomationRequests, ReqId); end Delete_UniqueAutomationRequest; Error : Boolean; Message : Unbounded_String; begin pragma Assert (Contains (State.m_assignmentCostMatrixes, ReqId)); pragma Assert (All_Travels_In_CostMatrix (Element (State.m_uniqueAutomationRequests, ReqId), Element (State.m_taskPlanOptions, ReqId), Element (State.m_assignmentCostMatrixes, ReqId))); Run_Calculate_Assignment (Data, Element (State.m_uniqueAutomationRequests, ReqId), Element (State.m_assignmentCostMatrixes, ReqId), Element (State.m_taskPlanOptions, ReqId), Summary, Error, Message); if not Error then sendBroadcastMessage (Mailbox, Summary); else sendErrorMessage (Mailbox, Message); end if; Delete_AssignmentCostMatrix (State.m_assignmentCostMatrixes, State.m_taskPlanOptions, State.m_uniqueAutomationRequests); Delete_TaskPlanOption (State.m_assignmentCostMatrixes, State.m_taskPlanOptions, State.m_uniqueAutomationRequests); Delete_UniqueAutomationRequest (State.m_assignmentCostMatrixes, State.m_taskPlanOptions, State.m_uniqueAutomationRequests); end Send_TaskAssignmentSummary; ------------------------- -- TaskOptionId_In_Map -- ------------------------- function TaskOptionId_In_Map (TaskOptionId : Int64; TaskPlanOptions_Map : Int64_TPO_Map) return Boolean is (for some TaskId of TaskPlanOptions_Map => (for some TaskOption of Get (TaskPlanOptions_Map, TaskId).Options => (TaskId = TaskOption.TaskID and then TaskOption.TaskID = Get_TaskID (TaskOptionId) and then TaskOption.OptionID = Get_OptionID (TaskOptionId)))); ---------------------- -- Valid_Assignment -- ---------------------- function Valid_Assignment (Assignment : Assignment_Info; TaskPlanOptions_Map : Int64_TPO_Map; Automation_Request : UniqueAutomationRequest) return Boolean is ((for all TaskAssignment of Assignment.Assignment_Sequence => (TaskAssignment.TaskID in 0 .. 99_999 and then TaskAssignment.OptionID in 0 .. 99_999)) and then (for all EntityId of Assignment.Vehicle_Assignments => (Contains_Corresponding_TaskOption (Assignment.Assignment_Sequence, Element (Assignment.Vehicle_Assignments, EntityId).Last_TaskOption) and then (Contains_Corresponding_TaskOption (Automation_Request, TaskPlanOptions_Map, Element (Assignment.Vehicle_Assignments, EntityId).Last_TaskOption, EntityId))))); end Assignment_Tree_Branch_Bound;
oeis/121/A121364.asm
neoneye/loda-programs
11
81328
<reponame>neoneye/loda-programs ; A121364: Convolution of A066983 with the double Fibonacci sequence A103609. ; Submitted by <NAME> ; 0,0,1,2,3,6,10,18,29,50,81,136,220,364,589,966,1563,2550,4126,6710,10857,17622,28513,46224,74792,121160,196041,317434,513619,831430,1345282,2177322,3522981,5701290,9224881,14927768,24153636,39083988,63239221,102327390 mov $2,$0 sub $0,1 lpb $0 mov $3,$2 mov $4,$0 sub $0,1 trn $2,2 cmp $3,$2 sub $3,$1 cmp $4,0 sub $4,1 mul $5,$4 add $5,1 sub $5,$3 add $1,$5 lpe mov $0,$1