0
play

0 Correct Programming Compiler Compiler Hardware Language P - PowerPoint PPT Presentation

Bridging the Gap between Programming Languages and Hardware Weak Memory Models Anton Podkopaev Ori Lahav Viktor Vafeiadis 0 Correct Programming Compiler Compiler Hardware Language P Syntax PL compile P P PL HW PL HW is Memory Model


  1. Bridging the Gap between Programming Languages and Hardware Weak Memory Models Anton Podkopaev Ori Lahav Viktor Vafeiadis 0

  2. Correct Programming Compiler Compiler Hardware Language P Syntax PL compile P P PL HW PL HW is Memory Model Bridging the Gap between PL and Hardware Weak MMs 1

  3. Correct Compiler Compiler P Syntax PL compile P P PL HW PL HW is Memory Model Bridging the Gap between PL and Hardware Weak MMs Programming Hardware Language 1

  4. Correct Compiler P Syntax PL compile P P PL HW PL HW is Memory Model Bridging the Gap between PL and Hardware Weak MMs Programming Compiler Hardware Language 1

  5. Compiler P Syntax PL compile P P PL HW PL HW is Memory Model Bridging the Gap between PL and Hardware Weak MMs Correct Programming Compiler Hardware Language 1

  6. Compiler PL HW is Memory Model Bridging the Gap between PL and Hardware Weak MMs Correct Programming Compiler Hardware Language ∀ P ∈ Syntax ( PL ) . � compile ( P ) � HW � P � PL 1

  7. Compiler Bridging the Gap between PL and Hardware Weak MMs Correct Programming Compiler Hardware Language ∀ P ∈ Syntax ( PL ) . � compile ( P ) � HW � P � PL � − � { PL , HW } is Memory Model 1

  8. Compiler Bridging the Gap between PL and Hardware Weak MMs Correct Programming Compiler Hardware Language ∀ P ∈ Syntax ( PL ) . � compile ( P ) � HW � P � PL � − � { PL , HW } is Memory Model 1

  9. Strong (SC) MM disallows a b 1 ARM and POWER weak MMs allow a b 1! a := [ x ]; b := [ y ]; [ y ] := 1 ; [ x ] := b ; Values Memory [ x ] ← 0 [ y ] ← 0 a = ⊥ b = ⊥ ; ; 2

  10. Strong (SC) MM disallows a b 1 ARM and POWER weak MMs allow a b 1! a := [ x ]; b := [ y ]; [ y ] := 1 ; [ x ] := b ; Values Memory [ x ] ← 0 [ y ] ← 0 a = ⊥ b = ⊥ ; ; 2

  11. Strong (SC) MM disallows a b 1 ARM and POWER weak MMs allow a b 1! a := [ x ]; b := [ y ]; [ y ] := 1 ; [ x ] := b ; Values Memory [ x ] ← 0 [ y ] ← 0 a = 0 b = ⊥ ; ; 2

  12. Strong (SC) MM disallows a b 1 ARM and POWER weak MMs allow a b 1! a := [ x ]; b := [ y ]; [ y ] := 1 ; [ x ] := b ; Values Memory [ x ] ← 0 [ y ] ← 1 a = 0 b = ⊥ ; ; 2

  13. Strong (SC) MM disallows a b 1 ARM and POWER weak MMs allow a b 1! a := [ x ]; b := [ y ]; [ y ] := 1 ; [ x ] := b ; Values Memory [ x ] ← 0 [ y ] ← 1 a = 0 b = 1 ; ; 2

  14. Strong (SC) MM disallows a b 1 ARM and POWER weak MMs allow a b 1! a := [ x ]; b := [ y ]; [ y ] := 1 ; [ x ] := b ; Values Memory [ x ] ← 1 [ y ] ← 1 a = 0 b = 1 ; ; 2

  15. disallows a b 1 ARM and POWER weak MMs allow a b 1! Strong (SC) MM a := [ x ]; b := [ y ]; [ y ] := 1 ; [ x ] := b ; Values Memory [ x ] ← 1 [ y ] ← 1 a = 0 b = 1 ; ; 2

  16. ARM and POWER weak MMs allow a b 1! Strong (SC) MM disallows a = b = 1 a := [ x ]; b := [ y ]; [ y ] := 1 ; [ x ] := b ; Values Memory [ x ] ← 1 [ y ] ← 1 a = 0 b = 1 ; ; 2

  17. Strong (SC) MM disallows a = b = 1 a := [ x ]; b := [ y ]; [ y ] := 1 ; [ x ] := b ; ARM and POWER weak MMs allow a = b = 1! Values Memory [ x ] ← 1 [ y ] ← 1 a = 0 b = 1 ; ; 2

  18. 1. Declarative 1. Declarative 1. Declarative 1. Declarative CompCert Weak MMs 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies rf is acyclic rf is acyclic rf is acyclic 3. Uses C11-style coherence 3. Uses C11-style coherence hb eco is irreflexive hb eco is irreflexive 4. Non-multicopy-atomic w/o mutually recursive relations WeakestMO IMM [Chakraborty and Vafeiadis, 2019] plv.mpi-sws.org/imm/ Thank you! deps deps deps Bridging the Gap between PL and Hardware Weak MMs x86-TSO Promise ARMv7 ARMv8.3 RISC-V (R)C11 POWER 3

  19. 1. Declarative 1. Declarative 1. Declarative 1. Declarative CompCert Weak MMs 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies rf is acyclic rf is acyclic rf is acyclic 3. Uses C11-style coherence 3. Uses C11-style coherence hb eco is irreflexive hb eco is irreflexive 4. Non-multicopy-atomic w/o mutually recursive relations WeakestMO IMM [Chakraborty and Vafeiadis, 2019] plv.mpi-sws.org/imm/ Thank you! deps deps deps Bridging the Gap between PL and Hardware Weak MMs x86-TSO Promise ARMv7 ARMv8.3 RISC-V (R)C11 POWER 3

  20. 1. Declarative 1. Declarative 1. Declarative 1. Declarative CompCert Weak MMs 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies rf is acyclic rf is acyclic rf is acyclic 3. Uses C11-style coherence 3. Uses C11-style coherence hb eco is irreflexive hb eco is irreflexive 4. Non-multicopy-atomic w/o mutually recursive relations WeakestMO IMM [Chakraborty and Vafeiadis, 2019] plv.mpi-sws.org/imm/ Thank you! deps deps deps Bridging the Gap between PL and Hardware Weak MMs x86-TSO Promise ARMv7 ARMv8.3 RISC-V (R)C11 POWER 3

  21. 1. Declarative 1. Declarative 1. Declarative 1. Declarative CompCert Weak MMs 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies rf is acyclic rf is acyclic rf is acyclic 3. Uses C11-style coherence 3. Uses C11-style coherence hb eco is irreflexive hb eco is irreflexive 4. Non-multicopy-atomic w/o mutually recursive relations WeakestMO IMM [Chakraborty and Vafeiadis, 2019] plv.mpi-sws.org/imm/ Thank you! deps deps deps Bridging the Gap between PL and Hardware Weak MMs x86-TSO Promise ARMv7 ARMv8.3 RISC-V (R)C11 POWER 3

  22. 1. Declarative 1. Declarative 1. Declarative 1. Declarative CompCert Weak MMs 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies rf is acyclic rf is acyclic rf is acyclic 3. Uses C11-style coherence 3. Uses C11-style coherence hb eco is irreflexive hb eco is irreflexive 4. Non-multicopy-atomic w/o mutually recursive relations WeakestMO IMM [Chakraborty and Vafeiadis, 2019] plv.mpi-sws.org/imm/ Thank you! deps deps deps Bridging the Gap between PL and Hardware Weak MMs x86-TSO Promise ARMv7 ARMv8.3 RISC-V (R)C11 POWER 3

  23. 1. Declarative 1. Declarative 1. Declarative 1. Declarative CompCert Weak MMs 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies rf is acyclic rf is acyclic rf is acyclic 3. Uses C11-style coherence 3. Uses C11-style coherence hb eco is irreflexive hb eco is irreflexive 4. Non-multicopy-atomic w/o mutually recursive relations WeakestMO [Chakraborty and Vafeiadis, 2019] plv.mpi-sws.org/imm/ Thank you! deps deps deps Bridging the Gap between PL and Hardware Weak MMs x86-TSO Promise ARMv7 IMM ARMv8.3 RISC-V (R)C11 POWER 3

  24. 1. Declarative 1. Declarative 1. Declarative 1. Declarative CompCert Weak MMs 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies rf is acyclic rf is acyclic rf is acyclic 3. Uses C11-style coherence 3. Uses C11-style coherence hb eco is irreflexive hb eco is irreflexive 4. Non-multicopy-atomic w/o mutually recursive relations WeakestMO [Chakraborty and Vafeiadis, 2019] plv.mpi-sws.org/imm/ Thank you! deps deps deps Bridging the Gap between PL and Hardware Weak MMs x86-TSO Promise ARMv7 IMM ARMv8.3 RISC-V (R)C11 POWER 3

  25. 1. Declarative 1. Declarative 1. Declarative 1. Declarative CompCert Weak MMs 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies rf is acyclic rf is acyclic rf is acyclic 3. Uses C11-style coherence 3. Uses C11-style coherence hb eco is irreflexive hb eco is irreflexive 4. Non-multicopy-atomic w/o mutually recursive relations WeakestMO [Chakraborty and Vafeiadis, 2019] plv.mpi-sws.org/imm/ Thank you! deps deps deps Bridging the Gap between PL and Hardware Weak MMs x86-TSO Promise ARMv7 IMM ARMv8.3 RISC-V (R)C11 POWER 3

  26. 1. Declarative 1. Declarative 1. Declarative CompCert Weak MMs 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies 2. Preserves syntactic dependencies rf is acyclic rf is acyclic rf is acyclic 3. Uses C11-style coherence 3. Uses C11-style coherence hb eco is irreflexive hb eco is irreflexive 4. Non-multicopy-atomic w/o mutually recursive relations WeakestMO [Chakraborty and Vafeiadis, 2019] plv.mpi-sws.org/imm/ Thank you! deps deps deps Bridging the Gap between PL and Hardware Weak MMs 1. Declarative x86-TSO Promise ARMv7 IMM ARMv8.3 RISC-V (R)C11 POWER 3

  27. R x 1 R y 1 Axioms: rf is acyclic 1. data W y 1 W x 1 … data rf data po rf data fr rf fr (Declarative) Executions in IMM a := [ x ]; b := [ y ]; [ y ] := 1 ; [ x ] := b ; R x 0 R y 0 R x 0 R y 1 R x 1 R y 1 , , W y 1 W x 0 W y 1 W x 1 W y 1 W x 1 4

  28. R x 1 R y 1 Axioms: rf is acyclic 1. data W y 1 W x 1 … data rf data po rf data fr rf fr (Declarative) Executions in IMM a := [ x ]; b := [ y ]; [ y ] := 1 ; [ x ] := b ; R x 0 R y 0 R x 0 R y 1 R x 1 R y 1 , , W y 1 W x 0 W y 1 W x 1 W y 1 W x 1 4

  29. Axioms: rf is acyclic 1. data R x 0 R y 0 R x 0 R y 1 R x 1 R y 1 , , … W y 1 W x 0 W y 1 W x 1 W y 1 W x 1 data po rf data rf rf data fr fr (Declarative) Executions in IMM a := [ x ]; b := [ y ]; [ y ] := 1 ; [ x ] := b ; R x 1 R y 1 W y 1 W x 1 4

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend